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.

predicateR/Wtypelabelcommentequivalent
ng:aRWstringaboutshort descriptionrdfs:comment
as:summary
og:description
ng:bRstringweblinklink at nextgraph.one
ng:cRrdfs:Classclassprimary classrdf:type
ng:eRWrdfs:Resourceextlinkhttp external linkog:url
as:url
ng:fRNurifilea linked binary file
ng:gRNurinurinuri of self
ng:hRNurifollowerbranch containing followersas:followers
ng:iRNuriinboxinbox of repo ng:pas:inbox
ng:jRWNuriimagedefault imageas:image
og:image
vcard:photo
foaf:img
ng:kRWkeywordkeywordlist of related to
ng:lRWlangStringlanglanguage BCP47og:locale
rdf:language
ng:mRNuricommentcomment branch
ng:nRWstringtitletitle or namerdfs:label
as:name
og:title
foaf:name
ng:oRNuriviewerlist of viewers
ng:pRTBDpermissionlist of permissions
ng:qRNuriqrcodeimage of QR-code
containing ng:b
ng:rRNuristorestore header branch
ng:sRNuristreamstream branch of store
ng:tRWdateTimetimedate and time
ng:uRWNuriiconfavicon imageas:icon
ng:vRNuribacklinksbacklinks branch
ng:wRNurieditorlist of editors
ng:xRNuricontextcontext branch for
JSON-LD and prefixes
ng:yRNurifollowingbranch containing followingas:following
ng:zRNuriservicelist of services
ng:locRWTBDlocationlocation (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

prefixresolves to
rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#
rdfs:http://www.w3.org/2000/01/rdf-schema#
xsd:http://www.w3.org/2001/XMLSchema#
owl:http://www.w3.org/2002/07/owl#
sh:http://www.w3.org/ns/shacl#
shex:http://www.w3.org/ns/shex#
skos:http://www.w3.org/2004/02/skos/core#
schema:https://schema.org/
foaf:http://xmlns.com/foaf/0.1/
relationship:http://purl.org/vocab/relationship/
dcterms:http://purl.org/dc/terms/
dcmitype:http://purl.org/dc/dcmitype/
as:https://www.w3.org/ns/activitystreams#
ldp:http://www.w3.org/ns/ldp#
vcard:http://www.w3.org/2006/vcard/ns#
og:http://ogp.me/ns#
cc:http://creativecommons.org/ns#
sec:https://w3id.org/security#
wgs:http://www.w3.org/2003/01/geo/wgs84_pos#
gn:https://www.geonames.org/ontology#
geo:http://www.opengis.net/ont/geosparql#
time:http://www.w3.org/2006/time#

domain-specific Ontologies

TBD

You can have a look at Awesome ontology and LOV Linked Open Vocabularies in the meanwhile