Data Schema, Context, Ontology
As explained in the previous chapter about the Semantic Web and Ontologies, NextGraph is based on RDF, and OWL is used to defined Ontologies, which are equivalent to a Schema definitions.
Every document can list a set of prefixes and associated ontology that the Document is using.
This is done with the context
branch internally and is accessible from the Document Menu, under Tools, then Schema. (not implemented for now).
The schema is defined at the Document level, not at the branch or block level.
It can be updated at any time, and prefixes can be removed too, that will not affect the predicates that are using them, as all predicates are encoded and saved with their full URI anyway.
The context is useful for SPARQL Queries and for JSON-LD format.
JSON-LD is not available yet but will be included in an upcoming release.
By default, NextGraph always defines the prefix ng
that is reserved for special predicates that all Documents in NextGraph can or must have.
The list is detailed below. This prefix cannot be overridden.
In this ng
ontology, we also define the primary classes of all the types of documents that are officially supported in our Apps.
We can also expose, on request, some common prefixes that are listed a bit below.
And in general we strive to map our official primary classes with existing ontologies for backward compatibility. You are encouraged too to reuse existing ontologies, directly in your prefixes, or by inheriting from them in your own ontology definitions.
We will also keep a repository of well-known ontologies of specific interest.
A new ontology can be defined by creating a new Document of type Data / Ontology (not available yet)
ng ontology
There is a special prefix ng:
for the NextGraph ontology (not to be confused with the did:ng
method of the Nuri). This prefix is available in all RDF documents and cannot be overridden by other prefixes/context.
It has a list of predicates that help manage the Documents. It is also a way for us to offer a metadata API on each document, that can be queries with SPARQL. This API automatically generates some virtual triples about the document. Letβs have a look more in details about them.
predicate | R/W | type | label | comment | equivalent |
---|---|---|---|---|---|
ng:a | RW | string | about | short description | rdfs:comment as:summary og:description |
ng:b | R | string | weblink | link at nextgraph.one | |
ng:c | R | rdfs:Class | class | primary class | rdf:type |
ng:e | RW | rdfs:Resource | extlink | http external link | og:url as:url |
ng:f | R | Nuri | file | a linked binary file | |
ng:g | R | Nuri | nuri | nuri of self | |
ng:h | R | Nuri | follower | branch containing followers | as:followers |
ng:i | R | Nuri | inbox | inbox of repo ng:p | as:inbox |
ng:j | RW | Nuri | image | default image | as:image og:image vcard:photo foaf:img |
ng:k | RW | keyword | keyword | list of related to | |
ng:l | RW | langString | lang | language BCP47 | og:locale rdf:language |
ng:m | R | Nuri | comment | comment branch | |
ng:n | RW | string | title | title or name | rdfs:label as:name og:title foaf:name |
ng:o | R | Nuri | viewer | list of viewers | |
ng:p | R | TBD | permission | list of permissions | |
ng:q | R | Nuri | qrcode | image of QR-code containing ng:b | |
ng:r | R | Nuri | store | store header branch | |
ng:s | R | Nuri | stream | stream branch of store | |
ng:t | RW | dateTime | time | date and time | |
ng:u | RW | Nuri | icon | favicon image | as:icon |
ng:v | R | Nuri | backlinks | backlinks branch | |
ng:w | R | Nuri | editor | list of editors | |
ng:x | R | Nuri | context | context branch for JSON-LD and prefixes | |
ng:y | R | Nuri | following | branch containing following | as:following |
ng:z | R | Nuri | service | list of services | |
ng:loc | RW | TBD | location | location (country, geoname, coordinate) |
Nuri
is a subClass of rdfs:Resource
Apart from ng:f
, ng:g
, ng:p
and ng:q
, all the other predicates sit in the Header
branch.
ng:c
also sits in every block branch.
official primary classes
see Features for a list of all official primary classes
common prefixes
domain-specific Ontologies
TBD
You can have a look at Awesome ontology and LOV Linked Open Vocabularies in the meanwhile