# W3C SHACL User Interfaces (SHACL UI) Vocabulary

# THIS VERSION IS UNDER DEVELOPMENT BY THE DATA-SHAPES (SHACL 1.2) WG

@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix owl:     <http://www.w3.org/2002/07/owl#> .
@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sh:      <http://www.w3.org/ns/shacl#> .
@prefix shui:    <http://www.w3.org/ns/shacl-ui/> .
@prefix xsd:     <http://www.w3.org/2001/XMLSchema#> .

shui:
	a owl:Ontology ;
	owl:imports <http://www.w3.org/ns/shacl#> ;
	owl:versionIRI shui:1.2 ;
	rdfs:label "W3C SHACL User Interfaces (SHACL UI) Vocabulary"@en ;
	rdfs:comment "This vocabulary defines terms used in SHACL UI, the W3C specification for rendering SHACL shapes as user interfaces."@en ;
	dcterms:creator "W3C Data Shapes Working Group" ;
	dcterms:publisher "World Wide Web Consortium" ;
	# dcterms:created ""^^xsd:date ;
	# dcterms:issued ""^^xsd:date ;
	# dcterms:modified ""^^xsd:date ;
	dcterms:license "https://www.w3.org/copyright/software-license/"^^xsd:anyURI ;
	sh:declare [
		sh:prefix "shui" ;
		sh:namespace "http://www.w3.org/ns/shacl-ui/"^^xsd:anyURI ;
	] ;
.


# Widget vocabulary -----------------------------------------------------------

shui:Widget
	a rdfs:Class ;
	rdfs:label "Widget"@en ;
	rdfs:comment "The class of user interface components that present or edit the values of a property at a focus node."@en ;
	rdfs:subClassOf rdfs:Resource ;
	rdfs:isDefinedBy shui: ;
.

shui:Editor
	a rdfs:Class ;
	rdfs:label "Editor"@en ;
	rdfs:comment "The class of widgets that let a user change the values of a property at a focus node."@en ;
	rdfs:subClassOf shui:Widget ;
	rdfs:isDefinedBy shui: ;
.

shui:Viewer
	a rdfs:Class ;
	rdfs:label "Viewer"@en ;
	rdfs:comment "The class of widgets that display the values of a property at a focus node without editing them."@en ;
	rdfs:subClassOf shui:Widget ;
	rdfs:isDefinedBy shui: ;
.

shui:SingleEditor
	a rdfs:Class ;
	rdfs:label "Single editor"@en ;
	rdfs:comment "The class of editors that edit one value at a time, leaving the surrounding form to add and delete values."@en ;
	rdfs:subClassOf shui:Editor ;
	rdfs:isDefinedBy shui: ;
.

shui:MultiEditor
	a rdfs:Class ;
	rdfs:label "Multi editor"@en ;
	rdfs:comment "The class of editors that take control of all values of a property at a focus node, including adding and deleting them."@en ;
	rdfs:subClassOf shui:Editor ;
	rdfs:isDefinedBy shui: ;
.

shui:SingleViewer
	a rdfs:Class ;
	rdfs:label "Single viewer"@en ;
	rdfs:comment "The class of viewers that render one value at a time, typically as a single widget."@en ;
	rdfs:subClassOf shui:Viewer ;
	rdfs:isDefinedBy shui: ;
.

shui:MultiViewer
	a rdfs:Class ;
	rdfs:label "Multi viewer"@en ;
	rdfs:comment "The class of viewers that render all values of a property at a focus node together, for example as a table."@en ;
	rdfs:subClassOf shui:Viewer ;
	rdfs:isDefinedBy shui: ;
.

shui:editor
	a rdf:Property ;
	rdfs:label "editor"@en ;
	rdfs:comment "Links a shape to the editor that is preferred for editing the values of that shape."@en ;
	rdfs:domain sh:Shape ;
	rdfs:range shui:Editor ;
	rdfs:isDefinedBy shui: ;
.

shui:viewer
	a rdf:Property ;
	rdfs:label "viewer"@en ;
	rdfs:comment "Links a shape to the viewer that is preferred for displaying the values of that shape."@en ;
	rdfs:domain sh:Shape ;
	rdfs:range shui:Viewer ;
	rdfs:isDefinedBy shui: ;
.


# Scoring vocabulary ----------------------------------------------------------

shui:WidgetMatcher
	a rdfs:Class ;
	rdfs:label "Widget matcher"@en ;
	rdfs:comment "The class of resources that associate a widget with the conditions under which it applies, expressed as shapes for the shapes graph and the data graph."@en ;
	rdfs:subClassOf rdfs:Resource ;
	rdfs:isDefinedBy shui: ;
.

shui:WidgetScore
	a rdfs:Class ;
	rdfs:label "Widget score"@en ;
	rdfs:comment "The class of widget matchers that record a score for their widget when their shapes match. Widgets are ordered by descending score."@en ;
	rdfs:subClassOf shui:WidgetMatcher ;
	rdfs:isDefinedBy shui: ;
.

shui:WidgetAcceptMatcher
	a rdfs:Class ;
	rdfs:label "Widget accept matcher"@en ;
	rdfs:comment "The class of widget matchers that decide whether a widget is applicable at all. A widget without an accept matcher is accepted unconditionally."@en ;
	rdfs:subClassOf shui:WidgetMatcher ;
	rdfs:isDefinedBy shui: ;
