RDF in Semantic Mediawiki: Difference between revisions
No edit summary |
|||
Line 55: | Line 55: | ||
==Classes== | ==Classes== | ||
Create category pages for the properties containing the '''Datatype Category''' | As it is visible in [[MediaWiki:Smw_import_foaf]] the properties [[Property:Foaf:person]] and [[Property:Foaf:organization]] have both '''Category as their type''', which is not a [https://www.semantic-mediawiki.org/wiki/Help:List_of_datatypes SMW data types]. | ||
The reason they have Category as data types is because ''' SMW uses category to define properties which in the Semantic Web ontogies are considered classes. | |||
''' | |||
?? In SMW a class is page It is a thing. | |||
?? Create category pages for the properties containing the '''Datatype Category''' | |||
<blockquote> | |||
An RDF class is defined as the set of its instances. Consider the class of abstract ideas. Members – instances – of that set include love, honour, duty, pi, evolution, etc. This view of a class is a mathematical concept, so the set of abstract ideas is both an idea and quite abstract, so therefore is itself an instance, or member, of the class abstract ideas. More prosaically, if a class is a set of things, then RDFS classes both denote sets of things, and are themselves instances of the set of all classes, aka rdfs:Class.<ref>https://stackoverflow.com/questions/6472043/instances-vs-classes-in-rdfs</ref> | |||
</blockquote> | |||
Containing the Property::value pair | Containing the Property::value pair | ||
Line 65: | Line 77: | ||
==Classes in RDF and SMW== | ==Classes in RDF and SMW== | ||
Revision as of 14:22, 30 April 2020
Notes on importing ontologies to SMW
How to importing ontology?
The documentation on importing existing ontologies to SMW in its Manual Section Help:Import_vocabulary
MediaWiki:Smw_import
To import existing Semantic Web ontologies SMW uses the MediaWiki:Smw_import_ONTOGOLOGYNAME pages, such as MediaWiki:Smw_import_foaf for the Friend Of A Friend ontology.
SMW manual mentions the following ontologies, some of which are already present in SMW instances, others need to be create from the examples provided by the SMW manual:
- foaf Friend Of A Friend Smw_import_foaf example
- rdfs RDF Schema Smw_import_rdfs example
- owl Web Ontology Language (OWL) Smw_import_owl example
- SKOS Simple Knowledge Organization System (SKOS) Smw_import_skos example
- dc Dublin Core Metadata Smw_import_dc example
- dcterms DCMI Metadata Terms Smw_import_dcterms example
- bibo Bibliographic Ontology Smw_import_bibo example
- frbr Functional Requirements for Bibliographic Records Smw_import_frbr example
I will be adding and making use of in this wiki of the foaf ontology.
Property pages
Each one of the properties listed in the MediaWiki:Smw_import_XYZ page has to be created with the following template
* [[Imported from::ONTOLOGYNAME:PROPERTY]] * [[Has property description::DESCRIPTION OF PROPERTY.@langcode]] [[Category:Imported vocabulary]]{{DISPLAYTITLE:ONTOLOGYNAME:PROPERTY}}
As for instance the Property:foaf:name:
* [[Imported from::foaf:name]] * [[Has property description::A name for some thing or agent.@en]] [[Category:Imported vocabulary]]{{DISPLAYTITLE:foaf:name}}
Note in that Property page that the Property Type is not declared on this page, but its assignment is done at the ontology import page
Because it can be quite tedious to create all those Property pages manually we can resort to scripts which create wiki pages, by interaction with the Mediawiki API [1]
After the Properties have been created ensure to run MW's scripts:
maintenance/runJobs.php
to run pending jpbsmaintenance/update.php
since we made change to Property types
The created Properties should be visible in Special:Properties
Classes
As it is visible in MediaWiki:Smw_import_foaf the properties Property:Foaf:person and Property:Foaf:organization have both Category as their type, which is not a SMW data types.
The reason they have Category as data types is because SMW uses category to define properties which in the Semantic Web ontogies are considered classes.
?? In SMW a class is page It is a thing.
?? Create category pages for the properties containing the Datatype Category
An RDF class is defined as the set of its instances. Consider the class of abstract ideas. Members – instances – of that set include love, honour, duty, pi, evolution, etc. This view of a class is a mathematical concept, so the set of abstract ideas is both an idea and quite abstract, so therefore is itself an instance, or member, of the class abstract ideas. More prosaically, if a class is a set of things, then RDFS classes both denote sets of things, and are themselves instances of the set of all classes, aka rdfs:Class.[2]
Containing the Property::value pair
[[Imported from::foaf:Person]]
Desambiguation
Classes in RDF and SMW
- ↑ See some Python the scripts for this at https://gitlab.com/Castro0o/wikitools
- ↑ https://stackoverflow.com/questions/6472043/instances-vs-classes-in-rdfs