-
Notifications
You must be signed in to change notification settings - Fork 3
Add Annotation/Note shape (W3C Web Annotation Vocabulary) #61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
jeswr
wants to merge
3
commits into
solid:main
Choose a base branch
from
jeswr:feat/annotation-shape
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,111 @@ | ||||||
| @prefix dc: <http://purl.org/dc/elements/1.1/> . | ||||||
| @prefix dct: <http://purl.org/dc/terms/> . | ||||||
| @prefix oa: <http://www.w3.org/ns/oa#> . | ||||||
| @prefix prov: <http://www.w3.org/ns/prov#> . | ||||||
| @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 vs: <http://www.w3.org/2003/06/sw-vocab-status/ns#> . | ||||||
| @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | ||||||
|
|
||||||
| @prefix annotation_shape: <https://solidproject.org/shapes/annotation#> . | ||||||
|
|
||||||
| annotation_shape:AnnotationShape | ||||||
| a sh:NodeShape ; | ||||||
| sh:targetClass oa:Annotation ; | ||||||
| sh:name "Annotation Shape" ; | ||||||
| sh:description "SHACL shape describing a Web Annotation covering common note, bookmark, comment, and highlight cases." ; | ||||||
| dct:created "2026-04-23"^^xsd:date ; | ||||||
| vs:term_status "testing" ; | ||||||
| dc:source <https://www.w3.org/TR/annotation-vocab/> ; | ||||||
| prov:wasDerivedFrom <https://www.w3.org/TR/annotation-vocab/> ; | ||||||
| dct:references <http://www.w3.org/ns/oa#Annotation> ; # references the oa:Annotation class from the W3C Web Annotation Vocabulary, which is the expected type of an annotation node, together with the oa:hasBody, oa:hasTarget, oa:bodyValue, and oa:motivatedBy properties used to relate an annotation to its body, target, textual body content, and motivation respectively. | ||||||
| dct:references <https://www.w3.org/TR/annotation-model/> ; # references the W3C Web Annotation Data Model recommendation which defines the conceptual model used by the Web Annotation Vocabulary. | ||||||
| sh:codeIdentifier "Annotation"; | ||||||
|
|
||||||
| # Type: an annotation should be typed as oa:Annotation. | ||||||
| sh:property [ | ||||||
| sh:path rdf:type ; | ||||||
| sh:hasValue oa:Annotation ; | ||||||
| sh:name "Type" ; | ||||||
| sh:description "The RDF type of the annotation, which must include oa:Annotation." ; | ||||||
| sh:codeIdentifier "type"; | ||||||
| ] ; | ||||||
|
|
||||||
| # Inline textual body (for simple comment / note cases). | ||||||
| # Per the Web Annotation Data Model (§3.2.4), an annotation SHOULD NOT | ||||||
| # have both oa:bodyValue and oa:hasBody. This shape does not enforce | ||||||
| # the exclusion (favouring interoperability) but consumers SHOULD | ||||||
| # populate only one of the two. | ||||||
| sh:property [ | ||||||
| sh:path oa:bodyValue ; | ||||||
| sh:datatype xsd:string ; | ||||||
| sh:maxCount 1 ; | ||||||
| sh:name "Body Value" ; | ||||||
| sh:description "Textual content of the annotation body, used for plain-text comments or notes (Web Annotation Vocabulary, oa:bodyValue). SHOULD NOT be combined with oa:hasBody on the same annotation." ; | ||||||
| sh:codeIdentifier "bodyValue"; | ||||||
| ] ; | ||||||
|
|
||||||
| # External or embedded body resource(s) (for richer body cases). | ||||||
| sh:property [ | ||||||
| sh:path oa:hasBody ; | ||||||
| sh:nodeKind sh:BlankNodeOrIRI ; | ||||||
| sh:name "Body" ; | ||||||
| sh:description "A resource that provides the content of the annotation (Web Annotation Vocabulary, oa:hasBody). May be repeated when an annotation has multiple bodies. SHOULD NOT be combined with oa:bodyValue on the same annotation." ; | ||||||
| sh:codeIdentifier "hasBody"; | ||||||
| ] ; | ||||||
|
|
||||||
| # Target(s) the annotation is about. Required for an annotation to be meaningful. | ||||||
| sh:property [ | ||||||
| sh:path oa:hasTarget ; | ||||||
| sh:nodeKind sh:BlankNodeOrIRI ; | ||||||
| sh:minCount 1 ; | ||||||
| sh:name "Target" ; | ||||||
| sh:description "The resource (or specific resource) that the annotation is about (Web Annotation Vocabulary, oa:hasTarget)." ; | ||||||
| sh:codeIdentifier "hasTarget"; | ||||||
| ] ; | ||||||
|
|
||||||
| # Motivation. Left open to the full Web Annotation motivation set so that | ||||||
| # the shape does not reject conforming annotations using motivations | ||||||
| # outside the common note-taking subset (e.g., oa:tagging, oa:replying). | ||||||
| # Apps focused on notes/bookmarks/highlights typically use oa:bookmarking, | ||||||
| # oa:commenting, or oa:highlighting. | ||||||
| sh:property [ | ||||||
| sh:path oa:motivatedBy ; | ||||||
| sh:nodeKind sh:IRI ; | ||||||
| sh:name "Motivation" ; | ||||||
| sh:description "Why the annotation was created (Web Annotation Vocabulary, oa:Motivation). Common note-taking values are oa:bookmarking, oa:commenting, and oa:highlighting." ; | ||||||
|
||||||
| sh:description "Why the annotation was created (Web Annotation Vocabulary, oa:Motivation). Common note-taking values are oa:bookmarking, oa:commenting, and oa:highlighting." ; | |
| sh:description "Why the annotation was created (Web Annotation Vocabulary, oa:motivatedBy). Values are typically motivation IRIs such as oa:bookmarking, oa:commenting, and oa:highlighting." ; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oa:bodyValueis constrained toxsd:string, which will fail validation for language-tagged literals (datatyperdf:langString) that are common for user-generated annotation text. Consider allowing bothxsd:stringandrdf:langString(e.g., withsh:or), or relaxing the datatype constraint to improve interoperability with Web Annotation data in the wild.