diff --git a/.github/workflows/main-pr-validation.yml b/.github/workflows/main-pr-validation.yml index 192cede..5fdff49 100644 --- a/.github/workflows/main-pr-validation.yml +++ b/.github/workflows/main-pr-validation.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: fetch-depth: 0 # needed to compare with origin/main @@ -28,9 +28,11 @@ jobs: - name: Determine changed TTL files id: changes run: | - git fetch origin main - # Get list of changed TTL files in PR - changed_files=$(git diff --name-only origin/main...HEAD -- 'shapes/**/*.ttl' || true) + git fetch origin main:main || true + BASE=$(git merge-base HEAD main || echo "main") + + changed_files=$(git diff --name-only "$BASE"...HEAD | grep '^shapes/.*\.ttl$' || true) + echo "Changed TTL files:" echo "$changed_files" # Output to GitHub Actions @@ -47,7 +49,7 @@ jobs: for file in ${{ steps.changes.outputs.changed_files }}; do echo "───────────────────────────────" echo "Validating $file..." - python shapes/scripts/validate-shacl-shapes-file.py "$file" || ok=false + python scripts/validate-shacl-shapes-file.py "$file" || ok=false done $ok || exit 1 diff --git a/.github/workflows/main-push-validation.yml b/.github/workflows/main-push-validation.yml index e440ea1..94e1859 100644 --- a/.github/workflows/main-push-validation.yml +++ b/.github/workflows/main-push-validation.yml @@ -13,7 +13,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 + with: + fetch-depth: 0 # needed to compare with origin/main - name: Skip validation for Dependabot if: github.actor == 'dependabot[bot]' diff --git a/shapes/bookmark.ttl b/shapes/bookmark.ttl index f261b15..a1c721c 100644 --- a/shapes/bookmark.ttl +++ b/shapes/bookmark.ttl @@ -1,14 +1,14 @@ -@prefix sh: . -@prefix rdfs: . -@prefix xsd: . -@prefix dct: . -@prefix vs: . +@prefix a: . @prefix bookmark: . +@prefix bookmark_shape: . @prefix dc: . +@prefix dct: . @prefix prov: . - -@prefix bookmark_shape: . - +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix vs: . +@prefix xsd: . bookmark_shape:BookmarkShape a sh:NodeShape ; @@ -26,10 +26,10 @@ bookmark_shape:BookmarkShape # Label property sh:property [ - sh:path sh:name ; + sh:path rdfs:label ; sh:datatype xsd:string ; sh:name "Label" ; - sh:name "Label" ; + sh:maxCount 1 ; sh:description "Human-readable name of the bookmark" ; sh:codeIdentifier "label"; ] ; @@ -39,7 +39,8 @@ bookmark_shape:BookmarkShape sh:path bookmark:recalls ; sh:datatype xsd:anyURI ; sh:name "URL" ; - sh:name "URL" ; + sh:minCount 1 ; + sh:maxCount 1 ; sh:description "The URL that the bookmark points to" ; sh:codeIdentifier "url"; ] ; @@ -48,18 +49,196 @@ bookmark_shape:BookmarkShape sh:property [ sh:path bookmark:hasTopic ; sh:datatype xsd:string ; - sh:name "Topic" ; - sh:name "Topic" ; + sh:name "Topic"; + sh:maxCount 1 ; sh:description "Topic or category of the bookmark" ; sh:codeIdentifier "topic"; ] ; # Description property sh:property [ - sh:path sh:description ; + sh:path rdfs:comment ; sh:datatype xsd:string ; sh:name "Description" ; - sh:name "Description" ; + sh:maxCount 1 ; sh:description "Optional description of the bookmark" ; sh:codeIdentifier "description"; ] . + + +bookmark_shape:BookmarkAnnoteaShape + a sh:NodeShape ; + sh:targetClass bookmark:Bookmark ; + sh:name "Bookmark" ; + sh:description "A Bookmark node with label, URL, topic, description, creator, created date and last modified date" ; + dct:created "2026-03-12"^^xsd:date ; + vs:term_status "testing" ; + dc:source ; + prov:wasDerivedFrom ; + dct:references ; # references the Annotea Bookmark schema, which defines the bookmark:Bookmark class and its properties + dct:references ; # references the bookmark:Bookmark class in the W3C Bookmark vocabulary (the Annotea Bookmark ontology) + sh:description "This shape does include all properties defined for bookmark:Bookmark in the W3C Bookmark vocabulary (the Annotea Bookmark ontology)" ; + sh:codeIdentifier "BookmarkAnnotea"; + + # type property + sh:property [ + sh:path rdf:type ; + sh:hasValue bookmark:Bookmark ; + sh:name "Type" ; + sh:maxCount 1 ; + sh:description "The RDF type of the bookmark, which must be bookmark:Bookmark" ; + sh:codeIdentifier "type"; + ] ; + + # Label property + sh:property [ + sh:path dc:title ; + sh:datatype xsd:string ; + sh:name "Title" ; + sh:maxCount 1 ; + sh:description "Human-readable name of the bookmark" ; + sh:codeIdentifier "title"; + ] ; + + # URL property + sh:property [ + sh:path bookmark:recalls ; + sh:datatype xsd:anyURI ; + sh:name "Recalls" ; + sh:minCount 1 ; + sh:maxCount 1 ; + sh:description "The URL that the bookmark points to" ; + sh:codeIdentifier "recalls"; + ] ; + + # Topic property + sh:property [ + sh:path bookmark:hasTopic ; + sh:node bookmark_shape:BookmarkTopicShape ; + sh:name "hasTopic" ; + sh:description "Topic or category of the bookmark" ; + sh:codeIdentifier "hasTopic"; + ] ; + + # Description property + sh:property [ + sh:path dc:description ; + sh:datatype xsd:string ; + sh:name "Description" ; + sh:maxCount 1 ; + sh:description "Optional description of the bookmark" ; + sh:codeIdentifier "description"; + ] ; + + sh:property [ + sh:path dc:creator ; + sh:nodeKind sh:IRI ; + sh:name "Creator" ; + sh:maxCount 1 ; + sh:description "The name of the creator of the bookmark" ; + sh:codeIdentifier "creator"; + ] ; + + sh:property [ + sh:path a:created ; + sh:datatype xsd:dateTime ; + sh:name "Created date" ; + sh:maxCount 1 ; + sh:description "The date and time on which the bookmark was created" ; + sh:codeIdentifier "created"; + ] ; + + sh:property [ + sh:path dc:date ; + sh:datatype xsd:dateTime ; + sh:name "Last modified date" ; + sh:maxCount 1 ; + sh:description "The date and time on which the bookmark was last modified" ; + sh:codeIdentifier "lastModified"; + ] ; + +. + + +bookmark_shape:BookmarkTopicShape + a sh:NodeShape ; + sh:targetClass bookmark:Topic ; + sh:name "Bookmark Topic" ; + sh:description "A Bookmark topic" ; + dct:created "2026-04-22"^^xsd:date ; + vs:term_status "testing" ; + dc:source ; + prov:wasDerivedFrom ; + dct:references ; # references the Annotea Bookmark schema, which defines the bookmark:Bookmark class and its properties + dct:references ; # references the bookmark:Topic class in the W3C Bookmark vocabulary (the Annotea Bookmark ontology) + sh:description "Bookmark topic or category, which can be used to group bookmarks by topic" ; + sh:codeIdentifier "BookmarkTopic"; + + # type property + sh:property [ + sh:path rdf:type ; + sh:hasValue bookmark:Topic ; + sh:name "Type" ; + sh:maxCount 1 ; + sh:description "The RDF type of the topic, which must be bookmark:Topic" ; + sh:codeIdentifier "type"; + ] ; + + # Title property + sh:property [ + sh:path dc:title ; + sh:datatype xsd:string ; + sh:name "Title" ; + sh:minCount 1 ; + sh:maxCount 1 ; + sh:description "The title of the topic" ; + sh:codeIdentifier "title"; + ] ; + + # SubTopicOf property + sh:property [ + sh:path bookmark:SubTopicOf ; + sh:targetNode bookmark_shape:BookmarkTopicShape ; + sh:name "SubTopic Of" ; + sh:description "Describes a relationship between topics." ; + sh:codeIdentifier "subTopicOf"; + ] ; + + # Description property + sh:property [ + sh:path dc:description ; + sh:datatype xsd:string ; + sh:name "Description" ; + sh:maxCount 1 ; + sh:description "The description of or notes about the topic." ; + sh:codeIdentifier "description"; + ] ; + + sh:property [ + sh:path dc:creator ; + sh:nodeKind sh:IRI ; + sh:name "Creator" ; + sh:maxCount 1 ; + sh:description "The name of the creator of the bookmark" ; + sh:codeIdentifier "creator"; + ] ; + + sh:property [ + sh:path a:created ; + sh:datatype xsd:dateTime ; + sh:name "Created date" ; + sh:maxCount 1 ; + sh:description "The date and time on which the bookmark was created" ; + sh:codeIdentifier "created"; + ] ; + + sh:property [ + sh:path dc:date ; + sh:datatype xsd:dateTime ; + sh:name "Last modified date" ; + sh:maxCount 1 ; + sh:description "The date and time on which the bookmark was last modified" ; + sh:codeIdentifier "lastModified"; + ] ; + + .