-
Notifications
You must be signed in to change notification settings - Fork 2
Display Ontology
The display ontology, called http://data.travellerrpg.com/ontology/argushiigi since it's specific to the Argushiigi application provides a framework for a program to lay out statements about a resource in a nice, human-readable form.
A display category provides a tree-like categorisation of items so that descriptive data goes together, as does metadata, etc. The parentCategory property allows categories to form into a hierarchy.
Two individuals are supplied. http://data.travellerrpg.com/ontology/argushiigi/top provides a top-level category for anything that doesn't fit anywhere else. All other categories should have parent categories that eventually lead to top. http://data.travellerrpg.com/ontology/argushiigi/name provides a naming category. All properties that are part of the name category will be searched in order to provide a human-readable name for a resource.
The displayCategory annotation can be added to properties, classes or individuals and indicate the display category where a statement with that property or object should be placed.
Display categories are inherited from super-properties and classes. The rules for inheritance are:
- If the resource has a specific display category, then that is the display category.
- If the resource is a property then super-properties are explored (breadth-first) looking for a category. The highest priority category is chosen in case of multiple categories on a single level.
- If the resource is a class the super-classes are explored breadth first, using the same rules are properties.
- If the resource has a class then the immediate classes are explored.
For example, if we have the property hierarchy with categories c1 < c2 < c3
P1(c1)
/ | \
P2(c2) P3(c3) P4
| / | / |
P5(c1) P6 P7
Then the final categories are P1(c1), P2(c2), P3(c3), P4(c1) inherited from P1, P5(c1), P6(c3) inherited from P3, P7(c1) inherited from P1.
The displayPriority annotation can be added to properties, classes or individuals to provide an order for sorting categorised elements. Inheritance works in the same was as displayCategory.
Intitially, there was a displayBefore relation that provided a partial order for sorting. Working out the semantics of transitive ordering and inheritance was just too hard.
The name category is used to identify properties that can be used to produce a human-readable name for a resource. Naming involves two loops:
- The outer loop looks for a suitable language-specific name. A locale can have a language specifier (eg. "fr") and a country specifier (eg. "ca"). Names are searched for from most-specific language to least specific language: language-country (eg. "fr-ca"), then language ("fr"), then another country-specific version of the language (eg. "fr-nc" would match) then no language (""), then any version of English ("en").
- The inner loop searches for language-specific properties that match the language. Any property in the name category is searched in priority order (eg. skos:prefLabel, dc:title, rdfs:label, skos:altlabel). If a statement about a resource with the property has another resource as its object, then the object is also searched.
A format allows you to format statements or resources according to some sort of pattern. Using formats allows you to display something like characteristic information as a simple piece of text.
Multiple formats are possible, linked by the nextFormat property. Formats are tried in turn until a successful format is found.
Gives the pattern to use when formatting a resource.
Gives the pattern to use when formatting the label of a statement (usually based on the predicate of the statement).
Gives the pattern to use when formatting the value of a statement (usually based on the object of the statement).
A format uses a chain of patterns to format a resource or statement. All patterns in the chain have to be satisfiable. Otherwise, the next pattern in the format is tried.
Links a pattern to the next pattern in the chain.
The resource being formatted must have the property. If the property is there, then the the object of the statement connecting the property to the resource is formatted.
An implementation-specific text format. Formats are generally tied to the programming language used.
A format in java.text.MessageFormat form. The arguments are: {0} the value to be formatted, {1} the predicate name from the statement, {2} the subject of the statement.
A literal value to format. If the implementationFormat is provided, the value is formatted according to that format. If the fromProperty is provided, then the literal replaces the value of the property (although the property must still be present).