├── .gitignore ├── README.mediawiki └── StructuredDynamics ├── SplClassLoader.php └── osf ├── framework ├── Datatypes.php ├── LanguageCodes.php ├── Namespaces.php ├── README.md ├── Resultset.php ├── Subject.php ├── namespaces.csv └── namespaces.extensive.csv └── ws ├── Coding Standard ├── README.mediawiki ├── SD-PolyStyle-style-suite │ ├── example.php │ └── example.php-code └── StructuredDynamics_v_0_1-style-suite_full.zip ├── LICENSE-2.0.txt ├── NOTICE.txt ├── README.mediawiki ├── VERSION.ini ├── auth ├── lister │ ├── AuthLister.php │ ├── README.mediawiki │ ├── index.php │ └── interfaces │ │ └── DefaultSourceInterface.php └── registrar │ ├── access │ ├── AuthRegistrarAccess.php │ ├── README.mediawiki │ ├── index.php │ └── interfaces │ │ └── DefaultSourceInterface.php │ ├── group │ ├── AuthRegistrarGroup.php │ ├── README.mediawiki │ ├── index.php │ └── interfaces │ │ └── DefaultSourceInterface.php │ ├── user │ ├── AuthRegistrarUser.php │ ├── README.mediawiki │ ├── index.php │ └── interfaces │ │ └── DefaultSourceInterface.php │ └── ws │ ├── AuthRegistrarWs.php │ ├── README.mediawiki │ ├── index.php │ └── interfaces │ └── DefaultSourceInterface.php ├── converter ├── common │ ├── CommonParser.php │ ├── ConverterCommON.php │ ├── README.mediawiki │ └── index.php └── irjson │ ├── ConverterIrJSON.php │ ├── Dataset.php │ ├── InstanceRecord.php │ ├── LinkageSchema.php │ ├── README.mediawiki │ ├── StructureSchema.php │ ├── index.php │ ├── irJSONParser.php │ └── test_parser.php ├── crud ├── create │ ├── CrudCreate.php │ ├── README.mediawiki │ ├── index.php │ └── interfaces │ │ └── DefaultSourceInterface.php ├── delete │ ├── CrudDelete.php │ ├── README.mediawiki │ ├── index.php │ └── interfaces │ │ └── DefaultSourceInterface.php ├── read │ ├── CrudRead.php │ ├── README.mediawiki │ ├── index.php │ └── interfaces │ │ └── DefaultSourceInterface.php └── update │ ├── CrudUpdate.php │ ├── README.mediawiki │ ├── index.php │ └── interfaces │ └── DefaultSourceInterface.php ├── dataset ├── create │ ├── DatasetCreate.php │ ├── README.mediawiki │ ├── index.php │ └── interfaces │ │ └── DefaultSourceInterface.php ├── delete │ ├── DatasetDelete.php │ ├── README.mediawiki │ ├── index.php │ └── interfaces │ │ └── DefaultSourceInterface.php ├── read │ ├── DatasetRead.php │ ├── README.mediawiki │ ├── index.php │ └── interfaces │ │ └── DefaultSourceInterface.php └── update │ ├── DatasetUpdate.php │ ├── README.mediawiki │ ├── index.php │ └── interfaces │ └── DefaultSourceInterface.php ├── dtd ├── auth │ └── lister │ │ └── authLister.dtd ├── converter │ ├── bibtex │ │ └── bibtex.dtd │ ├── common │ │ └── common.dtd │ ├── irjson │ │ └── irjson.dtd │ └── tsv │ │ └── tsv.dtd ├── crud │ └── read │ │ └── crudRead.dtd ├── dataset │ └── read │ │ └── datasetRead.dtd ├── ontology │ └── read │ │ └── ontologyRead.dtd ├── search │ └── search.dtd └── sparql │ └── sparql.dtd ├── framework ├── ClassHierarchy.php ├── Conneg.php ├── Error.php ├── OWLOntology.php ├── ProcessorXML.php ├── PropertyHierarchy.php ├── Solr.php ├── SourceInterface.php ├── SparqlQuery.php ├── SparqlQueryHttp.php ├── SparqlQueryOdbc.php ├── WebService.php ├── arc2 │ └── README.mediawiki ├── solr_schema_v1_3_2.xml └── solr_schema_v1_3_2_en_fr.xml ├── index.php ├── keys.ini ├── ontology ├── admin │ ├── README.mediawiki │ ├── analyzeRegisters.php │ └── destroy.php ├── create │ ├── OntologyCreate.php │ ├── README.mediawiki │ ├── index.php │ └── interfaces │ │ └── DefaultSourceInterface.php ├── delete │ ├── OntologyDelete.php │ ├── README.mediawiki │ ├── index.php │ └── interfaces │ │ └── DefaultSourceInterface.php ├── read │ ├── OntologyRead.php │ ├── README.mediawiki │ ├── index.php │ └── interfaces │ │ └── DefaultSourceInterface.php └── update │ ├── OntologyUpdate.php │ ├── README.mediawiki │ ├── index.php │ └── interfaces │ └── DefaultSourceInterface.php ├── osf.ini ├── revision ├── delete │ ├── README.mediawiki │ ├── RevisionDelete.php │ ├── index.php │ └── interfaces │ │ └── DefaultSourceInterface.php ├── diff │ ├── README.mediawiki │ ├── RevisionDiff.php │ ├── index.php │ └── interfaces │ │ └── DefaultSourceInterface.php ├── lister │ ├── README.mediawiki │ ├── RevisionLister.php │ ├── index.php │ └── interfaces │ │ └── DefaultSourceInterface.php ├── read │ ├── README.mediawiki │ ├── RevisionRead.php │ ├── index.php │ └── interfaces │ │ └── DefaultSourceInterface.php └── update │ ├── README.mediawiki │ ├── RevisionUpdate.php │ ├── index.php │ └── interfaces │ └── DefaultSourceInterface.php ├── scones ├── README.mediawiki ├── Scones.php ├── index.php └── interfaces │ └── DefaultSourceInterface.php ├── search ├── README.mediawiki ├── Search.php ├── index.php └── interfaces │ └── DefaultSourceInterface.php └── sparql ├── README.mediawiki ├── Sparql.php ├── index.php └── interfaces └── DefaultSourceInterface.php /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | /StructuredDynamics/osf/ws/doc -------------------------------------------------------------------------------- /README.mediawiki: -------------------------------------------------------------------------------- 1 | == Introduction == 2 | 3 | '''OSF''' is a platform-independent Web services framework for accessing and exposing structured [http://wiki.opensemanticframework.org/index.php/RDF_Concept RDF] (Resource Description Framework) data. Its central organizing perspective is that of the dataset. These datasets contain instance records, with the structural relationships amongst the data and their attributes and concepts defined via ontologies (schema with accompanying vocabularies). 4 | 5 | The OSF middleware framework is [http://www.mkbergman.com/?p=499 generally] [http://wiki.opensemanticframework.org/index.php/REST_Concept RESTful] in design and is based on HTTP and Web protocols and open standards. The initial OSF framework comes packaged with a baseline set of more than 20 Web services in [http://wiki.opensemanticframework.org/index.php/CRUD_Concept CRUD], browse, search, tagging, ontology management, and export and import. All Web services are exposed via APIs and SPARQL endpoints. Each request to an individual Web service returns an HTTP status and optionally a document of ''resultsets''. Each results document can be serialized in many ways, and may be expressed as either RDF, pure XML, JSON, or different flavors of [http://wiki.opensemanticframework.org/index.php/Introduction_to_irON irON]. 6 | 7 | In initial release, OSF has direct interfaces to the [http://wiki.opensemanticframework.org/index.php/Virtuoso Virtuoso] RDF triple store (via ODBC, and later HTTP) and the [http://wiki.opensemanticframework.org/index.php/Solr Solr] faceted, full-text search engine(via HTTP). However, OSF has been designed to be fully platform-independent. Support for additional datastores and engines are planned. The design also allows other specialized systems to be included, such as analysis or advanced inference engines. 8 | 9 | The framework is open source (Apache 2 license) and designed for extensibility. OSF and its extensions and enhancements are distributed and documented on the '''Open Semantic Framework''' [http://opensemanticframework.org/ Web site]. 10 | 11 | You can read more about [http://wiki.opensemanticframework.org/index.php/Open_Semantic_Framework OSF here] 12 | 13 | == Documentation == 14 | 15 | OSF is fully documented on the [http://wiki.opensemanticframework.org Techwiki]. You can easily access all the documentation pages related to it by checking this [http://wiki.opensemanticframework.org/index.php/Category:Open_Semantic_Framework category section]. 16 | 17 | == Architecture == 18 | 19 | The general OSF architecture is described in this [http://wiki.opensemanticframework.org/index.php/OSF_Web_Service_Architecture document page]. It also explains the echosystem in which it lives (and its related to other parts of the OSF (Open Semantic Framework) like [http://drupal.org/project/osf OSF for Drupal]. 20 | 21 | == Installing OSF == 22 | 23 | {| 24 | |- 25 | | [https://github.com/structureddynamics/Open-Semantic-Framework-Installer Get started quickly with OSF by using the Open Semantic Framework Installer] 26 | |} 27 | 28 | Additionally you can find debugging tips and support on the [http://groups.google.com/group/open-semantic-framework Mailing List] 29 | 30 | == Upgrading OSF == 31 | 32 | An existing OSF instance can easily be upgrader using the [https://github.com/structureddynamics/Open-Semantic-Framework-Installer OSF-Installer]. 33 | 34 | Note: the version of the OSF instance that should be minimally installed is version 3.0.0. If you have an older version than that, then you will have to manually upgrade your version to the version 3.0.0 and then you will have to run the OSF-Installer OSF upgrader script. 35 | 36 | == OSF Web Services == 37 | 38 | Here is a complete list of all the web service endpoints currently available in OSF: 39 | 40 | * [http://wiki.opensemanticframework.org/index.php/OSF_Installer Installation Guide] 41 | * [http://wiki.opensemanticframework.org/index.php/OSF_Web_Service Overview] 42 | * [http://wiki.opensemanticframework.org/index.php/OSF_Web_Service_Architecture OSF Web Service Architecture] 43 | * [http://wiki.opensemanticframework.org/index.php/OSF_Web_Services_Permissions Datasets and Access Rights] 44 | * [http://wiki.opensemanticframework.org/index.php/structXML structXML], the OSF Web Service XML data structure 45 | * [http://wiki.opensemanticframework.org/index.php/OSF_Web_Service_API_and_Web_Services_Documentation OSF Web Service API and Web Services Documentation], with the specific services of: 46 | ** [http://wiki.opensemanticframework.org/index.php/Auth_Registrar:_Access Auth Registrar: Access] 47 | ** [http://wiki.opensemanticframework.org/index.php/Auth_Registrar:_Group Auth Registrar: Group] 48 | ** [http://wiki.opensemanticframework.org/index.php/Auth_Registrar:_User Auth Registrar: User] 49 | ** [http://wiki.opensemanticframework.org/index.php/Auth_Registrar:_WS Auth Registrar: WS] 50 | ** [http://wiki.opensemanticframework.org/index.php/Auth:_Lister Auth: Lister] 51 | ** [http://wiki.opensemanticframework.org/index.php/Ontology_reate Ontology Create] 52 | ** [http://wiki.opensemanticframework.org/index.php/Ontology_Read Ontology Read] 53 | ** [http://wiki.opensemanticframework.org/index.php/Ontology_Update Ontology Update] 54 | ** [http://wiki.opensemanticframework.org/index.php/Ontology_Delete Ontology Delete] 55 | ** [http://wiki.opensemanticframework.org/index.php/Dataset:_Create Dataset: Create] 56 | ** [http://wiki.opensemanticframework.org/index.php/Dataset:_Read Dataset: Read] 57 | ** [http://wiki.opensemanticframework.org/index.php/Dataset:_Update Dataset: Update] 58 | ** [http://wiki.opensemanticframework.org/index.php/Dataset:_Delete Dataset: Delete] 59 | ** [http://wiki.opensemanticframework.org/index.php/CRUD:_Create CRUD: Create] 60 | ** [http://wiki.opensemanticframework.org/index.php/CRUD:_Read CRUD: Read] 61 | ** [http://wiki.opensemanticframework.org/index.php/CRUD:_Update CRUD: Update] 62 | ** [http://wiki.opensemanticframework.org/index.php/CRUD:_Delete CRUD: Delete] 63 | ** [http://wiki.opensemanticframework.org/index.php/Revision:_Diff Revision: Diff] 64 | ** [http://wiki.opensemanticframework.org/index.php/Revision:_Delete Revision: Delete] 65 | ** [http://wiki.opensemanticframework.org/index.php/Revision:_Read Revision: Read] 66 | ** [http://wiki.opensemanticframework.org/index.php/Revision:_Update Revision: Update] 67 | ** [http://wiki.opensemanticframework.org/index.php/Revision:_Lister Revision: Lister] 68 | ** [http://wiki.opensemanticframework.org/index.php/Search Search] 69 | ** [http://wiki.opensemanticframework.org/index.php/SPARQL SPARQL] 70 | ** [http://wiki.opensemanticframework.org/index.php/Scones Scones] 71 | ** [http://wiki.opensemanticframework.org/index.php/Converter:_commON Converter: commON] (import and export) 72 | ** [http://wiki.opensemanticframework.org/index.php/Converter:_irJSON Converter: irJSON] (import and export) 73 | 74 | == How to Use Web Services Endpoint == 75 | 76 | The easiest way to get started is to use the [https://github.com/StructuredDynamics/OSF-Web-Services-PHP-API OSF Web Services PHP API] to create and send queries to any OSF web service endpoint. 77 | 78 | == Administer an OSF Instance == 79 | 80 | Many command line tools exists to help system administrators to administer a OSF instance. The tools are: 81 | 82 | * [https://github.com/structureddynamics/OSF-Datasets-Management-Tool Datasets Management Tool] 83 | * [https://github.com/structureddynamics/OSF-Ontologies-Management-Tool Ontologies Management Tool] 84 | * [https://github.com/structureddynamics/OSF-Permissions-Management-Tool Permissions Management Tool] 85 | * [https://github.com/structureddynamics/OSF-Data-Validator-Tool Data Validator Tool] 86 | 87 | == Testing an OSF Instance == 88 | 89 | An integration tests suites that includes more than 700 tests and 4000 assertions as been developed to test all the features of a running OSF instance: 90 | 91 | * [https://github.com/structureddynamics/OSF-Tests-Suites OSF Tests Suites] 92 | 93 | These tests can be run at any time to make sure that the instance is fully operational. It is normally used by the OSF Installer to make sure that an instance is fully operational after OSF is installed, or after it got upgraded. 94 | 95 | == Developers == 96 | 97 | Developers and commiters to the Git repository should comply to the coding standards. An outline of the coding style is available in the Coding Standard folder. Additional requirements are listed in the README.mediawiki file in that folder. Finally, coding style is enforced b the PolyStyle code formatter application available here: http://polystyle.com 98 | 99 | ==Auto-loading of Classes== 100 | 101 | OSF does comply with the [PSR-0 Standard Document](https://gist.github.com/1234504) 102 | for auto-loading the classes of the framework. The SplClassLoader class that has been developed by 103 | the same group can be used as the classes auto-loader. 104 | -------------------------------------------------------------------------------- /StructuredDynamics/SplClassLoader.php: -------------------------------------------------------------------------------- 1 | register(); 20 | } 21 | } 22 | 23 | /** 24 | * SplClassLoader implementation that implements the technical interoperability 25 | * standards for PHP 5.3 namespaces and class names. 26 | * 27 | * http://groups.google.com/group/php-standards/web/final-proposal 28 | * 29 | * // Example which loads classes for the Doctrine Common package in the 30 | * // Doctrine\Common namespace. 31 | * $classLoader = new SplClassLoader('Doctrine\Common', '/path/to/doctrine'); 32 | * $classLoader->register(); 33 | * 34 | * @author Jonathan H. Wage 35 | * @author Roman S. Borschel 36 | * @author Matthew Weier O'Phinney 37 | * @author Kris Wallsmith 38 | * @author Fabien Potencier 39 | */ 40 | class SplClassLoader 41 | { 42 | private $_fileExtension = '.php'; 43 | private $_namespace; 44 | private $_includePath; 45 | private $_namespaceSeparator = '\\'; 46 | 47 | /** 48 | * Creates a new SplClassLoader that loads classes of the 49 | * specified namespace. 50 | * 51 | * @param string $ns The namespace to use. 52 | */ 53 | public function __construct($ns = null, $includePath = null) 54 | { 55 | $this->_namespace = $ns; 56 | $this->_includePath = $includePath; 57 | } 58 | 59 | /** 60 | * Sets the namespace separator used by classes in the namespace of this class loader. 61 | * 62 | * @param string $sep The separator to use. 63 | */ 64 | public function setNamespaceSeparator($sep) 65 | { 66 | $this->_namespaceSeparator = $sep; 67 | } 68 | 69 | /** 70 | * Gets the namespace seperator used by classes in the namespace of this class loader. 71 | * 72 | * @return void 73 | */ 74 | public function getNamespaceSeparator() 75 | { 76 | return $this->_namespaceSeparator; 77 | } 78 | 79 | /** 80 | * Sets the base include path for all class files in the namespace of this class loader. 81 | * 82 | * @param string $includePath 83 | */ 84 | public function setIncludePath($includePath) 85 | { 86 | $this->_includePath = $includePath; 87 | } 88 | 89 | /** 90 | * Gets the base include path for all class files in the namespace of this class loader. 91 | * 92 | * @return string $includePath 93 | */ 94 | public function getIncludePath() 95 | { 96 | return $this->_includePath; 97 | } 98 | 99 | /** 100 | * Sets the file extension of class files in the namespace of this class loader. 101 | * 102 | * @param string $fileExtension 103 | */ 104 | public function setFileExtension($fileExtension) 105 | { 106 | $this->_fileExtension = $fileExtension; 107 | } 108 | 109 | /** 110 | * Gets the file extension of class files in the namespace of this class loader. 111 | * 112 | * @return string $fileExtension 113 | */ 114 | public function getFileExtension() 115 | { 116 | return $this->_fileExtension; 117 | } 118 | 119 | /** 120 | * Installs this class loader on the SPL autoload stack. 121 | */ 122 | public function register() 123 | { 124 | spl_autoload_register(array($this, 'loadClass')); 125 | } 126 | 127 | /** 128 | * Uninstalls this class loader from the SPL autoloader stack. 129 | */ 130 | public function unregister() 131 | { 132 | spl_autoload_unregister(array($this, 'loadClass')); 133 | } 134 | 135 | /** 136 | * Loads the given class or interface. 137 | * 138 | * @param string $className The name of the class to load. 139 | * @return void 140 | */ 141 | public function loadClass($className) 142 | { 143 | if(null === $this->_namespace || $this->_namespace.$this->_namespaceSeparator === substr($className, 0, strlen($this->_namespace.$this->_namespaceSeparator))) { 144 | $fileName = ''; 145 | $namespace = ''; 146 | if (false !== ($lastNsPos = strripos($className, $this->_namespaceSeparator))) { 147 | $namespace = substr($className, 0, $lastNsPos); 148 | $className = substr($className, $lastNsPos + 1); 149 | $fileName = str_replace($this->_namespaceSeparator, DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR; 150 | } 151 | $fileName .= str_replace('_', DIRECTORY_SEPARATOR, $className) . $this->_fileExtension; 152 | //if(file_exists(($this->_includePath !== null ? $this->_includePath . DIRECTORY_SEPARATOR : '') . $fileName)) 153 | require ($this->_includePath !== null ? $this->_includePath . DIRECTORY_SEPARATOR : '') . $fileName; 154 | } 155 | } 156 | } -------------------------------------------------------------------------------- /StructuredDynamics/osf/framework/Datatypes.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /StructuredDynamics/osf/framework/LanguageCodes.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /StructuredDynamics/osf/framework/README.md: -------------------------------------------------------------------------------- 1 | New prefixes<->namespaces can be defined in the namespaces.csv file. All these namespaces definitions 2 | will be taken into account by the Namespaces class, and will be added to the core ones defined 3 | within the Namespaces class. 4 | 5 | If you want to make sure to have most of the namespaces currently used on the Web, you should rename 6 | the namespaces.extensive.csv file for namespaces.csv. This list of nearly 900 namespaces is coming 7 | from the http://prefix.cc website which aggregates most of the namespaces encountered on the web. -------------------------------------------------------------------------------- /StructuredDynamics/osf/framework/namespaces.csv: -------------------------------------------------------------------------------- 1 | address,http://schemas.talis.com/2005/address/schema# 2 | asn,http://purl.org/ASN/schema/core/ 3 | bkn,http://purl.org/ontology/bkn# 4 | bkn_temp,http://purl.org/ontology/bkn/temp# 5 | bkn_base,http://purl.org/ontology/bkn/base/ 6 | cyc,http://sw.cyc.com/2006/07/27/cyc/ 7 | eor,http://dublincore.org/2000/03/13/eor# 8 | event,http://purl.org/NET/c4dm/event.owl# 9 | frbr,http://purl.org/vocab/frbr/core# 10 | gem,http://purl.org/gem/elements/ 11 | gemq,http://purl.org/gem/qualifiers/ 12 | loc,http://www.loc.gov/loc.terms/relators/ 13 | mo,http://purl.org/ontology/mo/ 14 | po,http://purl.org/ontology/po/ 15 | rss,http://purl.org/rss/1.0/ 16 | peg,http://purl.org/ontology/peg# 17 | muni,http://purl.org/ontology/muni# 18 | dbpedia_ont,http://dbpedia.org/ontology/ 19 | nhccn,http://purl.org/ontology/nhccn# 20 | doha,http://purl.org/ontology/doha# 21 | cognonto,http://purl.org/ontology/cognonto# -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/Coding Standard/README.mediawiki: -------------------------------------------------------------------------------- 1 | This the PHP style suite (PolyStyle, see http://polystyle.com) used to format the code of the OSFand conStruct projects. The file example.php-code defines the coding standards for these projects. Additionally we have these additional requirements: 2 | 3 | * Indent character: space 4 | * Tab width: 2 5 | * Max blank lines: 2 6 | * Encoding: UTF-8 7 | * New line: Unix 8 | * Page width: 120 9 | * Keep HTML cases 10 | 11 | To use PolyStyle, you have to unzip the file StructuredDynamics_v_0_1-style-suite_full.zip into the folder "/polystyle/examples/.../" to make it available to PolyStyle to format your PHP files according to this coding standard. -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/Coding Standard/SD-PolyStyle-style-suite/example.php: -------------------------------------------------------------------------------- 1 | 16 | = <%= x %>>text 17 | 18 | <% 19 | a; 20 | %> 21 | 22 | <% %> 23 | 24 | <%= a %> 25 | 26 | -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/Coding Standard/SD-PolyStyle-style-suite/example.php-code: -------------------------------------------------------------------------------- 1 | /** 2 | * This is a recommended Polystyle PHP example. 3 | * Reformat this file as you like to define your personal style. 4 | * 5 | * Notes: 6 | * 1.) Polystyle only modifies whitespace and will never alter the actual content 7 | * of your files, such as adding {}'s in 'if' statements. 8 | * 9 | * 2.) Polystyle does not format comments based on examples. It will always 10 | * format comments the same way. 11 | * 12 | * Copyright Flashbulb Studios 13 | * 14 | * http://polystyle.com 15 | */ 16 | 17 | class MyClass 18 | extends Parent 19 | implements Intf 20 | { 21 | function &funct($a, &$b, $c, ...) 22 | { 23 | // if statements with empty braces 24 | if ($x) 25 | { 26 | } 27 | elseif ($x) 28 | { 29 | } 30 | else if ($x) 31 | { 32 | } 33 | else 34 | { 35 | } 36 | 37 | // if statements with exactly one braced statement 38 | if ($x) 39 | { 40 | a(0); 41 | } 42 | else if ($x) 43 | { 44 | b(); 45 | } 46 | else 47 | { 48 | c(); 49 | } 50 | 51 | // special 'if' cases 52 | if (x) 53 | { 54 | a(); 55 | } 56 | else 57 | { 58 | c(); 59 | } 60 | 61 | if (x) 62 | { 63 | a(); 64 | 65 | a(); 66 | } 67 | else 68 | { 69 | c(); 70 | 71 | c(); 72 | } 73 | 74 | // if statements with a single implicit substatement 75 | if ($x) 76 | a(); 77 | 78 | else if ($x) 79 | b(); 80 | 81 | else 82 | c(); 83 | 84 | // if statements with multiple statements 85 | if (!@$z) 86 | { 87 | $j=++$i & ((Obj)$i); 88 | 89 | $z=$j[0][0][0]; 90 | } 91 | else if ($a and $b) 92 | { 93 | $a(); 94 | 95 | return x::$y; 96 | } 97 | else 98 | { 99 | echo $a; 100 | 101 | return new Object()->method($a, $b, $c); 102 | } 103 | 104 | // alternate syntax 105 | if ($x): 106 | endif; 107 | 108 | if ($x): 109 | a(); 110 | else if ($x): 111 | a(); 112 | else: 113 | a(); 114 | endif; 115 | 116 | if ($x): 117 | a(); 118 | 119 | b(); 120 | endif; 121 | 122 | // while statements with a single implicit substatement 123 | while ($x) 124 | a(); 125 | 126 | // while statements with a single implicit 'if' substatement 127 | while ($x) 128 | if ($x) 129 | a(); 130 | 131 | // while with multiple statements 132 | while ($k == &$j) 133 | { 134 | $h[0] = $a ? $b : $c::$d->$e; 135 | 136 | break; 137 | } 138 | 139 | // for statements with a single braced statement 140 | for (var $i; $i > 6; $i++) 141 | { 142 | break 1; 143 | } 144 | 145 | // for statement with list initialiser and a single multiline substatement 146 | for ($x=0, $i=0; $x < $i; $x++) 147 | { 148 | foreach ($x as $set) 149 | { 150 | } // for statement with 'in' initialiser 151 | } 152 | 153 | for (;;) 154 | { 155 | } // for statement with empty control statements 156 | 157 | foreach ($x as $row): 158 | $x; 159 | endforeach; 160 | 161 | // do statements with a single braced substatement 162 | do 163 | { 164 | continue; 165 | } while ($x); 166 | 167 | do 168 | { 169 | } while ($x); 170 | 171 | /* Switch blocks: 172 | * 173 | * You can have case substatements be aligned by giving an example like: 174 | * 175 | * case 1: a(); 176 | * 177 | * b(); 178 | * 179 | * c(); 180 | * 181 | * etc... 182 | */ 183 | switch ($c) 184 | { 185 | case 1: 186 | case 2: 187 | case 3: 188 | a(); 189 | 190 | b(); 191 | 192 | c(); 193 | 194 | case 4: break; // case with exactly one substatement 195 | 196 | default: break; 197 | } 198 | 199 | // alternate syntax 200 | switch ($c): 201 | default: break; 202 | endswitch; 203 | 204 | // try-catch-finally with empty bodies 205 | try 206 | { 207 | } 208 | catch(Throwable e) 209 | { 210 | } 211 | finally 212 | { 213 | } 214 | 215 | // try-catch-finally with exactly one statement 216 | try 217 | { 218 | statement; 219 | } 220 | catch( Throwable t ) 221 | { 222 | statement; 223 | } 224 | finally 225 | { 226 | statement; 227 | } 228 | 229 | // try-catch-finally with multiple statements 230 | try 231 | { 232 | statement; 233 | 234 | statement; 235 | } 236 | catch( Throwable e ) 237 | { 238 | statement; 239 | 240 | statement; 241 | } 242 | finally 243 | { 244 | statement; 245 | 246 | statement; 247 | 248 | statement; 249 | } 250 | 251 | return 'i' + "0" . "0"; 252 | } 253 | } 254 | 255 | function noArgFunct() 256 | { 257 | declare ($x) 258 | { 259 | var $i = $i * 3, $j, $k{0}; 260 | 261 | var $i = { 1, 2 }; 262 | 263 | ::delete [] $x; 264 | } 265 | 266 | @include_once "x.php"; 267 | 268 | // array with multiple elements 269 | $x=array 270 | ( 271 | false, 272 | false, 273 | false 274 | ); 275 | 276 | // array with a single element 277 | $x=array("a" => false); 278 | 279 | // array with no elements 280 | $x=array(); 281 | 282 | var $i = $j || $k; 283 | } 284 | 285 | function emptyBlockFunct() { } 286 | 287 | function exactlyOneStatementBlockFunct() { $i >> 1; } -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/Coding Standard/StructuredDynamics_v_0_1-style-suite_full.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/structureddynamics/OSF-Web-Services/885be5575a3ebb5f842570e40ece097fa9d32011/StructuredDynamics/osf/ws/Coding Standard/StructuredDynamics_v_0_1-style-suite_full.zip -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/NOTICE.txt: -------------------------------------------------------------------------------- 1 | =============================================================== 2 | == Notice of Attribution for the Apache License, Version 2.0 == 3 | =============================================================== 4 | 5 | OSF, a Web services framework for structured data. 6 | Copyright 2008-2011. Structured Dynamics LLC. 7 | 8 | OSF is one of the contributing components to the 9 | Open Semantic Framework (OSF); see http://openstructs.org. 10 | Additional technical documentation for OSF and its 11 | related OSF components is available at 12 | http://techwiki.openstructs.org. 13 | 14 | This product includes software developed by 15 | Structured Dynamics LLC (http://structureddynamics.com/). 16 | 17 | Specifically, this product is based on the OSF Web services 18 | framework provided under Apache 2 License by Structured Dynamics. 19 | The original software is available from 20 | 21 | As presently distributed, the OSF framework also provides hooks 22 | to these required software packages: 23 | 24 | -- OpenLink Software Virtuoso open source (VOS) server, provided under 25 | the GPL 2 license by OpenLink. See 26 | http://virtuoso.openlinksw.com/dataspace/dav/wiki/Main/VOSLicense. 27 | 28 | -- Apache Solr enterprise search server, provided under the 29 | Apache 2 license by the Apache Software Foundation. See 30 | http://www.apache.org/licenses/LICENSE-2.0. 31 | 32 | -- OWLAPI, provided under the LGPL license. See http://www.gnu.org/copyleft/lesser.html 33 | 34 | -- PHP/Java Bridge, provided under the LGPL license. See http://www.gnu.org/copyleft/lesser.html 35 | 36 | -- Gate, provided under the LGPL license. See http://www.gnu.org/copyleft/lesser.html 37 | 38 | OSF also has hooks to other open source products; for a listing and license 39 | terms of these, see: 40 | http://wiki.opensemanticframework.org/index.php/Open_Source_Software_Licenses -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/README.mediawiki: -------------------------------------------------------------------------------- 1 | == Introduction == 2 | 3 | '''OSF''' is a platform-independent Web services framework for accessing and exposing structured [http://wiki.opensemanticframework.org/index.php/RDF_Concept RDF] (Resource Description Framework) data. Its central organizing perspective is that of the dataset. These datasets contain instance records, with the structural relationships amongst the data and their attributes and concepts defined via ontologies (schema with accompanying vocabularies). 4 | 5 | The OSF middleware framework is [http://www.mkbergman.com/?p=499 generally] [http://wiki.opensemanticframework.org/index.php/REST_Concept RESTful] in design and is based on HTTP and Web protocols and open standards. The initial OSF framework comes packaged with a baseline set of more than 20 Web services in [http://wiki.opensemanticframework.org/index.php/CRUD_Concept CRUD], browse, search, tagging, ontology management, and export and import. All Web services are exposed via APIs and SPARQL endpoints. Each request to an individual Web service returns an HTTP status and optionally a document of ''resultsets''. Each results document can be serialized in many ways, and may be expressed as either RDF, pure XML, JSON, or different flavors of [http://wiki.opensemanticframework.org/index.php/Introduction_to_irON irON]. 6 | 7 | In initial release, OSF has direct interfaces to the [http://wiki.opensemanticframework.org/index.php/Virtuoso Virtuoso] RDF triple store (via ODBC, and later HTTP) and the [http://wiki.opensemanticframework.org/index.php/Solr Solr] faceted, full-text search engine(via HTTP). However, OSF has been designed to be fully platform-independent. Support for additional datastores and engines are planned. The design also allows other specialized systems to be included, such as analysis or advanced inference engines. 8 | 9 | The framework is open source (Apache 2 license) and designed for extensibility. OSF and its extensions and enhancements are distributed and documented on the '''Open Semantic Framework''' [http://opensemanticframework.org/ Web site]. 10 | 11 | You can read more about [http://wiki.opensemanticframework.org/index.php/Open_Semantic_Framework OSF here] 12 | 13 | == Documentation == 14 | 15 | OSF is fully documented on the [http://wiki.opensemanticframework.org Techwiki]. You can easily access all the documentation pages related to it by checking this [http://wiki.opensemanticframework.org/index.php/Category:Open_Semantic_Framework category section]. 16 | 17 | == Architecture == 18 | 19 | The general OSF architecture is described in this [http://wiki.opensemanticframework.org/index.php/OSF_Web_Service_Architecture document page]. It also explains the echosystem in which it lives (and its related to other parts of the OSF (Open Semantic Framework) like [http://drupal.org/project/osf OSF for Drupal]. 20 | 21 | == Installing OSF == 22 | 23 | {| 24 | |- 25 | | [https://github.com/structureddynamics/Open-Semantic-Framework-Installer Get started quickly with OSF by using the Open Semantic Framework Installer] 26 | | [[File:http://wiki.opensemanticframework.org/images/7/7d/Osf_installer.png]] 27 | |} 28 | 29 | Additionally you can find debugging tips and support on the [http://groups.google.com/group/open-semantic-framework Mailing List] 30 | 31 | == Upgrading OSF == 32 | 33 | An existing OSF instance can easily be upgrader using the [https://github.com/structureddynamics/Open-Semantic-Framework-Installer OSF-Installer]. 34 | 35 | Note: the version of the OSF instance that should be minimally installed is version 3.0.0. If you have an older version than that, then you will have to manually upgrade your version to the version 3.0.0 and then you will have to run the OSF-Installer OSF upgrader script. 36 | 37 | == OSF Web Services == 38 | 39 | Here is a complete list of all the web service endpoints currently available in OSF: 40 | 41 | * [http://wiki.opensemanticframework.org/index.php/OSF_Installer Installation Guide] 42 | * [http://wiki.opensemanticframework.org/index.php/OSF_Web_Service Overview] 43 | * [http://wiki.opensemanticframework.org/index.php/OSF_Web_Service_Architecture OSF Web Service Architecture] 44 | * [http://wiki.opensemanticframework.org/index.php/OSF_Web_Services_Permissions Datasets and Access Rights] 45 | * [http://wiki.opensemanticframework.org/index.php/structXML structXML], the OSF Web Service XML data structure 46 | * [http://wiki.opensemanticframework.org/index.php/OSF_Web_Service_API_and_Web_Services_Documentation OSF Web Service API and Web Services Documentation], with the specific services of: 47 | ** [http://wiki.opensemanticframework.org/index.php/Auth_Registrar:_Access Auth Registrar: Access] 48 | ** [http://wiki.opensemanticframework.org/index.php/Auth_Registrar:_Group Auth Registrar: Group] 49 | ** [http://wiki.opensemanticframework.org/index.php/Auth_Registrar:_User Auth Registrar: User] 50 | ** [http://wiki.opensemanticframework.org/index.php/Auth_Registrar:_WS Auth Registrar: WS] 51 | ** [http://wiki.opensemanticframework.org/index.php/Auth:_Lister Auth: Lister] 52 | ** [http://wiki.opensemanticframework.org/index.php/Ontology_reate Ontology Create] 53 | ** [http://wiki.opensemanticframework.org/index.php/Ontology_Read Ontology Read] 54 | ** [http://wiki.opensemanticframework.org/index.php/Ontology_Update Ontology Update] 55 | ** [http://wiki.opensemanticframework.org/index.php/Ontology_Delete Ontology Delete] 56 | ** [http://wiki.opensemanticframework.org/index.php/Dataset:_Create Dataset: Create] 57 | ** [http://wiki.opensemanticframework.org/index.php/Dataset:_Read Dataset: Read] 58 | ** [http://wiki.opensemanticframework.org/index.php/Dataset:_Update Dataset: Update] 59 | ** [http://wiki.opensemanticframework.org/index.php/Dataset:_Delete Dataset: Delete] 60 | ** [http://wiki.opensemanticframework.org/index.php/CRUD:_Create CRUD: Create] 61 | ** [http://wiki.opensemanticframework.org/index.php/CRUD:_Read CRUD: Read] 62 | ** [http://wiki.opensemanticframework.org/index.php/CRUD:_Update CRUD: Update] 63 | ** [http://wiki.opensemanticframework.org/index.php/CRUD:_Delete CRUD: Delete] 64 | ** [http://wiki.opensemanticframework.org/index.php/Revision:_Diff Revision: Diff] 65 | ** [http://wiki.opensemanticframework.org/index.php/Revision:_Delete Revision: Delete] 66 | ** [http://wiki.opensemanticframework.org/index.php/Revision:_Read Revision: Read] 67 | ** [http://wiki.opensemanticframework.org/index.php/Revision:_Update Revision: Update] 68 | ** [http://wiki.opensemanticframework.org/index.php/Revision:_Lister Revision: Lister] 69 | ** [http://wiki.opensemanticframework.org/index.php/Search Search] 70 | ** [http://wiki.opensemanticframework.org/index.php/SPARQL SPARQL] 71 | ** [http://wiki.opensemanticframework.org/index.php/Scones Scones] 72 | ** [http://wiki.opensemanticframework.org/index.php/Converter:_commON Converter: commON] (import and export) 73 | ** [http://wiki.opensemanticframework.org/index.php/Converter:_irJSON Converter: irJSON] (import and export) 74 | 75 | == How to Use Web Services Endpoint == 76 | 77 | The easiest way to get started is to use the [https://github.com/StructuredDynamics/OSF-Web-Services-PHP-API OSF Web Services PHP API] to create and send queries to any OSF web service endpoint. 78 | 79 | == Developers == 80 | 81 | Developers and commiters to the Git repository should comply to the coding standards. An outline of the coding style is available in the Coding Standard folder. Additional requirements are listed in the README.mediawiki file in that folder. Finally, coding style is enforced b the PolyStyle code formatter application available here: http://polystyle.com 82 | 83 | ==Auto-loading of Classes== 84 | 85 | OSF does comply with the [PSR-0 Standard Document](https://gist.github.com/1234504) 86 | for auto-loading the classes of the framework. The SplClassLoader class that has been developed by 87 | the same group can be used as the classes auto-loader. 88 | -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/VERSION.ini: -------------------------------------------------------------------------------- 1 | [version] 2 | 3 | ; Current version of OSF 4 | version = "3.4.0" 5 | -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/auth/lister/README.mediawiki: -------------------------------------------------------------------------------- 1 | == Endpoint Documentation == 2 | 3 | [http://techwiki.openstructs.org/index.php/Auth:_Lister Auth: Lister Web Service Endpoint Documentation] -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/auth/lister/index.php: -------------------------------------------------------------------------------- 1 | ws_conneg((isset($_SERVER['HTTP_ACCEPT']) ? $_SERVER['HTTP_ACCEPT'] : ""), 75 | (isset($_SERVER['HTTP_ACCEPT_CHARSET']) ? $_SERVER['HTTP_ACCEPT_CHARSET'] : ""), 76 | (isset($_SERVER['HTTP_ACCEPT_ENCODING']) ? $_SERVER['HTTP_ACCEPT_ENCODING'] : ""), 77 | (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : "")); 78 | 79 | $ws_al->process(); 80 | 81 | $ws_al->ws_respond($ws_al->ws_serialize()); 82 | 83 | //@} 84 | 85 | ?> -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/auth/registrar/access/README.mediawiki: -------------------------------------------------------------------------------- 1 | == Endpoint Documentation == 2 | 3 | [http://techwiki.openstructs.org/index.php/Auth_Registrar:_Access Auth Registrar: Access Web Service Endpoint Documentation] 4 | -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/auth/registrar/access/index.php: -------------------------------------------------------------------------------- 1 | ws_conneg((isset($_SERVER['HTTP_ACCEPT']) ? $_SERVER['HTTP_ACCEPT'] : ""), 94 | (isset($_SERVER['HTTP_ACCEPT_CHARSET']) ? $_SERVER['HTTP_ACCEPT_CHARSET'] : ""), 95 | (isset($_SERVER['HTTP_ACCEPT_ENCODING']) ? $_SERVER['HTTP_ACCEPT_ENCODING'] : ""), 96 | (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : "")); 97 | 98 | $ws_araccess->process(); 99 | 100 | $ws_araccess->ws_respond($ws_araccess->ws_serialize()); 101 | 102 | //@} 103 | 104 | ?> -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/auth/registrar/group/README.mediawiki: -------------------------------------------------------------------------------- 1 | == Endpoint Documentation == 2 | 3 | [http://techwiki.openstructs.org/index.php/Auth_Registrar:_Group Auth Registrar: Group Web Service Endpoint Documentation] 4 | -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/auth/registrar/group/index.php: -------------------------------------------------------------------------------- 1 | ws_conneg((isset($_SERVER['HTTP_ACCEPT']) ? $_SERVER['HTTP_ACCEPT'] : ""), 69 | (isset($_SERVER['HTTP_ACCEPT_CHARSET']) ? $_SERVER['HTTP_ACCEPT_CHARSET'] : ""), 70 | (isset($_SERVER['HTTP_ACCEPT_ENCODING']) ? $_SERVER['HTTP_ACCEPT_ENCODING'] : ""), 71 | (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : "")); 72 | 73 | $ws_arg->process(); 74 | 75 | $ws_arg->ws_respond($ws_arg->ws_serialize()); 76 | 77 | //@} 78 | 79 | ?> -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/auth/registrar/group/interfaces/DefaultSourceInterface.php: -------------------------------------------------------------------------------- 1 | compatibleWith = "3.0"; 14 | } 15 | 16 | public function processInterface() 17 | { 18 | // Make sure there was no conneg error prior to this process call 19 | if($this->ws->conneg->getStatus() == 200) 20 | { 21 | if($this->ws->action === 'create') 22 | { 23 | $this->ws->sparql->query("insert into <" . $this->ws->wsf_graph . "> 24 | { 25 | <".$this->ws->group_uri."> a . 26 | <".$this->ws->group_uri."> \"".$this->ws->app_id."\" . 27 | }"); 28 | 29 | if($this->ws->sparql->error()) 30 | { 31 | $this->ws->conneg->setStatus(500); 32 | $this->ws->conneg->setStatusMsg("Internal Error"); 33 | $this->ws->conneg->setStatusMsgExt($this->ws->errorMessenger->_300->name); 34 | $this->ws->conneg->setError($this->ws->errorMessenger->_300->id, $this->ws->errorMessenger->ws, 35 | $this->ws->errorMessenger->_300->name, $this->ws->errorMessenger->_300->description, 36 | $this->ws->sparql->errormsg(), $this->ws->errorMessenger->_300->level); 37 | 38 | return; 39 | } 40 | } 41 | 42 | if($this->ws->action === 'delete') 43 | { 44 | // Delete the group and its members 45 | $this->ws->sparql->query("delete from graph <" . $this->ws->wsf_graph . "> 46 | { 47 | <".$this->ws->group_uri."> ?group_p ?group_o . 48 | 49 | ?user <".$this->ws->group_uri."> . 50 | } 51 | where 52 | { 53 | { 54 | <".$this->ws->group_uri."> ?group_p ?group_o . 55 | } 56 | union 57 | { 58 | ?user <".$this->ws->group_uri."> . 59 | } 60 | }"); 61 | 62 | if($this->ws->sparql->error()) 63 | { 64 | $this->ws->conneg->setStatus(500); 65 | $this->ws->conneg->setStatusMsg("Internal Error"); 66 | $this->ws->conneg->setStatusMsgExt($this->ws->errorMessenger->_304->name); 67 | $this->ws->conneg->setError($this->ws->errorMessenger->_304->id, $this->ws->errorMessenger->ws, 68 | $this->ws->errorMessenger->_304->name, $this->ws->errorMessenger->_304->description, 69 | $this->ws->sparql->errormsg(), $this->ws->errorMessenger->_304->level); 70 | 71 | return; 72 | } 73 | 74 | // Delete the permissions related to that group 75 | $this->ws->sparql->query("delete from graph <" . $this->ws->wsf_graph . "> 76 | { 77 | ?access ?p ?o. 78 | } 79 | where 80 | { 81 | ?access a ; 82 | <".$this->ws->group_uri."> ; 83 | ?p ?o. 84 | }"); 85 | 86 | if($this->ws->sparql->error()) 87 | { 88 | $this->ws->conneg->setStatus(500); 89 | $this->ws->conneg->setStatusMsg("Internal Error"); 90 | $this->ws->conneg->setError($this->ws->errorMessenger->_303->id, $this->ws->errorMessenger->ws, 91 | $this->ws->errorMessenger->_303->name, $this->ws->errorMessenger->_303->description, 92 | $this->ws->sparql->errormsg(), $this->ws->errorMessenger->_303->level); 93 | return; 94 | } 95 | } 96 | 97 | // Invalidate caches 98 | if($this->ws->memcached_enabled) 99 | { 100 | $this->ws->invalidateCache('auth-validator'); 101 | $this->ws->invalidateCache('auth-lister:dataset'); 102 | $this->ws->invalidateCache('auth-lister:groups'); 103 | $this->ws->invalidateCache('auth-lister:group_users'); 104 | $this->ws->invalidateCache('auth-lister:access_user'); 105 | $this->ws->invalidateCache('auth-lister:access_dataset'); 106 | $this->ws->invalidateCache('auth-lister:access_group'); 107 | $this->ws->invalidateCache('dataset-read'); 108 | $this->ws->invalidateCache('dataset-read:all'); 109 | } 110 | } 111 | } 112 | } 113 | ?> 114 | -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/auth/registrar/user/README.mediawiki: -------------------------------------------------------------------------------- 1 | == Endpoint Documentation == 2 | 3 | [http://techwiki.openstructs.org/index.php/Auth_Registrar:_User Auth Registrar: User Web Service Endpoint Documentation] 4 | -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/auth/registrar/user/index.php: -------------------------------------------------------------------------------- 1 | ws_conneg((isset($_SERVER['HTTP_ACCEPT']) ? $_SERVER['HTTP_ACCEPT'] : ""), 69 | (isset($_SERVER['HTTP_ACCEPT_CHARSET']) ? $_SERVER['HTTP_ACCEPT_CHARSET'] : ""), 70 | (isset($_SERVER['HTTP_ACCEPT_ENCODING']) ? $_SERVER['HTTP_ACCEPT_ENCODING'] : ""), 71 | (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : "")); 72 | 73 | $ws_aru->process(); 74 | 75 | $ws_aru->ws_respond($ws_aru->ws_serialize()); 76 | 77 | //@} 78 | 79 | ?> -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/auth/registrar/user/interfaces/DefaultSourceInterface.php: -------------------------------------------------------------------------------- 1 | compatibleWith = "3.0"; 14 | } 15 | 16 | public function processInterface() 17 | { 18 | // Make sure there was no conneg error prior to this process call 19 | if($this->ws->conneg->getStatus() == 200) 20 | { 21 | if($this->ws->action === 'join') 22 | { 23 | $this->ws->sparql->query("insert into <" . $this->ws->wsf_graph . "> 24 | { 25 | <".$this->ws->user_uri."> a . 26 | <".$this->ws->user_uri."> <".$this->ws->group_uri."> . 27 | }"); 28 | 29 | if($this->ws->sparql->error()) 30 | { 31 | $this->ws->conneg->setStatus(500); 32 | $this->ws->conneg->setStatusMsg("Internal Error"); 33 | $this->ws->conneg->setStatusMsgExt($this->ws->errorMessenger->_300->name); 34 | $this->ws->conneg->setError($this->ws->errorMessenger->_300->id, $this->ws->errorMessenger->ws, 35 | $this->ws->errorMessenger->_300->name, $this->ws->errorMessenger->_300->description, 36 | $this->ws->sparql->errormsg(), $this->ws->errorMessenger->_300->level); 37 | 38 | return; 39 | } 40 | } 41 | 42 | if($this->ws->action === 'leave') 43 | { 44 | $this->ws->sparql->query("delete from graph <" . $this->ws->wsf_graph . "> 45 | { 46 | <".$this->ws->user_uri."> <".$this->ws->group_uri."> . 47 | } 48 | where 49 | { 50 | <".$this->ws->user_uri."> <".$this->ws->group_uri."> . 51 | }"); 52 | 53 | if($this->ws->sparql->error()) 54 | { 55 | $this->ws->conneg->setStatus(500); 56 | $this->ws->conneg->setStatusMsg("Internal Error"); 57 | $this->ws->conneg->setStatusMsgExt($this->ws->errorMessenger->_304->name); 58 | $this->ws->conneg->setError($this->ws->errorMessenger->_304->id, $this->ws->errorMessenger->ws, 59 | $this->ws->errorMessenger->_304->name, $this->ws->errorMessenger->_304->description, 60 | $this->ws->sparql->errormsg(), $this->ws->errorMessenger->_304->level); 61 | 62 | return; 63 | } 64 | } 65 | 66 | // Invalidate caches 67 | if($this->ws->memcached_enabled) 68 | { 69 | $this->ws->invalidateCache('auth-validator'); 70 | $this->ws->invalidateCache('auth-lister:dataset'); 71 | $this->ws->invalidateCache('auth-lister:groups'); 72 | $this->ws->invalidateCache('auth-lister:group_users'); 73 | $this->ws->invalidateCache('auth-lister:access_user'); 74 | $this->ws->invalidateCache('auth-lister:access_dataset'); 75 | $this->ws->invalidateCache('auth-lister:access_group'); 76 | $this->ws->invalidateCache('dataset-read'); 77 | $this->ws->invalidateCache('dataset-read:all'); 78 | } 79 | } 80 | } 81 | } 82 | ?> 83 | -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/auth/registrar/ws/README.mediawiki: -------------------------------------------------------------------------------- 1 | == Endpoint Documentation == 2 | 3 | [http://techwiki.openstructs.org/index.php/Auth_Registrar:_WS Auth Registrar: WS Web Service Endpoint Documentation] 4 | -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/auth/registrar/ws/index.php: -------------------------------------------------------------------------------- 1 | ws_conneg((isset($_SERVER['HTTP_ACCEPT']) ? $_SERVER['HTTP_ACCEPT'] : ""), 78 | (isset($_SERVER['HTTP_ACCEPT_CHARSET']) ? $_SERVER['HTTP_ACCEPT_CHARSET'] : ""), 79 | (isset($_SERVER['HTTP_ACCEPT_ENCODING']) ? $_SERVER['HTTP_ACCEPT_ENCODING'] : ""), 80 | (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : "")); 81 | 82 | $ws_arws->process(); 83 | 84 | $ws_arws->ws_respond($ws_arws->ws_serialize()); 85 | 86 | //@} 87 | 88 | ?> -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/auth/registrar/ws/interfaces/DefaultSourceInterface.php: -------------------------------------------------------------------------------- 1 | compatibleWith = "3.0"; 14 | } 15 | 16 | public function processInterface() 17 | { 18 | // Make sure there was no conneg error prior to this process call 19 | if($this->ws->conneg->getStatus() == 200) 20 | { 21 | // Create and describe the resource being registered 22 | // Note: we make sure we remove any previously defined triples that we are 23 | // about to re-enter in the graph. All information other than these 24 | // new properties will remain in the graph 25 | 26 | $this->ws->sparql->query("delete from <" . $this->ws->wsf_graph . "> 27 | { 28 | <".$this->ws->registered_uri."> a . 29 | <".$this->ws->registered_uri."> ?title . 30 | <".$this->ws->registered_uri."> ?endpoint . 31 | <".$this->ws->registered_uri."> ?crud_usage . 32 | ?crud_usage ?crud_property ?crud_value . 33 | } 34 | where 35 | { 36 | graph <" . $this->ws->wsf_graph . "> 37 | { 38 | <".$this->ws->registered_uri."> a . 39 | <".$this->ws->registered_uri."> ?title . 40 | <".$this->ws->registered_uri."> ?endpoint . 41 | <".$this->ws->registered_uri."> ?crud_usage . 42 | ?crud_usage ?crud_property ?crud_value . 43 | } 44 | } 45 | insert into <" . $this->ws->wsf_graph . "> 46 | { 47 | <".$this->ws->registered_uri."> a . 48 | <".$this->ws->registered_uri."> \"".$this->ws->registered_title."\" . 49 | <".$this->ws->registered_uri."> \"".$this->ws->registered_endpoint."\" . 50 | <".$this->ws->registered_uri."> <" . $this->ws->registered_uri . "usage/> . 51 | 52 | <" . $this->ws->registered_uri . "usage/> a ; 53 | " . ($this->ws->crud_usage->create ? "\"True\"" : "\"False\"") . " ; 54 | " . ($this->ws->crud_usage->read ? "\"True\"" : "\"False\"") . " ; 55 | " . ($this->ws->crud_usage->update ? "\"True\"" : "\"False\"") . " ; 56 | " . ($this->ws->crud_usage->delete ? "\"True\"" : "\"False\"") . " . 57 | 58 | <" . $this->ws->wsf_graph . "> <".$this->ws->registered_uri.">. 59 | }"); 60 | 61 | if($this->ws->sparql->error()) 62 | { 63 | $this->ws->conneg->setStatus(500); 64 | $this->ws->conneg->setStatusMsg("Internal Error"); 65 | $this->ws->conneg->setStatusMsgExt($this->ws->errorMessenger->_300->name); 66 | $this->ws->conneg->setError($this->ws->errorMessenger->_300->id, $this->ws->errorMessenger->ws, 67 | $this->ws->errorMessenger->_300->name, $this->ws->errorMessenger->_300->description, 68 | $this->ws->sparql->errormsg(), $this->ws->errorMessenger->_300->level); 69 | 70 | return; 71 | } 72 | } 73 | 74 | // Invalidate caches 75 | if($this->ws->memcached_enabled) 76 | { 77 | $this->ws->invalidateCache('auth-validator'); 78 | $this->ws->invalidateCache('auth-lister:ws'); 79 | $this->ws->invalidateCache('auth-lister:dataset'); 80 | $this->ws->invalidateCache('auth-lister:access_user'); 81 | $this->ws->invalidateCache('auth-lister:access_dataset'); 82 | $this->ws->invalidateCache('auth-lister:access_group'); 83 | } 84 | } 85 | } 86 | ?> 87 | -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/converter/common/README.mediawiki: -------------------------------------------------------------------------------- 1 | == Endpoint Documentation == 2 | 3 | [http://techwiki.openstructs.org/index.php/Converter:_commON Converter: commON Web Service Endpoint Documentation] 4 | -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/converter/common/index.php: -------------------------------------------------------------------------------- 1 | ws_conneg((isset($_SERVER['HTTP_ACCEPT']) ? $_SERVER['HTTP_ACCEPT'] : ""), 49 | (isset($_SERVER['HTTP_ACCEPT_CHARSET']) ? $_SERVER['HTTP_ACCEPT_CHARSET'] : ""), 50 | (isset($_SERVER['HTTP_ACCEPT_ENCODING']) ? $_SERVER['HTTP_ACCEPT_ENCODING'] : ""), 51 | (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : "")); 52 | 53 | $ws_common->process(); 54 | 55 | $ws_common->ws_respond($ws_common->ws_serialize()); 56 | 57 | 58 | //@} 59 | 60 | ?> -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/converter/irjson/Dataset.php: -------------------------------------------------------------------------------- 1 | id = array( $id ); 46 | 47 | $this->id["valueType"] = "primitive:id[1]"; 48 | } 49 | } 50 | 51 | /** @brief Set the linkage schema(s) related to this dataset 52 | 53 | @param $linkageSchema preferred label of the maintainer 54 | 55 | @author Frederick Giasson, Structured Dynamics LLC. 56 | */ 57 | public function setLinkageSchema($linkageSchema) 58 | { 59 | if($linkageSchema != "") 60 | { 61 | $this->linkageSchema = array( $linkageSchema ); 62 | 63 | $this->linkageSchema["valueType"] = "primitive:string[1]"; 64 | } 65 | } 66 | 67 | /** @brief Set the structure schema(s) related to this dataset 68 | 69 | @param $structureSchema preferred label of the maintainer 70 | 71 | @author Frederick Giasson, Structured Dynamics LLC. 72 | */ 73 | public function setStructureSchema($structureSchema) 74 | { 75 | if($structureSchema != "") 76 | { 77 | $this->structureSchema = array( $structureSchema ); 78 | 79 | $this->structureSchema["valueType"] = "primitive:string[1]"; 80 | } 81 | } 82 | 83 | /** @brief Set a value for an attribute describing the dataset 84 | 85 | @param $attr attribute describing the dataset 86 | @param $value value of the attribute 87 | @param $valueType type of the value of the attribute (ex: String, Object, etc). 88 | 89 | @author Frederick Giasson, Structured Dynamics LLC. 90 | */ 91 | public function setAttribute($attr, $value, $valueType) 92 | { 93 | if($value != "") 94 | { 95 | if(!is_array($this->attributes[$attr])) 96 | { 97 | $this->attributes[$attr] = array( $value ); 98 | } 99 | else 100 | { 101 | array_push($this->attributes[$attr], $value); 102 | } 103 | 104 | $this->attributes[$attr]["valueType"] = $valueType; 105 | } 106 | } 107 | 108 | /** @brief Set a "ref" attribute 109 | 110 | @param $attr attribute describing the dataset 111 | @param $metaData metaData that describe the triple. 112 | @param $ref Reference to the local or global ID of the reference 113 | @param $valueType type of the value of the attribute (ex: String, Object, etc). 114 | 115 | @author Frederick Giasson, Structured Dynamics LLC. 116 | */ 117 | public function setAttributeRef($attr, $metaData, $ref, $valueType) 118 | { $this->addRef($this->attributes[$attr], $metaData, $ref, $valueType); } 119 | 120 | /** @brief Create a reference to a source, creator, curator or maintenainer of a dataset 121 | 122 | @param $attr attribute reference 123 | @param $metaData metaData that describe the triple. 124 | @param $ref Reference to the local or global ID of the reference 125 | @param $valueType Value type of the reference value 126 | 127 | @author Frederick Giasson, Structured Dynamics LLC. 128 | */ 129 | private function addRef(&$attr, $metaData, $ref, $valueType) 130 | { 131 | if(!is_array($attr)) 132 | { 133 | $attr = array( array ("metaData" => $metaData, "ref" => $ref) ); 134 | } 135 | else 136 | { 137 | array_push($attr, array ("metaData" => $metaData, "ref" => $ref)); 138 | } 139 | 140 | $attr["valueType"] = $valueType; 141 | } 142 | 143 | /** @brief Get the valueType of an attribute 144 | 145 | @param $property Target property you want to get the valueType 146 | 147 | @author Frederick Giasson, Structured Dynamics LLC. 148 | */ 149 | public function getValueType($property) 150 | { 151 | if(isset($this->{$property}["valueType"])) 152 | { 153 | return ($this->{$property}["valueType"]); 154 | } 155 | else 156 | { 157 | // Check if it is part of "attributes" 158 | if(isset($this->{"attributes"}[$property]["valueType"])) 159 | { 160 | return ($this->{"attributes"}[$property]["valueType"]); 161 | } 162 | 163 | return (FALSE); 164 | } 165 | } 166 | } 167 | 168 | //@} 169 | 170 | ?> -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/converter/irjson/InstanceRecord.php: -------------------------------------------------------------------------------- 1 | id = array( $id ); 40 | 41 | $this->id["valueType"] = "primitive:id[1]"; 42 | } 43 | } 44 | 45 | /** @brief Set a value for an attribute describing the instance record 46 | 47 | @param $attr attribute describing the instance record 48 | @param $value value of the attribute 49 | @param $valueType type of the value of the attribute (ex: String, Object, etc). 50 | 51 | @author Frederick Giasson, Structured Dynamics LLC. 52 | */ 53 | public function setAttribute($attr, $value, $valueType) 54 | { 55 | if($value != "") 56 | { 57 | if(!is_array($this->attributes[$attr])) 58 | { 59 | $this->attributes[$attr] = array( $value ); 60 | } 61 | else 62 | { 63 | array_push($this->attributes[$attr], $value); 64 | } 65 | 66 | $this->attributes[$attr]["valueType"] = $valueType; 67 | } 68 | } 69 | 70 | /** @brief Set a "ref" attribute 71 | 72 | @param $attr attribute describing the instance record 73 | @param $metaData metaData that describe the triple. 74 | @param $ref Reference to the local or global ID of the reference 75 | @param $valueType type of the value of the attribute (ex: String, Object, etc). 76 | 77 | @author Frederick Giasson, Structured Dynamics LLC. 78 | */ 79 | public function setAttributeRef($attr, $metaData, $ref, $valueType) 80 | { $this->addRef($this->attributes[$attr], $metaData, $ref, $valueType); } 81 | 82 | /** @brief Create a reference to a source, creator, curator or maintenainer of an instance record 83 | 84 | @param $attr attribute reference 85 | @param $metaData metaData that describe the triple. 86 | @param $ref Reference to the local or global ID of the reference 87 | @param $valueType Value type of the reference value 88 | 89 | @author Frederick Giasson, Structured Dynamics LLC. 90 | */ 91 | private function addRef(&$attr, $metaData, $ref, $valueType) 92 | { 93 | if(!is_array($attr)) 94 | { 95 | $attr = array( array ("metaData" => $metaData, "ref" => $ref) ); 96 | } 97 | else 98 | { 99 | array_push($attr, array ("metaData" => $metaData, "ref" => $ref)); 100 | } 101 | 102 | $attr["valueType"] = $valueType; 103 | } 104 | 105 | /** @brief Get the valueType of an attribute 106 | 107 | @param $property Target property you want to get the valueType 108 | 109 | @author Frederick Giasson, Structured Dynamics LLC. 110 | */ 111 | public function getValueType($property) 112 | { 113 | if(isset($this->{$property}["valueType"])) 114 | { 115 | return ($this->{$property}["valueType"]); 116 | } 117 | else 118 | { 119 | // Check if it is part of "attributes" 120 | if(isset($this->{"attributes"}[$property]["valueType"])) 121 | { 122 | return ($this->{"attributes"}[$property]["valueType"]); 123 | } 124 | 125 | return (FALSE); 126 | } 127 | } 128 | } 129 | 130 | //@} 131 | 132 | ?> -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/converter/irjson/README.mediawiki: -------------------------------------------------------------------------------- 1 | == Endpoint Documentation == 2 | 3 | [http://techwiki.openstructs.org/index.php/Converter:_irJSON Converter: irJSON Web Service Endpoint Documentation] 4 | -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/converter/irjson/StructureSchema.php: -------------------------------------------------------------------------------- 1 | version = $version; 41 | } 42 | 43 | /** @brief Define an attribute in the structure schema 44 | 45 | @param $property Attribute name to be described 46 | @param $type Expected type of the value 47 | @param $format Expected format of the balue 48 | @param $equivalentPropertyTo Equivalent property relationships 49 | @param $subPropertyOf Sub-property relationships 50 | 51 | @author Frederick Giasson, Structured Dynamics LLC. 52 | */ 53 | public function setPropertyX($property, $type, $format, $equivalentPropertyTo, $subPropertyOf) 54 | { $this->addProperty($this->propertyX[$property], $type, $format, $equivalentPropertyTo, $subPropertyOf); } 55 | 56 | 57 | /** @brief Define a type in the structure schema 58 | 59 | @param $type Attribute name to be described 60 | @param $equivalentTypeTo Equivalent type relationships 61 | @param $subTypeOf Sub-type relationships 62 | 63 | @author Frederick Giasson, Structured Dynamics LLC. 64 | */ 65 | public function setTypeX($type, $equivalentTypeTo, $subTypeOf) 66 | { $this->addType($this->typeX[$type], $equivalentTypeTo, $subTypeOf); } 67 | 68 | private function addProperty(&$property, $type, $format, $equivalentPropertyTo, $subPropertyOf) 69 | { 70 | if(!is_array($property)) 71 | { 72 | $property = array( array ("type" => $type, "format" => $format, "equivalentPropertyTo" => $equivalentPropertyTo, 73 | "subPropertyOf" => $subPropertyOf) ); 74 | } 75 | else 76 | { 77 | array_push($property, 78 | array ("type" => $type, "format" => $format, "equivalentPropertyTo" => $equivalentPropertyTo, 79 | "subPropertyOf" => $subPropertyOf)); 80 | } 81 | } 82 | 83 | private function addType(&$type, $equivalentTypeTo, $subTypeOf) 84 | { 85 | if(!is_array($type)) 86 | { 87 | $type = array( array ("equivalentPropertyTo" => $equivalentPropertyTo, "subPropertyOf" => $subPropertyOf) ); 88 | } 89 | else 90 | { 91 | array_push($type, array ("equivalentPropertyTo" => $equivalentPropertyTo, "subPropertyOf" => $subPropertyOf)); 92 | } 93 | } 94 | 95 | public function getPropertyTypes($property) 96 | { 97 | // Only one type which is not an array in JSON. 98 | if(!is_array($this->propertyX[$property][0]["type"]) && $this->propertyX[$property][0]["type"] != "") 99 | { 100 | return array( $this->propertyX[$property][0]["type"] ); 101 | } 102 | 103 | if(count($this->propertyX[$property][0]["type"]) > 0) 104 | { 105 | return ($this->propertyX[$property][0]["type"]); 106 | } 107 | 108 | return (FALSE); 109 | } 110 | } 111 | 112 | //@} 113 | 114 | ?> -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/converter/irjson/index.php: -------------------------------------------------------------------------------- 1 | ws_conneg((isset($_SERVER['HTTP_ACCEPT']) ? $_SERVER['HTTP_ACCEPT'] : ""), 57 | (isset($_SERVER['HTTP_ACCEPT_CHARSET']) ? $_SERVER['HTTP_ACCEPT_CHARSET'] : ""), 58 | (isset($_SERVER['HTTP_ACCEPT_ENCODING']) ? $_SERVER['HTTP_ACCEPT_ENCODING'] : ""), 59 | (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : "")); 60 | 61 | $ws_irv->process(); 62 | 63 | $ws_irv->ws_respond($ws_irv->ws_serialize()); 64 | 65 | //@} 66 | 67 | ?> -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/crud/create/README.mediawiki: -------------------------------------------------------------------------------- 1 | == Endpoint Documentation == 2 | 3 | [http://techwiki.openstructs.org/index.php/CRUD:_Create CRUD: Create Web Service Endpoint Documentation] 4 | -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/crud/create/index.php: -------------------------------------------------------------------------------- 1 | ws_conneg((isset($_SERVER['HTTP_ACCEPT']) ? $_SERVER['HTTP_ACCEPT'] : ""), 77 | (isset($_SERVER['HTTP_ACCEPT_CHARSET']) ? $_SERVER['HTTP_ACCEPT_CHARSET'] : ""), 78 | (isset($_SERVER['HTTP_ACCEPT_ENCODING']) ? $_SERVER['HTTP_ACCEPT_ENCODING'] : ""), 79 | (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : "")); 80 | 81 | $ws_crudcreate->process(); 82 | 83 | $ws_crudcreate->ws_respond($ws_crudcreate->ws_serialize()); 84 | 85 | //@} 86 | 87 | ?> -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/crud/delete/README.mediawiki: -------------------------------------------------------------------------------- 1 | == Endpoint Documentation == 2 | 3 | [http://techwiki.openstructs.org/index.php/CRUD:_Delete CRUD: Delete Web Service Endpoint Documentation] 4 | -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/crud/delete/index.php: -------------------------------------------------------------------------------- 1 | ws_conneg((isset($_SERVER['HTTP_ACCEPT']) ? $_SERVER['HTTP_ACCEPT'] : ""), 67 | (isset($_SERVER['HTTP_ACCEPT_CHARSET']) ? $_SERVER['HTTP_ACCEPT_CHARSET'] : ""), 68 | (isset($_SERVER['HTTP_ACCEPT_ENCODING']) ? $_SERVER['HTTP_ACCEPT_ENCODING'] : ""), 69 | (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : "")); 70 | 71 | $ws_cruddelete->process(); 72 | 73 | $ws_cruddelete->ws_respond($ws_cruddelete->ws_serialize()); 74 | 75 | //@} 76 | 77 | ?> -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/crud/read/README.mediawiki: -------------------------------------------------------------------------------- 1 | == Endpoint Documentation == 2 | 3 | [http://techwiki.openstructs.org/index.php/CRUD:_Read CRUD: Read Web Service Endpoint Documentation] 4 | -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/crud/read/index.php: -------------------------------------------------------------------------------- 1 | ws_conneg((isset($_SERVER['HTTP_ACCEPT']) ? $_SERVER['HTTP_ACCEPT'] : ""), 120 | (isset($_SERVER['HTTP_ACCEPT_CHARSET']) ? $_SERVER['HTTP_ACCEPT_CHARSET'] : ""), 121 | (isset($_SERVER['HTTP_ACCEPT_ENCODING']) ? $_SERVER['HTTP_ACCEPT_ENCODING'] : ""), 122 | (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : "")); 123 | 124 | $ws_cr->process(); 125 | 126 | $ws_cr->ws_respond($ws_cr->ws_serialize()); 127 | 128 | //@} 129 | 130 | ?> -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/crud/update/README.mediawiki: -------------------------------------------------------------------------------- 1 | == Endpoint Documentation == 2 | 3 | [http://techwiki.openstructs.org/index.php/CRUD:_Update CRUD: Update Web Service Endpoint Documentation] 4 | -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/crud/update/index.php: -------------------------------------------------------------------------------- 1 | ws_conneg((isset($_SERVER['HTTP_ACCEPT']) ? $_SERVER['HTTP_ACCEPT'] : ""), 84 | (isset($_SERVER['HTTP_ACCEPT_CHARSET']) ? $_SERVER['HTTP_ACCEPT_CHARSET'] : ""), 85 | (isset($_SERVER['HTTP_ACCEPT_ENCODING']) ? $_SERVER['HTTP_ACCEPT_ENCODING'] : ""), 86 | (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : "")); 87 | 88 | $ws_crudupdate->process(); 89 | 90 | $ws_crudupdate->ws_respond($ws_crudupdate->ws_serialize()); 91 | 92 | //@} 93 | 94 | ?> -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/dataset/create/README.mediawiki: -------------------------------------------------------------------------------- 1 | == Endpoint Documentation == 2 | 3 | [http://techwiki.openstructs.org/index.php/Dataset:_Create Dataset: Create Web Service Endpoint Documentation] 4 | -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/dataset/create/index.php: -------------------------------------------------------------------------------- 1 | ws_conneg((isset($_SERVER['HTTP_ACCEPT']) ? $_SERVER['HTTP_ACCEPT'] : ""), 76 | (isset($_SERVER['HTTP_ACCEPT_CHARSET']) ? $_SERVER['HTTP_ACCEPT_CHARSET'] : ""), 77 | (isset($_SERVER['HTTP_ACCEPT_ENCODING']) ? $_SERVER['HTTP_ACCEPT_ENCODING'] : ""), 78 | (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : "")); 79 | 80 | $ws_dc->process(); 81 | 82 | $ws_dc->ws_respond($ws_dc->ws_serialize()); 83 | 84 | //@} 85 | 86 | ?> -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/dataset/create/interfaces/DefaultSourceInterface.php: -------------------------------------------------------------------------------- 1 | compatibleWith = "3.0"; 18 | } 19 | 20 | public function processInterface() 21 | { 22 | // Make sure there was no conneg error prior to this process call 23 | if($this->ws->conneg->getStatus() == 200) 24 | { 25 | $this->ws->sparql->query("insert into <" . $this->ws->wsf_graph . "datasets/> 26 | { 27 | <" . $this->ws->datasetUri . "> a ; 28 | " . ($this->ws->datasetTitle != "" ? " \"\"\"" . str_replace("'", "\'", $this->ws->datasetTitle) . "\"\"\" ; " : "") . " 29 | " . ($this->ws->description != "" ? " \"\"\"" . str_replace("'", "\'", $this->ws->description) . "\"\"\" ; " : "") . " 30 | " . ($this->ws->creator != "" ? " <".$this->ws->creator."> ; " : "") . " 31 | \"" . date("Y-n-j") . "\" . 32 | }"); 33 | 34 | if($this->ws->sparql->error()) 35 | { 36 | $this->ws->conneg->setStatus(500); 37 | $this->ws->conneg->setStatusMsg("Internal Error"); 38 | $this->ws->conneg->setStatusMsgExt($this->ws->errorMessenger->_300->name); 39 | $this->ws->conneg->setError($this->ws->errorMessenger->_300->id, $this->ws->errorMessenger->ws, 40 | $this->ws->errorMessenger->_300->name, $this->ws->errorMessenger->_300->description, 41 | $this->ws->sparql->errormsg(), $this->ws->errorMessenger->_300->level); 42 | 43 | return; 44 | } 45 | 46 | // Invalidate caches 47 | if($this->ws->memcached_enabled) 48 | { 49 | $this->ws->invalidateCache('auth-validator'); 50 | $this->ws->invalidateCache('auth-lister:dataset'); 51 | $this->ws->invalidateCache('auth-lister:ws'); 52 | $this->ws->invalidateCache('auth-lister:groups'); 53 | $this->ws->invalidateCache('auth-lister:group_users'); 54 | $this->ws->invalidateCache('auth-lister:access_user'); 55 | $this->ws->invalidateCache('auth-lister:access_dataset'); 56 | $this->ws->invalidateCache('auth-lister:access_group'); 57 | $this->ws->invalidateCache('crud-read'); 58 | $this->ws->invalidateCache('dataset-read'); 59 | $this->ws->invalidateCache('dataset-read:all'); 60 | $this->ws->invalidateCache('revision-read'); 61 | $this->ws->invalidateCache('revision-lister'); 62 | $this->ws->invalidateCache('search'); 63 | $this->ws->invalidateCache('sparql'); 64 | } 65 | } 66 | } 67 | } 68 | ?> 69 | -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/dataset/delete/README.mediawiki: -------------------------------------------------------------------------------- 1 | == Endpoint Documentation == 2 | 3 | [http://techwiki.openstructs.org/index.php/Dataset:_Delete Dataset: Delete Web Service Endpoint Documentation] 4 | -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/dataset/delete/index.php: -------------------------------------------------------------------------------- 1 | ws_conneg((isset($_SERVER['HTTP_ACCEPT']) ? $_SERVER['HTTP_ACCEPT'] : ""), 52 | (isset($_SERVER['HTTP_ACCEPT_CHARSET']) ? $_SERVER['HTTP_ACCEPT_CHARSET'] : ""), 53 | (isset($_SERVER['HTTP_ACCEPT_ENCODING']) ? $_SERVER['HTTP_ACCEPT_ENCODING'] : ""), 54 | (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : "")); 55 | 56 | $ws_dd->process(); 57 | 58 | $ws_dd->ws_respond($ws_dd->ws_serialize()); 59 | 60 | //@} 61 | 62 | ?> -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/dataset/read/README.mediawiki: -------------------------------------------------------------------------------- 1 | == Endpoint Documentation == 2 | 3 | [http://techwiki.openstructs.org/index.php/Dataset:_Read Dataset: Read Web Service Endpoint Documentation] 4 | -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/dataset/read/index.php: -------------------------------------------------------------------------------- 1 | ws_conneg((isset($_SERVER['HTTP_ACCEPT']) ? $_SERVER['HTTP_ACCEPT'] : ""), 53 | (isset($_SERVER['HTTP_ACCEPT_CHARSET']) ? $_SERVER['HTTP_ACCEPT_CHARSET'] : ""), 54 | (isset($_SERVER['HTTP_ACCEPT_ENCODING']) ? $_SERVER['HTTP_ACCEPT_ENCODING'] : ""), 55 | (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : "")); 56 | 57 | $ws_dr->process(); 58 | 59 | $ws_dr->ws_respond($ws_dr->ws_serialize()); 60 | 61 | //@} 62 | 63 | ?> -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/dataset/update/README.mediawiki: -------------------------------------------------------------------------------- 1 | == Endpoint Documentation == 2 | 3 | [http://techwiki.openstructs.org/index.php/Dataset:_Update Dataset: Update Web Service Endpoint Documentation] 4 | -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/dataset/update/index.php: -------------------------------------------------------------------------------- 1 | ws_conneg((isset($_SERVER['HTTP_ACCEPT']) ? $_SERVER['HTTP_ACCEPT'] : ""), 104 | (isset($_SERVER['HTTP_ACCEPT_CHARSET']) ? $_SERVER['HTTP_ACCEPT_CHARSET'] : ""), 105 | (isset($_SERVER['HTTP_ACCEPT_ENCODING']) ? $_SERVER['HTTP_ACCEPT_ENCODING'] : ""), 106 | (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : "")); 107 | 108 | $ws_du->process(); 109 | 110 | $ws_du->ws_respond($ws_du->ws_serialize()); 111 | 112 | //@} 113 | 114 | ?> -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/dtd/auth/lister/authLister.dtd: -------------------------------------------------------------------------------- 1 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/dtd/converter/bibtex/bibtex.dtd: -------------------------------------------------------------------------------- 1 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/dtd/converter/common/common.dtd: -------------------------------------------------------------------------------- 1 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/dtd/converter/irjson/irjson.dtd: -------------------------------------------------------------------------------- 1 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/dtd/converter/tsv/tsv.dtd: -------------------------------------------------------------------------------- 1 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/dtd/crud/read/crudRead.dtd: -------------------------------------------------------------------------------- 1 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/dtd/dataset/read/datasetRead.dtd: -------------------------------------------------------------------------------- 1 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/dtd/ontology/read/ontologyRead.dtd: -------------------------------------------------------------------------------- 1 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/dtd/search/search.dtd: -------------------------------------------------------------------------------- 1 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/dtd/sparql/sparql.dtd: -------------------------------------------------------------------------------- 1 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/framework/Error.php: -------------------------------------------------------------------------------- 1 | id = $id; 57 | $this->webservice = $webservice; 58 | $this->name = $name; 59 | $this->description = $description; 60 | $this->debugInfo = $debugInfo; 61 | $this->mime = $mime; 62 | $this->level = $level; 63 | } 64 | 65 | function __destruct() { } 66 | 67 | /** Return the error message serialized given a certain mime type 68 | 69 | @author Frederick Giasson, Structured Dynamics LLC. 70 | */ 71 | public function getError() 72 | { 73 | $error = ""; 74 | 75 | switch($this->mime) 76 | { 77 | case "application/json": 78 | $error = "{ 79 | \"id\": \"" . $this->jsonEncode($this->id) . "\", 80 | \"webservice\": \"" . $this->jsonEncode($this->webservice) . "\", 81 | \"name\": \"" . $this->jsonEncode($this->name) . "\", 82 | \"description\": \"" . $this->jsonEncode($this->description) . "\", 83 | \"debugInformation\": \"" . $this->jsonEncode($this->debugInfo) . "\", 84 | \"level\": \"" . $this->jsonEncode($this->level) . "\" 85 | } 86 | "; 87 | break; 88 | 89 | case "text/plain": 90 | $error = $this->id . ", " . $this->webservice . ", " . $this->name . ", " . $this->description . ", " 91 | . $this->debugInfo; 92 | break; 93 | 94 | case "text/xml": 95 | default: 96 | $error = " 97 | 98 | " . $this->xmlEncode($this->id) . " 99 | " . $this->xmlEncode($this->webservice) . " 100 | " . $this->xmlEncode($this->name) . " 101 | " . $this->xmlEncode($this->description) . " 102 | " . $this->xmlEncode($this->debugInfo) . " 103 | " . $this->xmlEncode($this->level) . " 104 | 105 | "; 106 | break; 107 | } 108 | 109 | return ($error); 110 | } 111 | 112 | /** Encode content to be included in XML files 113 | 114 | @param $string The content string to be encoded 115 | 116 | @return returns the encoded string 117 | 118 | @author Frederick Giasson, Structured Dynamics LLC. 119 | */ 120 | public function xmlEncode($string) 121 | { return str_replace(array ("&", "<", ">"), array ("&", "<", ">"), $string); } 122 | 123 | /** Encode a string to put in a JSON value 124 | 125 | @param $string The string to escape 126 | 127 | @return returns the escaped string 128 | 129 | @author Frederick Giasson, Structured Dynamics LLC. 130 | */ 131 | public function jsonEncode($string) { return str_replace(array ('\\', '"', "\n", "\r", "\t"), array ('\\\\', '\\"', " ", " ", "\\t"), $string); } 132 | } 133 | 134 | //@} 135 | 136 | ?> -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/framework/OWLOntology.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/structureddynamics/OSF-Web-Services/885be5575a3ebb5f842570e40ece097fa9d32011/StructuredDynamics/osf/ws/framework/OWLOntology.php -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/framework/SourceInterface.php: -------------------------------------------------------------------------------- 1 | ws" object. 39 | * This object is a reference to the web service instance that uses this source interface. 40 | */ 41 | abstract class SourceInterface 42 | { 43 | /** A reference to the web service object instance that uses this interface instance. */ 44 | protected $ws; 45 | 46 | /** 47 | * The version of the web service endpoint with which it is compatible. 48 | * 49 | * Versions are defined like: 1.0, 2.1, 4.2, etc. 50 | */ 51 | protected $compatibleWith; 52 | 53 | /** 54 | * Version of the Source Interface 55 | * 56 | * The goal of the versioning system is to notice the user of the endpoint if 57 | * the behavior of the endpoint changed since the client application was developed 58 | * for interacting with it. 59 | * 60 | * The version will increase when the behavior of the source interface changes. The 61 | * behavior may changes if: 62 | * 63 | * (1) A bug get fixed (and at least a behavior changes) 64 | * (2) The code get refactored (and at least a behavior changes) [impacts] 65 | * (3) A new parameter/feature is added to the endpoint (but at least another behavior changed) [impacts] 66 | * (4) An existing parameter/feature got changed [impacts] 67 | * (5) An existing parameter/feature got removed [impacts] 68 | * 69 | * In this kind of versioning system, versions are not backward compatible. Because 70 | * the version only changes when core behaviors of existing featuers changes, the 71 | * versions can't be backward compatible. It is used to track if behaviors changed, 72 | * and to notice users if they did since they last implemented the API. 73 | */ 74 | protected $version; 75 | 76 | function __construct($webservice) 77 | { 78 | $this->version = "3.0"; 79 | 80 | $this->ws = $webservice; 81 | } 82 | 83 | public function validateWebServiceCompatibility() 84 | { 85 | // Validate that the version of the interface is valid with 86 | // the version of the web service endpoint. 87 | if(version_compare($this->compatibleWith, $this->ws->version) != 0) 88 | { 89 | return(FALSE); 90 | } 91 | 92 | return(TRUE); 93 | } 94 | 95 | public function validateInterfaceVersion() 96 | { 97 | // Validate if the version requested by the user is compatible 98 | // with the current one 99 | 100 | if(version_compare($this->version, $this->ws->requestedInterfaceVersion) != 0) 101 | { 102 | return(FALSE); 103 | } 104 | 105 | return(TRUE); 106 | } 107 | 108 | /** 109 | * Get the current version of the source interface. 110 | * 111 | */ 112 | public function getVersion() 113 | { 114 | return($this->version); 115 | } 116 | 117 | protected function safeDate($string) 118 | { 119 | if(!preg_match("/\d{4}/", $string, $match)) 120 | { 121 | // Year must be in YYYY form. Return error. 122 | return(FALSE); 123 | } 124 | 125 | // Converting the year to integer 126 | $year = intval($match[0]); 127 | 128 | if($year >= 1970) 129 | { 130 | $timestamp = strtotime($string); 131 | 132 | if($timestamp !== FALSE) 133 | { 134 | return(gmdate("Y-m-d\TH:i:s\Z", $timestamp)); 135 | } 136 | else 137 | { 138 | return(FALSE); 139 | } 140 | } 141 | else 142 | { 143 | // Calculating the difference between 1975 and the year 144 | $diff = 1975 - $year; 145 | 146 | // Year + diff = new_year will be for sure > 1970 147 | $new_year = $year + $diff; 148 | 149 | $timestamp = strtotime(str_replace($year, $new_year, $string)); 150 | 151 | if($timestamp !== FALSE) 152 | { 153 | // Replacing the year with the new_year, try strtotime, rendering the date 154 | $new_date = gmdate("Y-m-d\TH:i:s\Z", $timestamp); 155 | 156 | // Returning the date with the correct year 157 | return str_replace($new_year, $year, $new_date); 158 | } 159 | else 160 | { 161 | return(FALSE); 162 | } 163 | } 164 | } 165 | 166 | abstract public function processInterface(); 167 | } 168 | 169 | 170 | //@} 171 | ?> 172 | -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/framework/SparqlQuery.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/framework/SparqlQueryHttp.php: -------------------------------------------------------------------------------- 1 | wsf = $wsf; 30 | 31 | $endpoint = 'http://'. $this->wsf->triplestore_host . ':' . 32 | $this->wsf->triplestore_port . '/' . 33 | $this->wsf->sparql_endpoint; 34 | 35 | $this->ch = curl_init(); 36 | 37 | curl_setopt($this->ch, CURLOPT_URL, $endpoint); 38 | curl_setopt($this->ch, CURLOPT_POST, 1); 39 | curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, 1); 40 | curl_setopt($this->ch, CURLOPT_HTTPHEADER, array("Accept: application/sparql-results+json")); 41 | } 42 | 43 | function __destruct() 44 | { 45 | $this->close(); 46 | } 47 | 48 | public function close() 49 | { 50 | curl_close($this->ch); 51 | unset($this); 52 | } 53 | 54 | public function query($query) 55 | { 56 | curl_setopt($this->ch, CURLOPT_POSTFIELDS, 'query='.urlencode($query)); 57 | 58 | $this->data = curl_exec($this->ch); 59 | 60 | $this->http_status_code = curl_getinfo($this->ch, CURLINFO_HTTP_CODE); 61 | 62 | if(curl_errno($this->ch) || ($this->http_status_code < 200 || $this->http_status_code >= 300)) 63 | { 64 | $this->errorMessage = $this->data; 65 | 66 | // Reinitialize 67 | $this->nb_bindings = -1; 68 | $this->current_binding = -1; 69 | $this->resultset = null; 70 | $this->data = ''; 71 | 72 | return FALSE; 73 | } 74 | else 75 | { 76 | $this->resultset = json_decode($this->data, true); 77 | 78 | $this->resultset = $this->resultset['results']['bindings']; 79 | $this->current_binding = -1; 80 | $this->nb_bindings = count($this->resultset); 81 | 82 | // Reinitialize 83 | $this->errorMessage = ''; 84 | $this->data = ''; 85 | 86 | return TRUE; 87 | } 88 | } 89 | 90 | public function fetch_binding() 91 | { 92 | // Move the bindings cursor by one 93 | $this->current_binding++; 94 | 95 | if($this->current_binding >= $this->nb_bindings) 96 | { 97 | // No more bindings available 98 | return(FALSE); 99 | } 100 | else 101 | { 102 | // There still exists bindings in the resultset 103 | return(TRUE); 104 | } 105 | } 106 | 107 | public function value($var) 108 | { 109 | if(array_key_exists($var, $this->resultset[$this->current_binding])) 110 | { 111 | return($this->resultset[$this->current_binding][$var]['value']); 112 | } 113 | else 114 | { 115 | return(FALSE); 116 | } 117 | } 118 | 119 | public function error() 120 | { 121 | if(!empty($this->errorMessage)) 122 | { 123 | return(TRUE); 124 | } 125 | else 126 | { 127 | return(FALSE); 128 | } 129 | } 130 | 131 | public function errormsg() 132 | { 133 | return($this->errorMessage); 134 | } 135 | 136 | public function http_status_code() 137 | { 138 | return($this->http_status_code); 139 | } 140 | } 141 | 142 | ?> -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/framework/SparqlQueryOdbc.php: -------------------------------------------------------------------------------- 1 | wsf = $wsf; 41 | 42 | $this->username = $wsf->triplestore_username; 43 | $this->password = $wsf->triplestore_password; 44 | $this->dsn = $wsf->triplestore_dsn; 45 | $this->host = $wsf->triplestore_host; 46 | 47 | ini_set("odbc.default_cursortype", "0"); 48 | $this->link = odbc_connect($this->dsn, $this->username, $this->password); 49 | 50 | if($this->link === FALSE) 51 | { 52 | $this->error = 'Connection error'; 53 | } 54 | } 55 | 56 | public function close(){} 57 | 58 | 59 | public function query($query) 60 | { 61 | $this->error = ''; 62 | 63 | if(stripos($query, "DB.DBA.TTLP_MT") === FALSE && 64 | stripos($query, "DB.DBA.RDF_LOAD_RDFXML_MT") === FALSE) 65 | { 66 | $this->query = "sparql " . $query; 67 | } 68 | else 69 | { 70 | $this->query = $query; 71 | } 72 | 73 | if($this->wsf->virtuoso_disable_transaction_log && 74 | (stripos($query, "DB.DBA.TTLP_MT") !== FALSE || 75 | stripos($query, "DB.DBA.RDF_LOAD_RDFXML_MT") !== FALSE)) 76 | { 77 | $this->resultset = odbc_exec($this->link, 'log_enable(2)'); 78 | } 79 | 80 | $this->resultset = odbc_exec($this->link, $this->query); 81 | 82 | if($this->resultset === FALSE) 83 | { 84 | $this->error = 'Query execution error'; 85 | 86 | return(FALSE); 87 | } 88 | 89 | return(TRUE); 90 | } 91 | 92 | public function fetch_binding() 93 | { 94 | return(odbc_fetch_row($this->resultset)); 95 | } 96 | 97 | public function value($var) 98 | { 99 | $value = ''; 100 | $fieldID = odbc_field_num($this->resultset, $var); 101 | 102 | if($fieldID === FALSE) 103 | { 104 | $this->error = 'Field number fetching error'; 105 | 106 | return(FALSE); 107 | } 108 | 109 | $value = odbc_result($this->resultset, $fieldID); 110 | 111 | if($value === FALSE) 112 | { 113 | $this->error = 'Value fetching error. Field ID: '. $fieldID; 114 | 115 | return(FALSE); 116 | } 117 | 118 | // Handle possible big values 119 | if(strlen($value) == (ini_get("odbc.defaultlrl") - 1)) 120 | { 121 | while(($chunk = odbc_result($this->resultset, $fieldID)) !== FALSE) 122 | { 123 | $value .= $chunk; 124 | } 125 | } 126 | 127 | return($value); 128 | } 129 | 130 | public function error() 131 | { 132 | if(!empty($this->error)) 133 | { 134 | return(TRUE); 135 | } 136 | else 137 | { 138 | return(FALSE); 139 | } 140 | } 141 | 142 | public function errormsg() 143 | { 144 | return(odbc_errormsg($this->link) . "\n\n" . $this->error); 145 | } 146 | } 147 | 148 | ?> -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/framework/arc2/README.mediawiki: -------------------------------------------------------------------------------- 1 | Put the ARC2 software code in this folder. All the ARC2 files have to be put directly in this folder, and not in any sub folder. -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/index.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/keys.ini: -------------------------------------------------------------------------------- 1 | ; To generate a unique key: 2 | ; strtoupper(bin2hex(openssl_random_pseudo_bytes(16))) 3 | 4 | [keys] 5 | administer = "some-key" -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/ontology/admin/README.mediawiki: -------------------------------------------------------------------------------- 1 | These are OSF administrator scripts. Each of these scripts have their own specificities, so make sure you read 2 | each of them below. 3 | 4 | == analyzeRegisters.php == 5 | 6 | This script is used to see if the OWLAPI instance is up and running. Also, it tells if the sessions threads are 7 | currently in use, and what are their status. 8 | 9 | === Security Considerations === 10 | 11 | Make sure that this script is only accessible to the administrators of your server. This can be done by restricting 12 | access to it to a certain IP address, in Apache2. You can also move it in another location. 13 | 14 | Otherwise, make sure to delete it from the file server if you can't restrict (or don't want to) its access. 15 | 16 | == destroy.php == 17 | 18 | This script is used to destroy all the running OWLAPI instances sessions threads. This script can be used to clean 19 | an instance when doing some testing or such. 20 | 21 | === Security Considerations === 22 | 23 | Make sure that this script is only accessible to the administrators of your server. This can be done by restricting 24 | access to it to a certain IP address, in Apache2. You can also move it in another location. 25 | 26 | Otherwise, make sure to delete it from the file server if you can't restrict (or don't want to) its access. 27 | 28 | == load_ontologies.php == 29 | 30 | This script is used to load a batch of ontologies into an OSF instance. 31 | 32 | === Security Considerations === 33 | 34 | Make sure that this script is only accessible to the administrators of your server. This can be done by restricting 35 | access to it to a certain IP address, in Apache2. You can also move it in another location. 36 | 37 | Otherwise, make sure to delete it from the file server if you can't restrict (or don't want to) its access. 38 | -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/ontology/admin/analyzeRegisters.php: -------------------------------------------------------------------------------- 1 | we re-use the pre-created session without destroying the previous one 22 | // third param "0" => it nevers timeout. 23 | $OwlApiSession = java_session("OWLAPI", false, 0); 24 | 25 | echo "

Registered ontologies

"; 26 | 27 | if(!is_null(java_values($OwlApiSession->get("ontologiesRegister")))) 28 | { 29 | $register = $OwlApiSession->get("ontologiesRegister"); 30 | 31 | foreach($register as $onto => $id) 32 | { 33 | $onto = str_replace("-ontology", "", $onto); 34 | 35 | echo "$onto
"; 36 | } 37 | } 38 | else 39 | { 40 | echo "None"; 41 | } 42 | 43 | echo "

Registered reasoners

"; 44 | 45 | if(!is_null(java_values($OwlApiSession->get("reasonersRegister")))) 46 | { 47 | $register = $OwlApiSession->get("reasonersRegister"); 48 | 49 | foreach($register as $onto => $id) 50 | { 51 | $onto = str_replace("-reasoner", "", $onto); 52 | 53 | echo "$onto
"; 54 | } 55 | } 56 | else 57 | { 58 | echo "None"; 59 | } 60 | 61 | //@} 62 | 63 | ?> -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/ontology/admin/destroy.php: -------------------------------------------------------------------------------- 1 | we re-use the pre-created session without destroying the previous one 33 | // third param "0" => it nevers timeout. 34 | $OwlApiSession = java_session("OWLAPI", false, 0); 35 | 36 | $OwlApiSession->destroy(); 37 | 38 | echo "Destroyed..."; 39 | 40 | //@} 41 | 42 | ?> -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/ontology/create/README.mediawiki: -------------------------------------------------------------------------------- 1 | == Endpoint Documentation == 2 | 3 | [http://techwiki.openstructs.org/index.php/Ontology:_Create Ontology Create Web Service Endpoint Documentation] 4 | -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/ontology/create/index.php: -------------------------------------------------------------------------------- 1 | ws_conneg((isset($_SERVER['HTTP_ACCEPT']) ? $_SERVER['HTTP_ACCEPT'] : ""), 83 | (isset($_SERVER['HTTP_ACCEPT_CHARSET']) ? $_SERVER['HTTP_ACCEPT_CHARSET'] : ""), 84 | (isset($_SERVER['HTTP_ACCEPT_ENCODING']) ? $_SERVER['HTTP_ACCEPT_ENCODING'] : ""), 85 | (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : "")); 86 | 87 | // Set the advanced indexation 88 | $ws_ontologycreate->setAdvancedIndexation($advancedIndexation); 89 | 90 | // set reasoner 91 | if($reasoner) 92 | { 93 | $ws_ontologycreate->useReasonerForAdvancedIndexation(); 94 | } 95 | else 96 | { 97 | $ws_ontologycreate->stopUsingReasonerForAdvancedIndexation(); 98 | } 99 | 100 | 101 | $ws_ontologycreate->createOntology(); 102 | 103 | $ws_ontologycreate->ws_respond($ws_ontologycreate->ws_serialize()); 104 | 105 | //@} 106 | 107 | ?> -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/ontology/delete/README.mediawiki: -------------------------------------------------------------------------------- 1 | == Endpoint Documentation == 2 | 3 | [http://techwiki.openstructs.org/index.php/Ontology:_Delete Ontology: Delete Web Service Endpoint Documentation] 4 | -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/ontology/delete/index.php: -------------------------------------------------------------------------------- 1 | ws_conneg((isset($_SERVER['HTTP_ACCEPT']) ? $_SERVER['HTTP_ACCEPT'] : ""), 68 | (isset($_SERVER['HTTP_ACCEPT_CHARSET']) ? $_SERVER['HTTP_ACCEPT_CHARSET'] : ""), 69 | (isset($_SERVER['HTTP_ACCEPT_ENCODING']) ? $_SERVER['HTTP_ACCEPT_ENCODING'] : ""), 70 | (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : "")); 71 | 72 | 73 | $params = explode(";", $params); 74 | $parameters = array(); 75 | 76 | foreach($params as $param) 77 | { 78 | $p = explode("=", $param); 79 | 80 | $parameters[$p[0]] = urldecode(isset($p[1]) ? $p[1] : ''); 81 | } 82 | 83 | switch(strtolower($function)) 84 | { 85 | case "deleteontology": 86 | $ws_ontologydelete->deleteOntology(); 87 | break; 88 | 89 | case "deleteclass": 90 | $ws_ontologydelete->deleteClass($parameters["uri"]); 91 | break; 92 | 93 | // Delete an annotation, object or datatype property from the ontology 94 | case "deleteproperty": 95 | $ws_ontologydelete->deleteProperty($parameters["uri"]); 96 | break; 97 | 98 | case "deletenamedindividual": 99 | $ws_ontologydelete->deleteNamedIndividual($parameters["uri"]); 100 | break; 101 | 102 | 103 | default: 104 | $ws_ontologydelete->returnError(400, "Bad Request", "_200"); 105 | break; 106 | } 107 | 108 | $ws_ontologydelete->ws_respond($ws_ontologydelete->ws_serialize()); 109 | 110 | //@} 111 | 112 | ?> -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/ontology/read/README.mediawiki: -------------------------------------------------------------------------------- 1 | == Endpoint Documentation == 2 | 3 | [http://techwiki.openstructs.org/index.php/Ontology:_Read Ontology: Read Web Service Endpoint Documentation] 4 | -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/ontology/read/index.php: -------------------------------------------------------------------------------- 1 | ws_conneg((isset($_SERVER['HTTP_ACCEPT']) ? $_SERVER['HTTP_ACCEPT'] : ""), 85 | (isset($_SERVER['HTTP_ACCEPT_CHARSET']) ? $_SERVER['HTTP_ACCEPT_CHARSET'] : ""), 86 | (isset($_SERVER['HTTP_ACCEPT_ENCODING']) ? $_SERVER['HTTP_ACCEPT_ENCODING'] : ""), 87 | (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : "")); 88 | 89 | if(strtolower($reasoner) == "true" || 90 | strtolower($reasoner) == "on" || 91 | strtolower($reasoner) == "1" ) 92 | { 93 | $ws_or->useReasoner(); 94 | } 95 | else 96 | { 97 | $ws_or->stopUsingReasoner(); 98 | } 99 | 100 | $ws_or->process(); 101 | 102 | $ws_or->ws_respond($ws_or->ws_serialize()); 103 | 104 | //@} 105 | 106 | ?> -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/ontology/update/README.mediawiki: -------------------------------------------------------------------------------- 1 | == Endpoint Documentation == 2 | 3 | [http://techwiki.openstructs.org/index.php/Ontology:_Update Ontology: Update Web Service Endpoint Documentation] 4 | -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/ontology/update/index.php: -------------------------------------------------------------------------------- 1 | ws_conneg((isset($_SERVER['HTTP_ACCEPT']) ? $_SERVER['HTTP_ACCEPT'] : ""), 83 | (isset($_SERVER['HTTP_ACCEPT_CHARSET']) ? $_SERVER['HTTP_ACCEPT_CHARSET'] : ""), 84 | (isset($_SERVER['HTTP_ACCEPT_ENCODING']) ? $_SERVER['HTTP_ACCEPT_ENCODING'] : ""), 85 | (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : "")); 86 | 87 | 88 | // set reasoner 89 | if($reasoner) 90 | { 91 | $ws_ontologyupdate->useReasonerForAdvancedIndexation(); 92 | } 93 | else 94 | { 95 | $ws_ontologyupdate->stopUsingReasonerForAdvancedIndexation(); 96 | } 97 | 98 | 99 | $params = explode(";", $params); 100 | $parameters = array(); 101 | 102 | foreach($params as $param) 103 | { 104 | $p = explode("=", $param); 105 | 106 | $parameters[strtolower($p[0])] = urldecode((isset($p[1]) ? $p[1] : '')); 107 | } 108 | 109 | switch(strtolower($function)) 110 | { 111 | case "saveontology": 112 | $ws_ontologyupdate->saveOntology(); 113 | break; 114 | 115 | case "createorupdateentity": 116 | $advancedIndexation = FALSE; 117 | 118 | if($parameters["advancedindexation"] == "1" || 119 | strtolower($parameters["advancedindexation"]) == "true") 120 | { 121 | $advancedIndexation = TRUE; 122 | } 123 | 124 | $ws_ontologyupdate->createOrUpdateEntity($parameters["document"], $advancedIndexation); 125 | break; 126 | 127 | case "updateentityuri": 128 | $advancedIndexation = FALSE; 129 | 130 | if($parameters["advancedindexation"] == "1" || 131 | strtolower($parameters["advancedindexation"]) == "true") 132 | { 133 | $advancedIndexation = TRUE; 134 | } 135 | 136 | $ws_ontologyupdate->updateEntityUri($parameters["olduri"], $parameters["newuri"], $advancedIndexation); 137 | break; 138 | 139 | 140 | default: 141 | $ws_ontologyupdate->returnError(400, "Bad Request", "_201"); 142 | break; 143 | } 144 | 145 | $ws_ontologyupdate->ws_respond($ws_ontologyupdate->ws_serialize()); 146 | 147 | //@} 148 | 149 | ?> -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/osf.ini: -------------------------------------------------------------------------------- 1 | 2 | ; OSF Network Configuration File 3 | ; 4 | ; All the settings related to the configuration of the OSF Web Services 5 | 6 | [network] 7 | 8 | ; Base URL used to access the OSF instance 9 | ; Note: This URL should be the same as the one used to register the OSF 10 | ; instance at the Step 10 of the installation manual. 11 | ; Note: *WITHOUT* ending slash 12 | wsf_base_url = "http://localhost" 13 | 14 | ; Local server path of the OSF instance 15 | wsf_base_path = "/usr/share/osf/StructuredDynamics/osf/ws/" 16 | 17 | [search] 18 | 19 | ; Exclude a list of properties to be returned by the Search web service endpoint. 20 | ; All these attributes will be created, updated and returned by Solr, but they won't 21 | ; be returned in the Search web service endpoint resultset. 22 | 23 | ; exclude_attributes[] = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#value' 24 | 25 | [owlapi] 26 | 27 | ; Reasonner to use for this OWLAPI instance: 28 | ; (1) pellet 29 | ; (2) hermit 30 | ; (3) factpp 31 | ; 32 | ; Note: Make sure these reasoners are properly configured on your instance. 33 | reasoner = "pellet"; 34 | 35 | ; Number of sessions (threads) to use in parallel 36 | nb_sessions = "1" 37 | 38 | ; URL where the Java Bridge can be accessed from this server 39 | bridge_uri = "http://localhost:8080/OWLAPI/java/Java.inc" 40 | 41 | [geo] 42 | 43 | ; Specifies if this instance is geo-enabled. To have a geo-enabled instance 44 | ; you have to make sure that you have Solr-Locale installed on your instance. 45 | geoenabled = "true" 46 | 47 | [lang] 48 | 49 | ; An array of supported languages by the OSF instance. 50 | ; Each of the language that appear here have to be properly 51 | ; configured in the Solr schema. 52 | ; Note: the first language of this array is considered to be 53 | ; the default language to use in the system. 54 | supported_languages[] = "en" 55 | ;supported_languages[] = "fr" 56 | 57 | ; List of default web service interaces to use for this OSF instance 58 | ; The value of these settings are the names of the SourceInterface classes 59 | ; to use (and are case sensitives) 60 | [default-interfaces] 61 | 62 | auth_lister = "DefaultSourceInterface" 63 | auth_registrar_access = "DefaultSourceInterface" 64 | auth_registrar_ws = "DefaultSourceInterface" 65 | auth_validator = "DefaultSourceInterface" 66 | crud_create = "DefaultSourceInterface" 67 | crud_read = "DefaultSourceInterface" 68 | crud_delete = "DefaultSourceInterface" 69 | crud_update = "DefaultSourceInterface" 70 | dataset_create = "DefaultSourceInterface" 71 | dataset_read = "DefaultSourceInterface" 72 | dataset_update = "DefaultSourceInterface" 73 | dataset_delete = "DefaultSourceInterface" 74 | ontology_create = "DefaultSourceInterface" 75 | ontology_read = "DefaultSourceInterface" 76 | ontology_update = "DefaultSourceInterface" 77 | ontology_delete = "DefaultSourceInterface" 78 | revision_lister = "DefaultSourceInterface" 79 | revision_read = "DefaultSourceInterface" 80 | revision_update = "DefaultSourceInterface" 81 | revision_delete = "DefaultSourceInterface" 82 | revision_diff = "DefaultSourceInterface" 83 | scones = "DefaultSourceInterface" 84 | search = "DefaultSourceInterface" 85 | sparql = "DefaultSourceInterface" 86 | 87 | [datasets] 88 | 89 | ; The base URI of the graph where the OSF structure description get indexed 90 | wsf_graph = "http://localhost/wsf/" 91 | 92 | ; DTD base URL where to resolve DTD used to share data 93 | dtd_base = "http://localhost/ws/dtd/" 94 | 95 | 96 | [ontologies] 97 | 98 | ; Ontologies description files (in RDFS and OWL) 99 | ontologies_files_folder = "/data/ontologies/files/" 100 | 101 | ; OSF ontological structure 102 | ontological_structure_folder = "/data/ontologies/structure/" 103 | 104 | 105 | [triplestore] 106 | 107 | ; Username used to connect to the triple store instance 108 | username = "dba" 109 | 110 | ; Password used to connect to the triple store instance 111 | password = "dba" 112 | 113 | ; Host used to connect to the triple store instance 114 | host = "localhost" 115 | 116 | ; Port number where the triple store server is reachable 117 | port = "8890" 118 | 119 | ; DSN used to connect to the triple store instance 120 | dsn = "OSF-triples-store" 121 | 122 | ; Communication channel to use between the web services and the 123 | ; triple store. Can be: 124 | ; (1) "odbc" (default) 125 | ; (2) "http" 126 | ; 127 | ; Note: if you use the "http" channel, make sure to set "sparql-insert" 128 | ; to "insert data" below. 129 | channel = "odbc" 130 | 131 | ; Path URI of the sparql endpoint. 132 | ; Ex: http://[host]:[port]/[sparql] 133 | ; Only necessary if `channel = "http"` 134 | sparql = "sparql" 135 | 136 | ; Path URI of the SPARQL 1.1 Graph Store HTTP Protocol endpoint. 137 | ; Ex: http://[host]:[port]/[sparql-graph-crud-auth] 138 | ; Only necessary if `channel = "http"` 139 | ; Note: make sure that you provide the SPARQL_UPDATE rights to the 140 | ; Virtuoso SPARQL user, otherwise no data could be written 141 | ; to Virtuoso. 142 | sparql-graph = "sparql-graph-crud-auth" 143 | 144 | ; SPARQL Update command to use to insert data into the triplestore 145 | ; Possible values: (1) "insert data" 146 | ; (2) "insert" 147 | ; (3) "virtuoso" 148 | ; If you have issues importing blanknode data, try using "insert". 149 | ; Otherwise you should always use "insert data" 150 | ; Optinally if the channel is "odbc" and that you are using 151 | ; Virtuoso as your triple store, then you can use "virtuoso" 152 | ; as they way to insert triples into the triples store. It 153 | ; uses an optimized method for adding triples to the store. 154 | sparql-insert = "virtuoso" 155 | 156 | ; Disable transaction log when importing data in Virtuoso. 157 | ; If there are billion triples in Virtuoso, it may have issues 158 | ; importing more triples and will "hangs" when importing more 159 | ; triples. Disabling the transaction log will fix this issue 160 | ; 161 | ; This setting is specific to Virtuoso. 162 | virtuoso-disable-transaction-log = "true" 163 | 164 | [solr] 165 | 166 | ; The core to use for Solr; Use "" (double, double-quotes) when the "multicore" 167 | ; mode is not used 168 | solr_core = "" 169 | 170 | ; Host used to connect to the solr instance 171 | solr_host = "localhost" 172 | 173 | ; Auto commit handled by the Solr data management systems. If this parameter is true, 174 | ; then this means Solr will handle the commit operation by itself. If it is false, then the 175 | ; web services will trigger the commit operations. Usually, Auto-commit should be handled 176 | ; by Solr when the size of the dataset is too big, otherwise operation such as delete could 177 | ; take much time. 178 | solr_auto_commit = "FALSE" 179 | 180 | ; Port number where the Solr store server is reachable 181 | solr_port = "8983" 182 | 183 | ; This is the folder there the file of the index where all the fields defined in Solr 184 | ; are indexed. You have to make sure that the web server has write access to this folder. 185 | ; This folder path has to end with a slash "/". 186 | fields_index_folder = "/tmp/" 187 | 188 | [scones] 189 | 190 | ; Scones endpoint base URL (which may includes port number like "localhost:8080") 191 | endpoint = "http://localhost:8080/scones/" 192 | 193 | [memcached] 194 | 195 | ; Specifies if a memcached server is available to the web service endpoints 196 | memcached_enabled = "TRUE" 197 | 198 | ; Specifies the host location of that enabled memcached server 199 | memcached_host = "localhost" 200 | 201 | ; Specifies the port number of that enabled memcached server 202 | memcached_port = "11211" 203 | 204 | ; Memcached expiration rules per web service endpoint. 205 | ; In this section, we can define different expirency rules depending on the web service endpoint. 206 | ; The expirency time is calculated in seconds. If the value is '0', it means that it won't ever expire. 207 | memcached_auth_validator_expire = 0 208 | memcached_auth_lister_expire = 0 209 | memcached_crud_read_expire = 0 210 | memcached_dataset_read_expire = 0 211 | memcached_ontology_read_expire = 0 212 | memcached_revision_lister_expire = 0 213 | memcached_revision_read_expire = 0 214 | memcached_search_expire = 0 215 | memcached_sparql_expire = 0 -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/revision/delete/README.mediawiki: -------------------------------------------------------------------------------- 1 | == Endpoint Documentation == 2 | 3 | [http://techwiki.openstructs.org/index.php/Revision:_Delete Revision: Delete Web Service Endpoint Documentation] -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/revision/delete/index.php: -------------------------------------------------------------------------------- 1 | ws_conneg((isset($_SERVER['HTTP_ACCEPT']) ? $_SERVER['HTTP_ACCEPT'] : ""), 59 | (isset($_SERVER['HTTP_ACCEPT_CHARSET']) ? $_SERVER['HTTP_ACCEPT_CHARSET'] : ""), 60 | (isset($_SERVER['HTTP_ACCEPT_ENCODING']) ? $_SERVER['HTTP_ACCEPT_ENCODING'] : ""), 61 | (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : "")); 62 | 63 | $ws_rr->process(); 64 | 65 | $ws_rr->ws_respond($ws_rr->ws_serialize()); 66 | 67 | //@} 68 | 69 | ?> -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/revision/delete/interfaces/DefaultSourceInterface.php: -------------------------------------------------------------------------------- 1 | compatibleWith = "3.0"; 16 | } 17 | 18 | public function processInterface() 19 | { 20 | // Make sure there was no conneg error prior to this process call 21 | if($this->ws->conneg->getStatus() == 200) 22 | { 23 | $revisionsDataset = rtrim($this->ws->dataset, '/').'/revisions/'; 24 | 25 | // Make sure the lifecycle is not 'published' 26 | $this->ws->sparql->query("select ?status 27 | from <" . $revisionsDataset . "> 28 | where 29 | { 30 | <".$this->ws->revuri."> ?status . 31 | } 32 | limit 1 33 | offset 0"); 34 | 35 | if($this->ws->sparql->error()) 36 | { 37 | $this->ws->conneg->setStatus(500); 38 | $this->ws->conneg->setStatusMsg("Internal Error"); 39 | $this->ws->conneg->setStatusMsgExt($this->ws->errorMessenger->_303->name); 40 | $this->ws->conneg->setError($this->ws->errorMessenger->_303->id, $this->ws->errorMessenger->ws, 41 | $this->ws->errorMessenger->_303->name, $this->ws->errorMessenger->_303->description, 42 | $this->ws->sparql->errormsg(), $this->ws->errorMessenger->_303->level); 43 | 44 | return; 45 | } 46 | else 47 | { 48 | $this->ws->sparql->fetch_binding(); 49 | $status = $this->ws->sparql->value('status'); 50 | 51 | if($status == Namespaces::$wsf.'published') 52 | { 53 | $this->ws->conneg->setStatus(400); 54 | $this->ws->conneg->setStatusMsg("Bad Request"); 55 | $this->ws->conneg->setError($this->ws->errorMessenger->_304->id, $this->ws->errorMessenger->ws, 56 | $this->ws->errorMessenger->_304->name, $this->ws->errorMessenger->_304->description, 57 | $this->ws->sparql->errormsg(), $this->ws->errorMessenger->_304->level); 58 | 59 | return; 60 | } 61 | } 62 | 63 | // Delete the revision 64 | $this->ws->sparql->query("delete from <" . $revisionsDataset . "> 65 | { 66 | <".$this->ws->revuri."> ?s ?p . 67 | } 68 | where 69 | { 70 | <".$this->ws->revuri."> ?s ?p . 71 | }"); 72 | 73 | if($this->ws->sparql->error()) 74 | { 75 | $this->ws->conneg->setStatus(500); 76 | $this->ws->conneg->setStatusMsg("Internal Error"); 77 | $this->ws->conneg->setStatusMsgExt($this->ws->errorMessenger->_305->name); 78 | $this->ws->conneg->setError($this->ws->errorMessenger->_305->id, $this->ws->errorMessenger->ws, 79 | $this->ws->errorMessenger->_305->name, $this->ws->errorMessenger->_305->description, 80 | $this->ws->sparql->errormsg(), $this->ws->errorMessenger->_305->level); 81 | 82 | return; 83 | } 84 | 85 | // Delete possible reification statements for this revision 86 | $this->ws->sparql->query("delete from <" . $revisionsDataset . "> 87 | { 88 | ?statement ?p ?o. 89 | } 90 | where 91 | { 92 | ?statement <".$this->ws->revuri."> . 93 | ?statement ?p ?o. 94 | }"); 95 | 96 | if($this->ws->sparql->error()) 97 | { 98 | $this->ws->conneg->setStatus(500); 99 | $this->ws->conneg->setStatusMsg("Internal Error"); 100 | $this->ws->conneg->setStatusMsgExt($this->ws->errorMessenger->_306->name); 101 | $this->ws->conneg->setError($this->ws->errorMessenger->_306->id, $this->ws->errorMessenger->ws, 102 | $this->ws->errorMessenger->_306->name, $this->ws->errorMessenger->_306->description, 103 | $this->ws->sparql->errormsg(), $this->ws->errorMessenger->_306->level); 104 | 105 | return; 106 | } 107 | 108 | // Invalidate caches 109 | if($this->ws->memcached_enabled) 110 | { 111 | $this->ws->invalidateCache('revision-read'); 112 | $this->ws->invalidateCache('revision-lister'); 113 | $this->ws->invalidateCache('search'); 114 | $this->ws->invalidateCache('sparql'); 115 | $this->ws->invalidateCache('crud-read'); 116 | } 117 | } 118 | } 119 | } 120 | ?> 121 | -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/revision/diff/README.mediawiki: -------------------------------------------------------------------------------- 1 | == Endpoint Documentation == 2 | 3 | [http://techwiki.openstructs.org/index.php/Revision:_Diff Revision: Diff Web Service Endpoint Documentation] -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/revision/diff/index.php: -------------------------------------------------------------------------------- 1 | ws_conneg((isset($_SERVER['HTTP_ACCEPT']) ? $_SERVER['HTTP_ACCEPT'] : ""), 66 | (isset($_SERVER['HTTP_ACCEPT_CHARSET']) ? $_SERVER['HTTP_ACCEPT_CHARSET'] : ""), 67 | (isset($_SERVER['HTTP_ACCEPT_ENCODING']) ? $_SERVER['HTTP_ACCEPT_ENCODING'] : ""), 68 | (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : "")); 69 | 70 | $ws_rd->process(); 71 | 72 | $ws_rd->ws_respond($ws_rd->ws_serialize()); 73 | 74 | //@} 75 | 76 | ?> -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/revision/lister/README.mediawiki: -------------------------------------------------------------------------------- 1 | == Endpoint Documentation == 2 | 3 | [http://techwiki.openstructs.org/index.php/Revision:_Lister Revision: Lister Web Service Endpoint Documentation] -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/revision/lister/index.php: -------------------------------------------------------------------------------- 1 | ws_conneg((isset($_SERVER['HTTP_ACCEPT']) ? $_SERVER['HTTP_ACCEPT'] : ""), 67 | (isset($_SERVER['HTTP_ACCEPT_CHARSET']) ? $_SERVER['HTTP_ACCEPT_CHARSET'] : ""), 68 | (isset($_SERVER['HTTP_ACCEPT_ENCODING']) ? $_SERVER['HTTP_ACCEPT_ENCODING'] : ""), 69 | (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : "")); 70 | 71 | $ws_rl->process(); 72 | 73 | $ws_rl->ws_respond($ws_rl->ws_serialize()); 74 | 75 | //@} 76 | 77 | ?> -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/revision/lister/interfaces/DefaultSourceInterface.php: -------------------------------------------------------------------------------- 1 | compatibleWith = "3.0"; 16 | } 17 | 18 | public function processInterface() 19 | { 20 | // Make sure there was no conneg error prior to this process call 21 | if($this->ws->conneg->getStatus() == 200) 22 | { 23 | $revisionsDataset = rtrim($this->ws->dataset, '/').'/revisions/'; 24 | $query = ''; 25 | 26 | if($this->ws->memcached_enabled) 27 | { 28 | $key = $this->ws->generateCacheKey('revision-lister', array( 29 | $this->ws->mode, 30 | $revisionsDataset, 31 | $this->ws->recordUri 32 | )); 33 | 34 | if($return = $this->ws->memcached->get($key)) 35 | { 36 | $this->ws->setResultset($return); 37 | 38 | return; 39 | } 40 | } 41 | 42 | switch($this->ws->mode) 43 | { 44 | case 'short': 45 | $query = "select ?revision ?timestamp 46 | from <" . $revisionsDataset . "> 47 | where 48 | { 49 | ?revision ?timestamp ; 50 | <".$this->ws->recordUri."> . 51 | } 52 | order by desc(?timestamp)"; 53 | break; 54 | 55 | case 'long': 56 | $query = "select ?revision ?timestamp ?performer ?status 57 | from <" . $revisionsDataset . "> 58 | where 59 | { 60 | ?revision ?timestamp ; 61 | ?performer ; 62 | ?status ; 63 | <".$this->ws->recordUri."> . 64 | } 65 | order by desc(?timestamp)"; 66 | break; 67 | 68 | default: 69 | $this->ws->conneg->setStatus(400); 70 | $this->ws->conneg->setStatusMsg("Bad Request"); 71 | $this->ws->conneg->setStatusMsgExt($this->ws->errorMessenger->_303->name); 72 | $this->ws->conneg->setError($this->ws->errorMessenger->_303->id, $this->ws->errorMessenger->ws, 73 | $this->ws->errorMessenger->_303->name, $this->ws->errorMessenger->_303->description, '', 74 | $this->ws->errorMessenger->_303->level); 75 | return; 76 | break; 77 | } 78 | 79 | $this->ws->sparql->query($query); 80 | 81 | if($this->ws->sparql->error()) 82 | { 83 | $this->ws->conneg->setStatus(500); 84 | $this->ws->conneg->setStatusMsg("Internal Error"); 85 | $this->ws->conneg->setStatusMsgExt($this->ws->errorMessenger->_304->name); 86 | $this->ws->conneg->setError($this->ws->errorMessenger->_304->id, $this->ws->errorMessenger->ws, 87 | $this->ws->errorMessenger->_304->name, $this->ws->errorMessenger->_304->description, 88 | $this->ws->sparql->errormsg(), $this->ws->errorMessenger->_304->level); 89 | 90 | return; 91 | } 92 | else 93 | { 94 | while($this->ws->sparql->fetch_binding()) 95 | { 96 | switch($this->ws->mode) 97 | { 98 | case 'short': 99 | $revision = $this->ws->sparql->value('revision'); 100 | $timestamp = $this->ws->sparql->value('timestamp'); 101 | 102 | $subject = new Subject($revision); 103 | 104 | $subject->setType(Namespaces::$wsf.'Revision'); 105 | 106 | $subject->setDataAttribute(Namespaces::$wsf.'revisionTime', $timestamp, Namespaces::$xsd.'decimal'); 107 | 108 | $this->ws->rset->addSubject($subject); 109 | break; 110 | 111 | case 'long': 112 | $revision = $this->ws->sparql->value('revision'); 113 | $timestamp = $this->ws->sparql->value('timestamp'); 114 | $performer = $this->ws->sparql->value('performer'); 115 | $status = $this->ws->sparql->value('status'); 116 | 117 | $subject = new Subject($revision); 118 | 119 | $subject->setType(Namespaces::$wsf.'Revision'); 120 | 121 | $subject->setDataAttribute(Namespaces::$wsf.'revisionTime', $timestamp, Namespaces::$xsd.'decimal'); 122 | $subject->setObjectAttribute(Namespaces::$wsf.'performer', $performer); 123 | $subject->setObjectAttribute(Namespaces::$wsf.'status', $status); 124 | 125 | $this->ws->rset->addSubject($subject); 126 | break; 127 | } 128 | } 129 | } 130 | 131 | if($this->ws->memcached_enabled) 132 | { 133 | $this->ws->memcached->set($key, $this->ws->rset, NULL, $this->ws->memcached_revision_lister_expire); 134 | } 135 | } 136 | } 137 | } 138 | ?> 139 | -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/revision/read/README.mediawiki: -------------------------------------------------------------------------------- 1 | == Endpoint Documentation == 2 | 3 | [http://techwiki.openstructs.org/index.php/Revision:_Read Revision: Read Web Service Endpoint Documentation] -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/revision/read/index.php: -------------------------------------------------------------------------------- 1 | ws_conneg((isset($_SERVER['HTTP_ACCEPT']) ? $_SERVER['HTTP_ACCEPT'] : ""), 66 | (isset($_SERVER['HTTP_ACCEPT_CHARSET']) ? $_SERVER['HTTP_ACCEPT_CHARSET'] : ""), 67 | (isset($_SERVER['HTTP_ACCEPT_ENCODING']) ? $_SERVER['HTTP_ACCEPT_ENCODING'] : ""), 68 | (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : "")); 69 | 70 | $ws_rr->process(); 71 | 72 | $ws_rr->ws_respond($ws_rr->ws_serialize()); 73 | 74 | //@} 75 | 76 | ?> -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/revision/read/interfaces/DefaultSourceInterface.php: -------------------------------------------------------------------------------- 1 | compatibleWith = "3.0"; 16 | } 17 | 18 | public function processInterface() 19 | { 20 | // Make sure there was no conneg error prior to this process call 21 | if($this->ws->conneg->getStatus() == 200) 22 | { 23 | $subjectUri = $this->ws->revuri; 24 | 25 | $revisionsDataset = rtrim($this->ws->dataset, '/').'/revisions/'; 26 | 27 | if($this->ws->memcached_enabled) 28 | { 29 | $key = $this->ws->generateCacheKey('revision-read', array( 30 | $subjectUri, 31 | $revisionsDataset 32 | )); 33 | 34 | if($return = $this->ws->memcached->get($key)) 35 | { 36 | $this->ws->setResultset($return); 37 | 38 | return; 39 | } 40 | } 41 | 42 | // Archiving suject triples 43 | $this->ws->sparql->query("select ?p ?o (DATATYPE(?o)) as ?otype (LANG(?o)) as ?olang 44 | from <" . $revisionsDataset . "> 45 | where 46 | { 47 | <".$this->ws->revuri."> ?p ?o. 48 | }"); 49 | 50 | if($this->ws->sparql->error()) 51 | { 52 | $this->ws->conneg->setStatus(500); 53 | $this->ws->conneg->setStatusMsg("Internal Error"); 54 | $this->ws->conneg->setStatusMsgExt($this->ws->errorMessenger->_303->name); 55 | $this->ws->conneg->setError($this->ws->errorMessenger->_303->id, $this->ws->errorMessenger->ws, 56 | $this->ws->errorMessenger->_303->name, $this->ws->errorMessenger->_303->description, 57 | $this->ws->sparql->errormsg(), $this->ws->errorMessenger->_303->level); 58 | } 59 | 60 | $subject = Array("type" => Array(), 61 | "prefLabel" => "", 62 | "altLabel" => Array(), 63 | "prefURL" => "", 64 | "description" => ""); 65 | 66 | $found = FALSE; 67 | while($this->ws->sparql->fetch_binding()) 68 | { 69 | $found = TRUE; 70 | 71 | $p = $this->ws->sparql->value('p'); 72 | $o = $this->ws->sparql->value('o'); 73 | $otype = $this->ws->sparql->value('otype'); 74 | $olang = $this->ws->sparql->value('olang'); 75 | 76 | if($this->ws->mode == 'record') 77 | { 78 | if($p == Namespaces::$wsf.'revisionUri') 79 | { 80 | $subjectUri = $o; 81 | } 82 | 83 | if($p == Namespaces::$wsf.'revisionUri' || 84 | $p == Namespaces::$wsf.'fromDataset' || 85 | $p == Namespaces::$wsf.'revisionTime' || 86 | $p == Namespaces::$wsf.'performer' || 87 | $p == Namespaces::$wsf.'revisionStatus') 88 | { 89 | continue; 90 | } 91 | } 92 | 93 | if(!$olang) 94 | { 95 | $olang = ''; 96 | } 97 | elseif($olang != '') 98 | { 99 | /* If a language is defined for an object, we force its type to be xsd:string */ 100 | $otype = "http://www.w3.org/2001/XMLSchema#string"; 101 | } 102 | 103 | if($p == Namespaces::$rdf."type") 104 | { 105 | if($this->ws->mode == 'record' && $o == Namespaces::$wsf.'Revision') 106 | { 107 | continue; 108 | } 109 | 110 | if(array_search($o, $subject["type"]) === FALSE) 111 | { 112 | array_push($subject["type"], $o); 113 | } 114 | } 115 | else 116 | { 117 | if(!isset($subject[$p]) || !is_array($subject[$p])) 118 | { 119 | $subject[$p] = array(); 120 | } 121 | 122 | if(!empty($otype)) 123 | { 124 | array_push($subject[$p], Array("value" => $o, 125 | "lang" => $olang, 126 | "type" => ($otype == 'http://www.w3.org/2001/XMLSchema#string' ? '' :$otype))); 127 | } 128 | else 129 | { 130 | array_push($subject[$p], Array("uri" => $o, 131 | "type" => "")); 132 | } 133 | } 134 | } 135 | 136 | // Get reification triples 137 | $this->ws->sparql->query("select ?rei_p ?rei_o ?p ?o from <" . $revisionsDataset . "> 138 | where 139 | { 140 | ?statement <".$this->ws->revuri.">. 141 | ?statement ?rei_p. 142 | ?statement ?rei_o. 143 | ?statement ?p ?o. 144 | }"); 145 | 146 | if($this->ws->sparql->error()) 147 | { 148 | $this->ws->conneg->setStatus(500); 149 | $this->ws->conneg->setStatusMsg("Internal Error"); 150 | $this->ws->conneg->setStatusMsgExt($this->ws->errorMessenger->_304->name); 151 | $this->ws->conneg->setError($this->ws->errorMessenger->_304->id, $this->ws->errorMessenger->ws, 152 | $this->ws->errorMessenger->_304->name, $this->ws->errorMessenger->_304->description, 153 | $this->ws->sparql->errormsg(), $this->ws->errorMessenger->_304->level); 154 | } 155 | 156 | while($this->ws->sparql->fetch_binding()) 157 | { 158 | $rei_p = $this->ws->sparql->value('rei_p'); 159 | $rei_o = $this->ws->sparql->value('rei_o'); 160 | $p = $this->ws->sparql->value('p'); 161 | $o = $this->ws->sparql->value('o'); 162 | 163 | if($p != "http://www.w3.org/1999/02/22-rdf-syntax-ns#subject" && 164 | $p != "http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate" && 165 | $p != "http://www.w3.org/1999/02/22-rdf-syntax-ns#object" && 166 | $p != "http://www.w3.org/1999/02/22-rdf-syntax-ns#type") 167 | { 168 | foreach($subject[$rei_p] as $key => $value) 169 | { 170 | if((isset($value["uri"]) && $value["uri"] == $rei_o) || 171 | (isset($value["value"]) && $value["value"] == $rei_o)) 172 | { 173 | if(!isset($subject[$rei_p][$key]["reify"])) 174 | { 175 | $subject[$rei_p][$key]["reify"] = array(); 176 | } 177 | 178 | if(!isset($subject[$rei_p][$key]["reify"][$p])) 179 | { 180 | $subject[$rei_p][$key]["reify"][$p] = array(); 181 | } 182 | 183 | array_push($subject[$rei_p][$key]["reify"][$p], $o); 184 | } 185 | } 186 | } 187 | } 188 | 189 | if($found) 190 | { 191 | if(!isset($subject[Namespaces::$dcterms.'isPartOf'])) 192 | { 193 | $subject[Namespaces::$dcterms.'isPartOf'] = array(array("uri" => $this->ws->dataset, 194 | "type" => "")); 195 | } 196 | 197 | $this->ws->rset->setResultset(Array($this->ws->dataset => array($subjectUri => $subject))); 198 | 199 | if($this->ws->memcached_enabled) 200 | { 201 | $this->ws->memcached->set($key, $this->ws->rset, NULL, $this->ws->memcached_revision_read_expire); 202 | } 203 | } 204 | else 205 | { 206 | $this->ws->conneg->setStatus(400); 207 | $this->ws->conneg->setStatusMsg("Bad Request"); 208 | $this->ws->conneg->setStatusMsgExt($this->ws->errorMessenger->_306->name); 209 | $this->ws->conneg->setError($this->ws->errorMessenger->_306->id, $this->ws->errorMessenger->ws, 210 | $this->ws->errorMessenger->_306->name, $this->ws->errorMessenger->_306->description, 211 | $this->ws->sparql->errormsg(), $this->ws->errorMessenger->_306->level); 212 | } 213 | } 214 | } 215 | } 216 | ?> 217 | -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/revision/update/README.mediawiki: -------------------------------------------------------------------------------- 1 | == Endpoint Documentation == 2 | 3 | [http://techwiki.openstructs.org/index.php/Revision:_Update Revision: Update Web Service Endpoint Documentation] -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/revision/update/index.php: -------------------------------------------------------------------------------- 1 | ws_conneg((isset($_SERVER['HTTP_ACCEPT']) ? $_SERVER['HTTP_ACCEPT'] : ""), 66 | (isset($_SERVER['HTTP_ACCEPT_CHARSET']) ? $_SERVER['HTTP_ACCEPT_CHARSET'] : ""), 67 | (isset($_SERVER['HTTP_ACCEPT_ENCODING']) ? $_SERVER['HTTP_ACCEPT_ENCODING'] : ""), 68 | (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : "")); 69 | 70 | $ws_ru->process(); 71 | 72 | $ws_ru->ws_respond($ws_ru->ws_serialize()); 73 | 74 | //@} 75 | 76 | ?> -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/scones/README.mediawiki: -------------------------------------------------------------------------------- 1 | == Introduction == 2 | 3 | The scones (subject concepts or named entities) tagger is how you identify and then tag information in document and text content in accordance with the ontology or named entities common to your domain. 4 | 5 | == Installation == 6 | 7 | To install Scones, you have to install a few other softwares as well. Briefly, what you will need is: 8 | 9 | # A running Tomcat instance 10 | # Scones WAR file 11 | # An ontology to use for tagging purposes 12 | 13 | == Configuration == 14 | 15 | The goal is to have a running Scones application running in Tomcat. It needs to be properly configured such that it uses the ontology you want to use for tagging your documents. 16 | 17 | Here are the manuals to install and configure Scones: 18 | 19 | # Install the Scones WAR file: http://.... 20 | # Configure it such that it uses the desired ontology and NLP functions: http://... 21 | # Scones webservice endpoint documentation: http://techwiki.openstructs.org/index.php/Scones -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/scones/index.php: -------------------------------------------------------------------------------- 1 | ws_conneg((isset($_SERVER['HTTP_ACCEPT']) ? $_SERVER['HTTP_ACCEPT'] : ""), 71 | (isset($_SERVER['HTTP_ACCEPT_CHARSET']) ? $_SERVER['HTTP_ACCEPT_CHARSET'] : ""), 72 | (isset($_SERVER['HTTP_ACCEPT_ENCODING']) ? $_SERVER['HTTP_ACCEPT_ENCODING'] : ""), 73 | (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : "")); 74 | 75 | $ws_scones->process(); 76 | 77 | $ws_scones->ws_respond($ws_scones->ws_serialize()); 78 | 79 | //@} 80 | 81 | ?> -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/scones/interfaces/DefaultSourceInterface.php: -------------------------------------------------------------------------------- 1 | compatibleWith = "3.0"; 15 | } 16 | 17 | public function processInterface() 18 | { 19 | // Make sure there was no conneg error prior to this process call 20 | if($this->ws->conneg->getStatus() == 200) 21 | { 22 | $ch = curl_init(); 23 | 24 | $headers = array( "Content-Type: application/json" ); 25 | 26 | curl_setopt($ch, CURLOPT_HEADER, 0); 27 | curl_setopt($ch, CURLOPT_URL, trim($this->ws->scones_endpoint, '/') . '/tag/concept/' . $this->ws->type . ($this->ws->stemming ? '/stemming' : '')); 28 | curl_setopt($ch, CURLOPT_POST, 1); 29 | curl_setopt($ch, CURLOPT_POSTFIELDS, $this->ws->document); 30 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 31 | 32 | $data = curl_exec($ch); 33 | 34 | $httpStatusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); 35 | 36 | if(curl_errno($ch) || 37 | $httpStatusCode == 400 || 38 | $httpStatusCode !== 200) 39 | { 40 | $this->errorMessage = 'An unexpected behavior occured with the Scones taggers.'; 41 | $this->errorMessageDebug = htmlentities($data); 42 | return FALSE; 43 | } 44 | else 45 | { 46 | // $json = json_decode($data); 47 | 48 | $this->ws->annotatedDocument = $data; 49 | } 50 | } 51 | } 52 | } 53 | ?> 54 | -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/search/README.mediawiki: -------------------------------------------------------------------------------- 1 | == Endpoint Documentation == 2 | 3 | [http://techwiki.openstructs.org/index.php/Search Search Web Service Endpoint Documentation] 4 | -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/search/index.php: -------------------------------------------------------------------------------- 1 | ws_conneg((isset($_SERVER['HTTP_ACCEPT']) ? $_SERVER['HTTP_ACCEPT'] : ""), 268 | (isset($_SERVER['HTTP_ACCEPT_CHARSET']) ? $_SERVER['HTTP_ACCEPT_CHARSET'] : ""), 269 | (isset($_SERVER['HTTP_ACCEPT_ENCODING']) ? $_SERVER['HTTP_ACCEPT_ENCODING'] : ""), 270 | (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : "")); 271 | 272 | $ws_s->process(); 273 | 274 | $ws_s->ws_respond($ws_s->ws_serialize()); 275 | 276 | //@} 277 | 278 | ?> -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/sparql/README.mediawiki: -------------------------------------------------------------------------------- 1 | == Endpoint Documentation == 2 | 3 | [http://techwiki.openstructs.org/index.php/SPARQL SPARQL Web Service Endpoint Documentation] 4 | -------------------------------------------------------------------------------- /StructuredDynamics/osf/ws/sparql/index.php: -------------------------------------------------------------------------------- 1 | ws_conneg((isset($_SERVER['HTTP_ACCEPT']) ? $_SERVER['HTTP_ACCEPT'] : ""), 72 | (isset($_SERVER['HTTP_ACCEPT_CHARSET']) ? $_SERVER['HTTP_ACCEPT_CHARSET'] : ""), 73 | (isset($_SERVER['HTTP_ACCEPT_ENCODING']) ? $_SERVER['HTTP_ACCEPT_ENCODING'] : ""), 74 | (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : "")); 75 | 76 | $ws_sparql->process(); 77 | 78 | $ws_sparql->ws_respond($ws_sparql->ws_serialize()); 79 | 80 | //@} 81 | 82 | ?> --------------------------------------------------------------------------------