Help:Import vocabulary
A complete introduction to import vocabulary into a Semantic MediaWiki system is given on Help:Import vocabulary. To import a vocabulary scheme the following steps need to be done:
- setup of SMW import page
- setup of concept scheme page
- add concept pages (definition, translation, documentation of a concept)
- complete the SMW setup by creating either the corresponding property page or class page depending on the concept type
┌ {{Concept scheme}} page with ─────────┐ │ preferred namespace prefix=ns │ │ relates to the import of SMW │ ────────────────────────────────── Semantic MediaWiki pages/settings ──────────────────────────── ┌─ {{Concept}} pages with detailed ──────┐ │ documentation, translation, │ ┌ MediaWiki:Smw_import_ns ───────────────────────────────────┐ │ scheme and collection membership etc. │ │http://name/space/uri/|[http://url/to/docu Docu display] │ comments|Type:Text → Property:ns:comments ns:comments │ metadataLanguage|Type:String → Property:ns:metadataLanguage ns:metadataLanguage │ providerManagedID|Type:String → Property:ns:providerManagedID ns:providerManagedID │ reviewer|Type:String → Property:ns:reviewer ns:reviewer │ reviewerComments|Type:Text → Property:ns:reviewerComments ns:reviewerComments │ SomeClass|Category → Class:ns:SomeClass ns:SomeClass │ … ↓ └────────────────────────────────────────────────────────────┘ (needs to set of property [[Imported from::ns:…]] to be exported by SMW’s RDF export correctly, done by template code)
Contents
Step 1: Set up the SMW Import Page
This first setup step, creating the import page in the MediaWiki namespace, is only possible for admin users. It only maps internal concepts to the external name space uri and enables SMW to resolve to externally defined vocabulary URIs (e.g. RDF export of local wiki pages). Semantic annontations and the SMW import page correspond as follows with ns being the locally defined namespace:
MediaWiki:Smw_import_ns maps imported concepts Assign on a property or class/category page the the external concept to a local property or class by: [[Imported from::ns:conceptTerm]] Use the property on a content page: [[ns:conceptTerm::some value]]
Normally templates code and forms should manage properties and their corresponding import properties, URIs etc. Then check if there is already an import page.
All import vocabulary pages …
If there is no SMW import page yet for the vocabulary/concept scheme import, create the SMW import page. Concepts of Biorelations for instance use the locally defined namespace “biorel“, e.g. biorel:adjacent to (see also MediaWiki:Smw import biorel).
(The namespace prefix ns is used by SWM to identify the import URI of concepts)
http://name/space/uri/|[http://url/to/documentation Display text for doc-URL] comments|Type:Text metadataLanguage|Type:String providerManagedID|Type:String reviewer|Type:String reviewerComments|Type:Text SomeClass|Category …
Step 2: Create Concept Scheme
Set the preferred namespace prefix from Step 1 for the concept scheme.
Technical note: Template: Concept scheme manages settings and data for a concept scheme.
Step 3: Add Concepts to the Wiki
Concepts in this Wiki have their own page (in article name space) for documentation, definition and translation. Those pages can be managed by the form below or on the concept page by clicking on tab “Edit with form”. If you create the page for the imported concept prefix it with ns (=locally defined name space) from above. Set also the “Scheme membership“ of a concept page in the form.
Technical note: Template: Concept manages settings and data for a concept.
Step 4 as final step can be done as well during editing a concept form: the item “Concept type” in the concept form provides a link to do step 4.
Step 4: Complete SWM Setup by Creating Corresponding Property Page/Class Page
For a concept to be used by SWM as property or class it is necessary to set up either a property or class/category page holding the information of [[Imported from::ns:conceptTerm]]
. These informations are managed by templates and the forms below will assist you to set up those pages. Remember: only basic information necessary to SWM should be on these pages, detailed documentation, definition and translation is managed by the concept form in step 3 (or use the tab “Edit with form” on a concept page).
Imported concept corresponds to a property? Then use the following form:
Imported concept corresponds to a class/category? Then use the following form:
Step 3 can also be done on a property page in the hidden box of “Editor tools”.