Model

Ontologies

Ontologies are sets of domain concepts. The domain can span both documents (information resources) and abstract/physical things (non-information resources).

Ontologies can import other ontologies, both user-defined and system ones provided by LinkedDataHub. The imports are retrieved during application initialization, and the application's namespace ontology becomes a transitive union, i.e. is merged with its imports and imports of the imports etc.

Main ontology properties:

Imports
Ontology to be imported
Version
Unique version of this ontology

Classes

Classes are simply RDFS classes. Usually the application dataset contains class instances.

Main class properties such as constructor and constraint are explained in the sub-sections below. Additional properties are:

Constructor
Query that constructs new class instance
Constraints
Command or command template that validates class instance

Constructors

Constructors are SPARQL CONSTRUCT queries that serve as templates for class instances. They specify the properties (both mandatory and optional) that the instance is supposed to have, as well as expected datatypes of their values. Constructors are used in create/edit modes. A class can have multiple constructors.

For example, one of the constructors of the dh:Container and dh:Item classes:

PREFIX rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd:     <http://www.w3.org/2001/XMLSchema#>
PREFIX sioc:    <http://rdfs.org/sioc/ns#>
PREFIX dct:     <http://purl.org/dc/terms/>

CONSTRUCT {
  $this sioc:content "<div xmlns=\"http://www.w3.org/1999/xhtml\"></div>"^^rdf:XMLLiteral .
}
WHERE {}

An instance of these classes by default have a content property with XML literal.

LinkedDataHub reuses SPIN constructors for the implementation, but adds a special syntax convention using blank nodes to indicate the expected resource type ([ a ex:Person ]) or literal datatype ([ a xsd:string ]). The magic variable $this refers to the instance being constructed, it is a blank node resource initially but gets skolemized to a URI when submitted to the server.

Note that classes inherit constructors from superclasses in runtime. Subclasses do not have to redefine constructor properties already found in superclass constructors, only additional properties.

Constraints

Constraints are SPARQL queries or SPIN command templates that validate submitted RDF data during document creation and editing. Constraints are enforced for instances of model classes on which they are defined and are used to check class instances for violations (missing mandatory properties, malformed values etc.). For example, an instance of dh:Item without dct:title will fail validation because titles are mandatory for LinkedDataHub documents.

LinkedDataHub reuses SPIN constraints. Classes inherit constraints from superclasses.

SHACL constraint validation is supported as well.

Properties

LinkedDataHub allows definition of new properties.