Extension:SMW Ontologies

The SMW Ontologies extension enhances Semantic MediaWiki and Semantic Forms for localization, filtered inverse relations and query variables plus integration with the Visual Editor. Includes a number of ontologies defined using Semantic MediaWiki's markup. It includes:


 * (a-1) an "SMW Ontology" with concept/property definitions central to MediaWiki & SemanticMediaWiki
 * (a-2) definitions of commonly known ontologies from the ISO; W3C; United Nations; and others
 * (a-3) definitions of a comprehensive 'grammatical' ontology quite intuitive for general semantic relations markup


 * (b-1) syntax options for multilingual annotations and multilingual queries, involving new defined datatypes (I18N and IRI)
 * (b-2) syntax options for "query variables" and for "filtered inverse relations"


 * (c-1) Visual Editor input widgets and parser functions that convert Turtle-style expressions to semantic triples
 * (c-2) Visual Editor output templates and parser functions which display property values either retrieved or derived by calculation

Installation

 * Step 1: Download source material to extensions/SMWOntologies
 * Add this to your LocalSettings.php configuration file:


 * Step 2: Patch the SemanticMediaWiki and SemanticForms extensions.
 * Step 3: Load pre-built Concept, Property, Category and MediaWiki pages to your wiki.

Configuration
Add this to your LocalSettings.php configuration file: where
 * $nsType: gives the canonical text name for the 'Type' namespace (default: 'Datatype')
 * ''can use i18n format, eg 'Datatype@en Tipo de Datos@es'
 * $lcProperty: enables lower-case pagenames in the Property namespace (default: true)
 * $lcConcept: enables lower-case pagenames in the Concept namespace (default: true)
 * $ontologies: an array of ontologies to use (default: SMWOntologies::$known_ontologies)
 * below shows initializing, removing, replacing, and adding ontologies to the system

include "$IP/extensions/SMWOntologies/SMWOntologies.php"; include "$IP/extensions/MyOntology/MyOntology.php"; include "$IP/extensions/MyRDFOntology/MyRDFOntology.php"; $myontologies = SMWOntologies::$known_ontologies; unset( $myontologies['halo'] ); $myontologies['rdf'] = 'myRDF'; $myontologies['myns'] = 'myontologyclassname'; SMWOntologies::enable( $myontologies );

SMW Datatype definitions

 * Datatype:I18N (talk) : manages a single language-annotated text blob. The default, or the requested, language is parsed from the blob whenever necessary.


 * Datatype:IRI (talk) : manages an internationalized resource identifier similar to SMW's Datatype:URI.

SMW Parser functions

 * #smw:easyrdf (talk) : an implementation of the EasyRdf library for reading W3C Turtle notations from which SMW triples are created. This parser function creates a topic map structure of subobjects, each a self-contained "node graph" referenced by a page's "has:this" property.


 * #ask (talk)
 * handles new parameters for (a) localization specifications; (b) filtered inverse relations; (c) query variables.


 * #set (talk)
 * handles new parameters for (a) localization specifications.


 * #show (talk)
 * handles new parameters for (a) localization specifications.


 * Instance retrieval functions
 * handles retrieval (or calculation) of property and concept instances for a given namespace. For example, the   parser function retrieves concepts & properties defined for that ontology, and the    parser function retrieves concepts & properties defined for the RDF Ontology.

SMW Ontology pages
The following ontologies can be loaded into a wiki; loaded namespaces are listed on the wiki's Special:version page.

SMW Maintenance scripts

 * /initPages.php (talk) : a PHP script that loads pages into the Category, Concept, Property & MediaWiki namespaces.


 * /easyrdf.php (talk) : a PHP script that creates multiple pages in a wiki from a Turtle-formatted stream.


 * /patchSMW.php (talk) : a PHP script that patches the SemanticMediaWiki extension.


 * /patchSF.php (talk) : a PHP script that patches the SemanticForms extension.