Difference between revisions of "Template:Concept relation/doc"

From TDWG Terms Wiki
Jump to: navigation, search
m
m (Further import pages)
 
(31 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{{Documentation/subpage}}
 
{{Documentation/subpage}}
  
Template “{{lcfirst: {{#titleparts:{{PAGENAME}}|1}} }}” sets a {{abbr|SMW}}-subobject and [[template: concept]] queries these data to display them in a fact box.
+
Template “{{#titleparts:{{PAGENAME}}|1}}” sets relations which are further analysed/displayed in [[Template: Concept]]. Results appear in a floating fact box of a concept page (=a page having [[template: Concept]] on it).
 
+
TODO: [http://www.w3.org/TR/rdf-schema/#ch_range rdfs:range] do we need this? --[[User:Andreas Plank|Andreas Plank]] 17:30, 28 August 2012 (CEST)
+
NOTE: This template was named “concept relation” and not ”concept mapping” because, e.g. disjunct is ''not'' a mapping but a relation.
+
  
 
=== Usage ===
 
=== Usage ===
It should be called in the following format:
+
 
 +
On Concept pages (using Template/[[Form:Concept]]) the following The template call can be repeated any number of times:
 
{|
 
{|
 
|-
 
|-
Line 23: Line 21:
 
  | relation = …
 
  | relation = …
 
  | uri = …
 
  | uri = …
 +
}}
 +
</pre>
 +
|-
 +
|
 +
|
 +
|<pre>
 +
{{Concept relation
 +
| relation = …
 +
| uri = {{Concept to imported URI|Article namespace Wiki page of imported concept}}
 
  }}
 
  }}
 
</pre>
 
</pre>
 
|}
 
|}
  
Parameter “relation” can be one of:
+
Use [[Template: Concept to imported URI]] if you reuse an imported page and want to relate to the imported URI.
# [[property: obo_rel:adjacent_to|obo_rel: adjacent to]]
+
# [[property: obo_rel:contained_in|obo_rel: contained in]]
+
# [[property: obo_rel:derives_from|obo_rel: derives from]]
+
# [[property: obo_rel:has_agent|obo_rel: has agent]]
+
# [[property: obo_rel:integral_part_of|obo_rel: integral part of]]
+
# [[property: obo_rel:located_in|obo_rel: located in]]
+
# [[property: obo_rel:part_of|obo_rel: part of]]
+
# [[property: obo_rel:preceded_by|obo_rel: preceded by]]
+
# [[property: obo_rel:proper_part_of|obo_rel: proper part of]]
+
# [[property: obo_rel:transformation_of|obo_rel: transformation of]]
+
# [[property: skos:hasBoaderMatch|skos: has broader match]]
+
# [[property: skos:hasCloseMatch|skos: has close match]]
+
# [[property: skos:hasExactMatch|skos: has exact match]]
+
# [[property: skos:hasNarrowerMatch|skos: has narrower match]]
+
# [[property: skos:hasParticipant|skos: has participant]]
+
# [[property: skos:hasRelatedMatch|skos: has related match]]
+
# [[property: skos:isInMappingRelationWith|skos: is in mapping relation with]]
+
# [[property: rdfs:seeAlso|rdfs: see also]]
+
# [[property: rdfs:subclassOf|rdfs: subclass of]]
+
# [[property: rdfs:subPropertyOf|rdfs: subproperty of]]
+
  
 +
Parameter “relation” can be any of the strings displayed in column ''relation value'' (note that skos:inScheme is handled by [[template: Concept scheme relation]]):
 +
{{#ask: [[Property:+]] [[terms-internal:conceptRelationDisplayText::+]] | ?terms-internal:conceptRelationDisplayGroup=Group | ?terms-internal:conceptRelationDisplayText = relation value (=Display text) | ? = Property page | mainlabel=- | format=table | limit=500 |sort=terms-internal:conceptRelationDisplayGroup,terms-internal:conceptRelationDisplayText }}
 +
 +
Some relations are bound to categories to have auto-complete function available in forms:
 +
* skos: in scheme — autocomplete on class: Concept Scheme (title case) with [[Imported from::skos:ConceptScheme]]
 +
* skos: collection — autocomplete on class: Concept Collection (title case) with [[Imported from::vann:termGroup]] 
 +
*:(Note: vann:termGroup relates to the skos concept collection (label in picklist is "skos: collection"); skos has not property from concept to collection (only the inverse))
 +
*:(Note: we chose to present a pseudo-property "skos: collection" to the user)
 +
 +
Note: “rdfs: subclass of” and “rdfs: subproperty of” are no longer set to specific autocompletes, to avoid workflow complications (e.g. a skos concept may not yet have been defined as property or class)
  
 
=== Technical documentation ===
 
=== Technical documentation ===
 +
 +
==== Add a new relation ====
 +
 +
<ol>
 +
<li> add the following properties to a property page:<div class="no-pre-border"><pre>
 +
[[terms-internal:conceptRelationDisplayText::‹my display text›| ]]
 +
[[terms-internal:conceptRelationDisplayGroup::‹a number›| ]]<!-- the lower, the first it is displayed --></pre></div>
 +
</li>
 +
<li>add new display texts (''my display text'' from above) to [[Template:Concept relation/relation to property]].</li>
 +
</ol>
 +
 +
==== Related templates ====
 +
 
  {{#titleparts: {{PAGENAME}} | 1 | 1 }}
 
  {{#titleparts: {{PAGENAME}} | 1 | 1 }}
 
   ├ [[Template:Concept relation/return listelement from query]] return a list element to format an #ask-query with “format = template“ in an #ask-query  
 
   ├ [[Template:Concept relation/return listelement from query]] return a list element to format an #ask-query with “format = template“ in an #ask-query  
   ├ [[Template:Concept relation/relation to property]] (map relation-string from template input to correct property page)
+
   ├ [[Template:Concept relation/relation to property]] (map relation-string from template input to correct property page, add new relations here)
 
   └ [[Template:Concept relation/doc]]
 
   └ [[Template:Concept relation/doc]]
  
Dependency on http://www.mediawiki.org/wiki/Extension:Variables
+
For displaying relation data in the fact box of [[template: Concept]] the following templates are used:
 +
* [[Template: Concept/render relation as form link]] (for concept scheme, and concept collection)
 +
* [[Template: Concept/render relation as list item]] (for all other relations)
 +
 
 +
Those templates evaluate display- and sorting properties set on a property page that itself is used as a relation:
 +
* [[property: terms-internal:conceptRelationDisplayText]] (for display, e.g. further used in forms)
 +
* [[property: terms-internal:conceptRelationDisplayGroup]] (for sorting purposes, lowest value is the first one, highest the last)
 +
 
 +
==== Auto-generated list for Form Concept ====
 +
Auto-generated list of relation values for [[Form:Concept]] (field: relation):<br/>
 +
:{{#ask: [[Property:+]] [[terms-internal:conceptRelationDisplayText::+]] | ?terms-internal:conceptRelationDisplayText#= | mainlabel=- | format=list | limit=500 |sort=terms-internal:conceptRelationDisplayGroup,terms-internal:conceptRelationDisplayText }}
 +
 
 +
==== Dependencies ====
 +
* http://www.mediawiki.org/wiki/Extension:Variables
  
 
=== See also ===
 
=== See also ===
  
 +
* [[template: Concept scheme]]
 +
* [[template: Concept scheme relation]] (for [[property: skos:inScheme]])
 +
* [[Template: Concept/render relation as form link]] (for concept scheme, and concept collection)
 +
* [[Template: Concept/render relation as list item]] (for all other relations)
 +
 +
{{Hidden
 +
|1= '''Further import pages …'''
 +
|toggle position = left
 +
| toggle text = + / –
 +
| contentstyle = border-left: 1px solid #ccc;border-bottom: 1px solid #ccc;padding:0ex 1em;
 +
| content=Hint: Before terms can be imported as annotation properties they need to be declared by a special page in the MediaWiki namespace followed by the local prefix you wish to use: "MediaWiki:Smw_import_''local-namespace-prefix''". A list of all imported vocabulary schemes is:
 +
{{List all smw imports|output format=three-columns}}
 +
}}
 
<includeonly>
 
<includeonly>
 
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
 
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
* [[template: concept scheme]]
+
[[Category: Helper tool for ontologies]]
 
</includeonly>
 
</includeonly>

Latest revision as of 15:47, 3 February 2020

This is a documentation subpage for Template:Concept relation (see that page for the template itself).
It contains usage information, categories and other content that is not part of the original template page.

Template “Concept relation” sets relations which are further analysed/displayed in Template: Concept. Results appear in a floating fact box of a concept page (=a page having template: Concept on it).

Usage

On Concept pages (using Template/Form:Concept) the following The template call can be repeated any number of times:

 {{Concept relation 
 | relation = …
 | internal page = …
 }}
or relating
to an URI
 {{Concept relation 
 | relation = …
 | uri = …
 }}
 {{Concept relation 
 | relation = …
 | uri = {{Concept to imported URI|Article namespace Wiki page of imported concept}}
 }}

Use Template: Concept to imported URI if you reuse an imported page and want to relate to the imported URI.

Parameter “relation” can be any of the strings displayed in column relation value (note that skos:inScheme is handled by template: Concept scheme relation):

Grouprelation value (=Display text)Property page
1skos: collectionvann:termGroup
10dcterms: has partdcterms:hasPart
10dcterms: is part ofdcterms:isPartOf
10rdfs: see alsordfs:seeAlso
10rdfs: subclass ofrdfs:subClassOf
10rdfs: subproperty ofrdfs:subPropertyOf
10skos: has broader matchskos:broadMatch
10skos: has close matchskos:closeMatch
10skos: has exact matchskos:exactMatch
10skos: has narrower matchskos:narrowMatch
10skos: has related matchskos:relatedMatch
10skos: is in mapping relation withskos:mappingRelation
20owl: disjoint withowl:disjointWith
20owl: equivalent classowl:equivalentClass
20owl: equivalent propertyowl:equivalentProperty
20owl: inverse ofowl:inverseOf
30biorel: adjacent tobiorel:adjacent to
30biorel: aligned withbiorel:aligned with
30biorel: connected tobiorel:connected to
30biorel: derived by descent frombiorel:derived by descent from
30biorel: derives frombiorel:derives from
30biorel: develops frombiorel:develops from
30biorel: develops from part ofbiorel:develops from part of
30biorel: develops inbiorel:develops in
30biorel: develops intobiorel:develops into
30biorel: has habitatbiorel:has habitat
30biorel: has partbiorel:has part
30biorel: has participantbiorel:has participant
30biorel: has site ofbiorel:has site of
30biorel: is bearer ofbiorel:is bearer of
30biorel: is preceded bybiorel:is preceded by
30biorel: occurs inbiorel:occurs in
30biorel: overlapsbiorel:overlaps
30biorel: part ofbiorel:part of
30biorel: participates inbiorel:participates in
30biorel: precedesbiorel:precedes
30biorel: produced bybiorel:produced by
30biorel: producesbiorel:produces
30biorel: spatially disjoint frombiorel:spatially disjoint from
30biorel: surroundsbiorel:surrounds
30biorel: variant ofbiorel:variant of

Some relations are bound to categories to have auto-complete function available in forms:

Note: “rdfs: subclass of” and “rdfs: subproperty of” are no longer set to specific autocompletes, to avoid workflow complications (e.g. a skos concept may not yet have been defined as property or class)

Technical documentation

Add a new relation

  1. add the following properties to a property page:
    [[terms-internal:conceptRelationDisplayText::‹my display text›| ]]
    [[terms-internal:conceptRelationDisplayGroup::‹a number›| ]]<!-- the lower, the first it is displayed -->
  2. add new display texts (my display text from above) to Template:Concept relation/relation to property.

Related templates

Concept relation
 ├ Template:Concept relation/return listelement from query return a list element to format an #ask-query with “format = template“ in an #ask-query 
 ├ Template:Concept relation/relation to property (map relation-string from template input to correct property page, add new relations here)
 └ Template:Concept relation/doc

For displaying relation data in the fact box of template: Concept the following templates are used:

Those templates evaluate display- and sorting properties set on a property page that itself is used as a relation:

Auto-generated list for Form Concept

Auto-generated list of relation values for Form:Concept (field: relation):

skos: collection, dcterms: has part, dcterms: is part of, rdfs: see also, rdfs: subclass of, rdfs: subproperty of, skos: has broader match, skos: has close match, skos: has exact match, skos: has narrower match, skos: has related match, skos: is in mapping relation with, owl: disjoint with, owl: equivalent class, owl: equivalent property, owl: inverse of, biorel: adjacent to, biorel: aligned with, biorel: connected to, biorel: derived by descent from, biorel: derives from, biorel: develops from, biorel: develops from part of, biorel: develops in, biorel: develops into, biorel: has habitat, biorel: has part, biorel: has participant, biorel: has site of, biorel: is bearer of, biorel: is preceded by, biorel: occurs in, biorel: overlaps, biorel: part of, biorel: participates in, biorel: precedes, biorel: produced by, biorel: produces, biorel: spatially disjoint from, biorel: surrounds, biorel: variant of

Dependencies

See also

Further import pages …

Hint: Before terms can be imported as annotation properties they need to be declared by a special page in the MediaWiki namespace followed by the local prefix you wish to use: "MediaWiki:Smw_import_local-namespace-prefix". A list of all imported vocabulary schemes is: