Skip to content

Commit

Permalink
Add shapetree
Browse files Browse the repository at this point in the history
  • Loading branch information
matthieubosquet committed Oct 12, 2020
1 parent f127f4f commit 7435d14
Show file tree
Hide file tree
Showing 3 changed files with 336 additions and 1 deletion.
1 change: 1 addition & 0 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const LDP: NodeJS.ReadableStream = createReadStream(joinPath(__dirname, `
export const POSIXSTAT: NodeJS.ReadableStream = createReadStream(joinPath(__dirname, `posix_stat.ttl`));
export const SCHEMA: NodeJS.ReadableStream = createReadStream(joinPath(__dirname, `schema.ttl`));
export const SHACL: NodeJS.ReadableStream = createReadStream(joinPath(__dirname, `shacl.ttl`));
export const SHAPETREE: NodeJS.ReadableStream = createReadStream(joinPath(__dirname, `shapetree.ttl`));
export const SKOS: NodeJS.ReadableStream = createReadStream(joinPath(__dirname, `skos.ttl`));
export const SKOSXL: NodeJS.ReadableStream = createReadStream(joinPath(__dirname, `skos-xl.ttl`));
export const SOLIDTERMS: NodeJS.ReadableStream = createReadStream(joinPath(__dirname, `solid_terms.ttl`));
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ontl",
"version": "0.1.5",
"version": "0.1.6",
"description": "A collection of ontologies serialised in turtle, readable as stream.",
"main": "index.js",
"scripts": {
Expand Down
334 changes: 334 additions & 0 deletions shapetree.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,334 @@
# See details within this document for linkage to specification and purpose.
# This ontology file is a non-normative supporting document.

# Shape tree ontology

## Ontology preferred namespace prefix and URI
prefix shapetree: <http://www.w3.org/ns/shapetree#>

## Other namespaces used
### Core W3C ontologies (OWL 2 reserved vocabulary)
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix owl: <http://www.w3.org/2002/07/owl#>
prefix xsd: <http://www.w3.org/2001/XMLSchema#>
### Other ontologies
prefix dcterms: <http://purl.org/dc/terms/>
prefix vann: <http://purl.org/vocab/vann/>

## Ontology
<http://www.w3.org/ns/shapetree>
a owl:Ontology ;
rdfs:label "Shape tree ontology"@en ;
rdfs:isDefinedBy <http://www.w3.org/ns/shapetree> ;
rdfs:seeAlso
<https://shapetrees.github.io/specification/primer> ;
dcterms:issued "2020-07-01"^^xsd:date ;
dcterms:modified "2020-07-06"^^xsd:date ;
vann:preferredNamespacePrefix "shapetree" ;
vann:preferredNamespaceUri "http://www.w3.org/ns/shapetree#"^^xsd:anyURI .


# ShapeTree Class
#############################################################################
# Defines a tree of related resources which combine to enable some task
# see: https://shapetrees.github.io/specification/primer
#############################################################################
shapetree:ShapeTree
a rdfs:Class ;
rdfs:comment "Defines a composite data structure including a tree of resources and validation criteria"@en ;
rdfs:isDefinedBy <http://www.w3.org/ns/shapetree> ;
rdfs:label "Shape Tree"@en .

#
# Properties in domain of ShapeTree
#
shapetree:expectsType
a owl:ObjectProperty ;
rdfs:domain :ShapeTree ;
rdfs:range [ owl:oneOf ( :ShapeTreeContainer :ShapeTreeResource ) ] ;
rdfs:comment "Describes the expected type of resource the ShapeTree will validate against."@en ;
rdfs:isDefinedBy <http://www.w3.org/ns/shapetree> ;
rdfs:label "Expects Type"@en .

shapetree:contains
a owl:ObjectProperty ;
rdfs:domain :ShapeTree ;
rdfs:range :ShapeTree ;
rdfs:comment "Links a ShapeTree to another ShapeTree that is directly contained within its planted ShapeTreeContainer"@en ;
rdfs:isDefinedBy <http://www.w3.org/ns/shapetree> ;
rdfs:label "Contains"@en .

shapetree:references
a owl:ObjectProperty ;
rdfs:domain :ShapeTree ;
rdfs:range :ShapeTreeReference ;
rdfs:isDefinedBy <http://www.w3.org/ns/shapetree> ;
rdfs:comment "Links a ShapeTree to a ShapeTreeReference"@en ;
rdfs:label "References"@en .

shapetree:matchesUriTemplate
a owl:DatatypeProperty ;
rdfs:domain :ShapeTree ;
rdfs:range xsd:string ;
rdfs:comment "Describes a URI Template (RFC 6570) that governs the naming of resources of this Shape Tree"@en ;
rdfs:isDefinedBy <http://www.w3.org/ns/shapetree> ;
rdfs:label "Matches URI Template"@en .

shapetree:validatedBy
a owl:ObjectProperty ;
rdfs:domain :ShapeTree ;
rdfs:comment "Links a ShapeTree to a Shape"@en ;
rdfs:isDefinedBy <http://www.w3.org/ns/shapetree> ;
rdfs:label "Validated By"@en .

shapetree:supports
a owl:ObjectProperty ;
rdfs:domain :ShapeTree ;
rdfs:range :ShapeTree ;
rdfs:comment "Describes a relationship wherein a ShapeTree acts as a support for another, for purposes of indexing, aggregation, etc." ;
rdfs:isDefinedBy <http://www.w3.org/ns/shapetree> ;
rdfs:label "Supports"@en .

#
# Specific IRIs used by :contains predicate to define behavior
# when a matching ShapeTree with a URI Template is not found.
# These values can be combined, for example,
# :contains :AllowResources :AllowContainers :AllowNonRDFSources is equivalent to :AllowAll
# Example -- <#containerShapeTree> st:contains <#childShapeTree>, st:AllowResources
#
shapetree:AllowResources
a :ShapeTree ;
rdfs:comment "If no matching :contains ShapeTree is found, allow if the requested content is a :ShapeTreeResource"@en ;
rdfs:isDefinedBy <http://www.w3.org/ns/shapetree> ;
rdfs:label "Allow Resources"@en .

shapetree:AllowContainers
a :ShapeTree ;
rdfs:comment "If no matching :contains ShapeTree is found, allow if the requested content is a :ShapeTreeContainer"@en ;
rdfs:isDefinedBy <http://www.w3.org/ns/shapetree> ;
rdfs:label "Allow Containers"@en .

shapetree:AllowNonRDFSources
a :ShapeTree ;
rdfs:comment "If no matching :contains ShapeTree is found, only allow if the requested content is a :ShapeTreeNonRDFResource"@en ;
rdfs:isDefinedBy <http://www.w3.org/ns/shapetree> ;
rdfs:label "Allow NonRDFSources"@en .

shapetree:AllowAll
a :ShapeTree ;
rdfs:comment "If no matching :contains ShapeTree is found, allow all types of unexpected content"@en ;
rdfs:isDefinedBy <http://www.w3.org/ns/shapetree> ;
rdfs:label "Allow All"@en .

shapetree:AllowNone
a :ShapeTree ;
rdfs:comment "If no matching :contains ShapeTree is found, do not allow any content"@en ;
rdfs:isDefinedBy <http://www.w3.org/ns/shapetree> ;
rdfs:label "Allow None"@en .

# ShapeTreeContainer IRI (maps to ldp:Container)
#############################################################################
# An IRI that represents a generalized container used in a ShapeTree
#############################################################################
shapetree:ShapeTreeContainer
rdfs:comment "Describes a generalized container within a ShapeTree ecosystem"@en ;
rdfs:isDefinedBy <http://www.w3.org/ns/shapetree> ;
rdfs:label "ShapeTreeContainer"@en .


# ShapeTreeResource IRI (maps to ldp:Resource)
#############################################################################
# An IRI that represents a generalized resource used in a ShapeTree
#############################################################################
shapetree:ShapeTreeResource
rdfs:comment "Describes a generalized RDF resource (non-container) within a ShapeTree ecosystem"@en ;
rdfs:isDefinedBy <http://www.w3.org/ns/shapetree> ;
rdfs:label "ShapeTreeResource"@en .

# ShapeTreeNonRDFResource IRI (maps to ldp:NonRDFSource)
#############################################################################
# An IRI that represents a generalized resource used in a ShapeTree
#############################################################################
shapetree:ShapeTreeNonRDFResource
rdfs:comment "Describes a generalized non RDF / binary content within a ShapeTree ecosystem"@en ;
rdfs:isDefinedBy <http://www.w3.org/ns/shapetree> ;
rdfs:label "ShapeTreeResource"@en .


# ShapeTreeReference class
#############################################################################
# A ShapeTreeReference provides the necessary context to associate instance
# data between related ShapeTrees via a ShapePath
#############################################################################
shapetree:ShapeTreeReference
a rdfs:Class ;
rdfs:comment "Describes how a ShapeTree references another ShapeTree via a ShapePath"@en ;
rdfs:isDefinedBy <http://www.w3.org/ns/shapetree> ;
rdfs:label "ShapeTreeReference"@en .

#
# Properties in domain of ShapeTreeReference
#
shapetree:traverseViaShapePath
a owl:DatatypeProperty ;
rdfs:domain :ShapeTreeReference ;
rdfs:range xsd:string ;
rdfs:comment "Describes how one ShapeTree traverses its instance data to reach another ShapeTree"@en ;
rdfs:isDefinedBy <http://www.w3.org/ns/shapetree> ;
rdfs:label "Traverse Via ShapePath"@en .


#
# Properties in range of ShapeTreeDecoratorIndex
#
shapetree:hasShapeTreeDecoratorIndex
a owl:ObjectProperty ;
rdfs:range :ShapeTreeDecoratorIndex ;
rdfs:isDefinedBy <http://www.w3.org/ns/shapetree> ;
rdfs:label "Has ShapeTree Decorator Index"@en .

# ShapeTreeDecoratorIndex class
#############################################################################
# A ShapeTreeDecoratorIndex details a ShapeTree in a human-readable way.
# It is primarily used for use cases where a ShapeTree must be described to
# a user for purposes of authorization.
#############################################################################
shapetree:ShapeTreeDecoratorIndex
a rdfs:Class ;
rdfs:comment "Provides an index of SKOS poly-hierarchies which can be used to describe a ShapeTree"@en ;
rdfs:isDefinedBy <http://www.w3.org/ns/shapetree> ;
rdfs:label "ShapeTreeDecoratorIndex"@en .

# Properties in domain of ShapeTreeDecoratorIndex
#########################################################
shapetree:hasSeries
a owl:ObjectProperty ;
rdfs:domain :ShapeTreeDecoratorIndex ;
rdfs:range :ShapeTreeDecoratorSeries ;
rdfs:comment "Links between a ShapeTreeDecoratorIndex and a ShapeTreeDecoratorSeries"@en ;
rdfs:isDefinedBy <http://www.w3.org/ns/shapetree> ;
rdfs:label "Has Series"@en .

# ShapeTreeDecoratorSeries class
#############################################################################
# A ShapeTreeDecoratorSeries details a versioned set of ShapeTreeDecoratorHierarchy classes
# Primary use is grouping TreeDecoratorHierarchy instances by a common discriminator
# such as language or intended audience
#############################################################################
shapetree:ShapeTreeDecoratorSeries
a rdfs:Class ;
rdfs:comment "Groups a set of ShapeTreeDecoratorHierarchy by a given discriminator"@en ;
rdfs:isDefinedBy <http://www.w3.org/ns/shapetree> ;
rdfs:label "ShapeTreeDecoratorSeries"@en .

#
# Properties in domain of ShapeTreeDecoratorSeries
#
shapetree:hasHierarchy
a owl:ObjectProperty ;
rdfs:domain :ShapeTreeDecoratorSeries ;
rdfs:range :ShapeTreeDecoratorHierarchy ;
rdfs:comment "Links between a ShapeTreeDecoratorSeries and a ShapeTreeDecoratorHierarchy"@en ;
rdfs:isDefinedBy <http://www.w3.org/ns/shapetree> ;
rdfs:label "Has Hierarchy"@en .

# ShapeTreeDecoratorHierarchy class
#############################################################################
# A ShapeTreeDecoratorHierarchy details a versioned SKOS poly-hierarchy that describes
# a ShapeTree in a given language or format for an intended audience
# (decreased cognitivty ability, etc.)
#############################################################################
shapetree:ShapeTreeDecoratorHierarchy
a rdfs:Class ;
rdfs:comment "Describes a SKOS poly-hierarchy for purproses of labeling a ShapeTree"@en ;
rdfs:isDefinedBy <http://www.w3.org/ns/shapetree> ;
rdfs:label "ShapeTreeDecoratorHierarchy"@en .

# Properties in domain of ShapeTreeDecoratorHierarchy
#########################################################
shapetree:hasVersion
a owl:DatatypeProperty ;
rdfs:domain :ShapeTreeDecoratorHierarchy ;
rdfs:range xsd:string ;
rdfs:comment "Describes the version of a ShapeTreeDecoratorHierarchy"@en ;
rdfs:isDefinedBy <http://www.w3.org/ns/shapetree> ;
rdfs:label "Has Version"@en .

shapetree:hasSHA256Hash
a owl:DatatypeProperty ;
rdfs:domain :ShapeTreeDecoratorHierarchy ;
rdfs:range xsd:string ;
rdfs:comment "Describes the SHA-256 of a ShapeTreeDecoratorHierarchy"@en ;
rdfs:isDefinedBy <http://www.w3.org/ns/shapetree> ;
rdfs:label "Has SHA-256 Hash"@en .

shapetree:hasSkosGraph
a owl:ObjectProperty ;
rdfs:domain :ShapeTreeDecoratorHierarchy ;
rdfs:range :ShapeTreeLabel ;
rdfs:comment "Represents the IRI to the SKOS graph described by ShapeTreeDecoratorHierarchy instance"@en ;
rdfs:isDefinedBy <http://www.w3.org/ns/shapetree> ;
rdfs:label "Has SKOS Graph"@en .

# ShapeTreeLabel class
#############################################################################
# A ShapeTreeLabel details the association between a label within a SKOS graph
# (detailed by ShapeTreeDecoratorHierarchy) and a ShapeTree
#############################################################################
shapetree:ShapeTreeLabel
a rdfs:Class ;
rdfs:comment "Describes the association between a SKOS label and a ShapeTree"@en ;
rdfs:isDefinedBy <http://www.w3.org/ns/shapetree> ;
rdfs:label "ShapeTreeLabel"@en .


# Properties in the range of ShapeTreeLocator
#########################################################
shapetree:hasShapeTreeLocator
a owl:ObjectProperty ;
rdfs:range :ShapeTreeLocator ;
rdfs:comment "Represents the association between a subject an one or more ShapeTreeLocator"@en ;
rdfs:isDefinedBy <http://www.w3.org/ns/shapetree> ;
rdfs:label "Has ShapeTree Locator"@en .


# ShapeTreeLocator class
#############################################################################
# A ShapeTreeLocator describes a planted ShapeTree in a container with enough
# information to traverse from the current container to the root
#############################################################################
shapetree:ShapeTreeLocator
a rdfs:Class ;
rdfs:comment "Describes a planted ShapeTree in a container with enough information to traverse from the current container to the root"@en ;
rdfs:isDefinedBy <http://www.w3.org/ns/shapetree> ;
rdfs:label "ShapeTreeLocator"@en .

# Properties in domain of ShapeTreeLocator
#########################################################

shapetree:hasShapeTreeInstanceRoot
a owl:ObjectProperty ;
rdfs:domain :ShapeTreeLocator ;
rdfs:comment "Represents the IRI of a root of a planted ShapeTree hierarchy"@en ;
rdfs:isDefinedBy <http://www.w3.org/ns/shapetree> ;
rdfs:label "Has ShapeTree Instance Root"@en .

shapetree:hasRootShapeTree
a owl:ObjectProperty ;
rdfs:domain :ShapeTreeLocator ;
rdfs:range :ShapeTree ;
rdfs:comment "Represents the ShapeTree that is planted at the root of the ShapeTree hierarchy. For flat structures, hasRootShapeTree and hasShapeTree will be the same."@en ;
rdfs:isDefinedBy <http://www.w3.org/ns/shapetree> ;
rdfs:label "Has Root ShapeTree"@en .


################################################################
# A generalized predicate for linking a class to a ShapeTree
################################################################
shapetree:hasShapeTree
a owl:ObjectProperty ;
rdfs:range :ShapeTree ;
rdfs:comment "Represents the IRI of a ShapeTree that is referenced by some subject"@en ;
rdfs:isDefinedBy <http://www.w3.org/ns/shapetree> ;
rdfs:label "Has ShapeTree Instance Root"@en .

0 comments on commit 7435d14

Please sign in to comment.