.

shui:widget
	a rdf:Property ;
	rdfs:label "widget"@en ;
	rdfs:comment "Links a widget matcher to the widget it applies to."@en ;
	rdfs:domain shui:WidgetMatcher ;
	rdfs:range shui:Widget ;
	rdfs:isDefinedBy shui: ;
.

shui:score
	a rdf:Property ;
	rdfs:label "score"@en ;
	rdfs:comment "The score recorded for the widget of a widget score when its shapes match. A higher score indicates a better match."@en ;
	rdfs:domain shui:WidgetScore ;
	# rdfs:range xsd:decimal or xsd:integer
	rdfs:isDefinedBy shui: ;
.

shui:dataGraphShape
	a rdf:Property ;
	rdfs:label "data graph shape"@en ;
	rdfs:comment "Links a widget matcher to a shape that the focus node in the data graph must conform to for the matcher to apply."@en ;
	rdfs:domain shui:WidgetMatcher ;
	rdfs:range sh:Shape ;
	rdfs:isDefinedBy shui: ;
.

shui:shapesGraphShape
	a rdf:Property ;
	rdfs:label "shapes graph shape"@en ;
	rdfs:comment "Links a widget matcher to a shape that the shape node in the shapes graph must conform to for the matcher to apply."@en ;
	rdfs:domain shui:WidgetMatcher ;
	rdfs:range sh:Shape ;
	rdfs:isDefinedBy shui: ;
.


# Global configuration vocabulary ---------------------------------------------

shui:Configuration
	a rdfs:Class ;
	rdfs:label "Configuration"@en ;
	rdfs:comment "The class of resources that carry global configuration properties for rendering a user interface from a shapes graph."@en ;
	rdfs:subClassOf rdfs:Resource ;
	rdfs:isDefinedBy shui: ;
.

sh:Graph
	rdfs:subClassOf shui:Configuration ;
.

shui:defaultNamespace
	a rdf:Property ;
	rdfs:label "default namespace"@en ;
	rdfs:comment "The namespace used to construct the IRIs of nodes a user adds. Its value is a literal holding a valid IRI."@en ;
	rdfs:domain shui:Configuration ;
	rdfs:isDefinedBy shui: ;
.

shui:languagePreference
	a rdf:Property ;
	rdfs:label "language preference"@en ;
	rdfs:comment "The languages preferred for displaying labels, as a SHACL list of language tags ordered from most to least preferred. An empty string stands for no language tag."@en ;
	rdfs:domain shui:Configuration ;
	rdfs:isDefinedBy shui: ;
.

shui:labelPreference
	a rdf:Property ;
	rdfs:label "label preference"@en ;
	rdfs:comment "The properties preferred for retrieving display labels, as a SHACL list of SHACL property paths ordered from most to least preferred."@en ;
	rdfs:domain shui:Configuration ;
	rdfs:isDefinedBy shui: ;
.

shui:timeZone
	a rdf:Property ;
	rdfs:label "time zone"@en ;
	rdfs:comment "The time zone used to construct new terms with datatype xsd:dateTime, given as an IANA time zone identifier."@en ;
	rdfs:domain shui:Configuration ;
	rdfs:range xsd:string ;
	rdfs:isDefinedBy shui: ;
.

shui:defaultOrder
	a rdf:Property ;
	rdfs:label "default order"@en ;
	rdfs:comment "The effective order assumed for property shapes and property groups that do not specify sh:order."@en ;
	rdfs:domain shui:Configuration ;
	# rdfs:range xsd:decimal or xsd:integer
	rdfs:isDefinedBy shui: ;
.

shui:defaultWidgetScore
	a rdf:Property ;
	rdfs:label "default widget score"@en ;
	rdfs:comment "The score that scoring graph preparation gives to a widget declared on a shape that the scoring graph does not otherwise score. Defaults to 40."@en ;
	rdfs:domain shui:Configuration ;
	# rdfs:range xsd:decimal or xsd:integer
	rdfs:isDefinedBy shui: ;
.


# Property role vocabulary ----------------------------------------------------

shui:PropertyRole
	a rdfs:Class ;
	rdfs:label "Property role"@en ;
	rdfs:comment "The class of roles that a property shape may take with respect to its focus nodes. Roles defined in other namespaces should be subclasses of this class."@en ;
	rdfs:subClassOf rdfs:Resource ;
	rdfs:isDefinedBy shui: ;
.

shui:propertyRole
	a rdf:Property ;
	rdfs:label "property role"@en ;
	rdfs:comment "Links a property shape to the role its value nodes play for the focus node. The value is a property role, or a resource that itself declares a property role and an sh:order."@en ;
	rdfs:domain sh:PropertyShape ;
	# rdfs:range shui:PropertyRole or a resource declaring shui:propertyRole and sh:order
	rdfs:isDefinedBy shui: ;
.

shui:LabelRole
	a shui:PropertyRole ;
	rdfs:label "Label role"@en ;
	rdfs:comment "The role of property shapes whose value nodes serve as human-readable display labels for a resource."@en ;
	rdfs:isDefinedBy shui: ;
.
