From 31719de4848501587b8f690d516dfcd020a58729 Mon Sep 17 00:00:00 2001 From: Tobias Schweizer Date: Wed, 29 Jan 2025 17:38:32 +0100 Subject: [PATCH] Wip/report shape (#67) * feat (report): add report shape * feat (report): add report shape * feat (report): add report shape * feat (report): add report shape --- .github/workflows/ci.yml | 2 +- ontology/ontology.json | 9 ++- scripts/test_all.sh | 1 + shapes/report/schema.json | 27 +++++++++ test/report/report.json | 122 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 159 insertions(+), 2 deletions(-) create mode 100644 shapes/report/schema.json create mode 100644 test/report/report.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2737c3a..2ff7aa5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: # You can use PyPy versions in python-version. # For example, pypy2 and pypy3 matrix: - python-version: ["3.9"] + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] steps: - uses: actions/checkout@v3 diff --git a/ontology/ontology.json b/ontology/ontology.json index 3cce61f..92d8ae5 100644 --- a/ontology/ontology.json +++ b/ontology/ontology.json @@ -24,7 +24,7 @@ "rdfs:label": "RESCS SHACL Shapes", "owl:versionInfo": { "@type": "xsd:date", - "@value": "2024-09-02" + "@value": "2025-01-29" } }, { @@ -59,6 +59,13 @@ "@id": "schema:Article" } }, + { + "@id": "schema:Report", + "@type": "rdfs:Class", + "rdfs:subClassOf": { + "@id": "schema:Article" + } + }, { "@id": "schema:Dataset", "@type": "rdfs:Class", diff --git a/scripts/test_all.sh b/scripts/test_all.sh index 61eda7c..1327707 100755 --- a/scripts/test_all.sh +++ b/scripts/test_all.sh @@ -84,6 +84,7 @@ validate "creativework" "creativework" validate "book" "book" validate "article" "article" validate "scholarlyarticle" "scholarlyarticle" +validate "report" "report" validate "datadownload" "datadownload" validate "dataset" "dataset" validate "mediaobject" "mediaobject" diff --git a/shapes/report/schema.json b/shapes/report/schema.json new file mode 100644 index 0000000..9a70b68 --- /dev/null +++ b/shapes/report/schema.json @@ -0,0 +1,27 @@ +{ + "@context": [ + "https://incf.github.io/neuroshapes/contexts/schema.json", + { + "this": "http://rescs.org/dash/report/" + } + ], + "@type": "nxv:Schema", + "@id": "http://rescs.org/dash/report", + "imports": [ + "http://rescs.org/dash/article" + ], + "shapes": [ + { + "@id": "this:ReportShape", + "@type": "sh:NodeShape", + "label": "Report", + "comment": "A Report generated by governmental or non-governmental organization.", + "targetClass": "schema:Report", + "and": [ + { + "node": "http://rescs.org/dash/article/ArticleShape" + } + ] + } + ] + } \ No newline at end of file diff --git a/test/report/report.json b/test/report/report.json new file mode 100644 index 0000000..1bb77f2 --- /dev/null +++ b/test/report/report.json @@ -0,0 +1,122 @@ +{ + "@context": { + "@vocab": "http://schema.org/", + "xsd": "http://www.w3.org/2001/XMLSchema#" + }, + "@type": "Report", + "alternateName": "My alias name", + "description": "a description", + "identifier": { + "@id": "http://www.example.com/1" + }, + "image": { + "@id": "http://www.example.com/2" + }, + "name": "a name", + "sameAs": { + "@id": "http://www.example.com/3" + }, + "url": { + "@id": "http://www.example.com/4" + }, + "about": { + "@id": "http://www.example.com/5", + "@type": "Thing", + "name": "another thing" + }, + "abstract": "a short summary", + "author": { + "@id": "http://www.example.com/6", + "@type": "Person", + "name": "John Doe", + "additionalName": "Joe", + "address": "Fakestreet, Faketown", + "email": "john@doe.com", + "familyName": "Doe", + "givenName": "John", + "jobTitle": "developer", + "affiliation": { + "@id": "http://www.example.com/17", + "@type": "Organization", + "name": "my org", + "address": "Fakestreet, Faketown", + "email": "info@contact.com", + "contactPoint": { + "@id": "http://www.contact.com/1", + "@type": "ContactPoint", + "name": "a contact point,", + "availableLanguage": "eng", + "contactType": "sales", + "email": "info@contact.com" + } + } + }, + "citation": "a reference to another work", + "conditionsOfAccess": "CC", + "copyrightHolder": { + "@id": "http://www.example.com/6", + "@type": "Person" + }, + "copyrightNotice": "my copyright", + "copyrightYear": 2022, + "creativeWorkStatus": "published", + "dateCreated": { + "@type": "xsd:date", + "@value": "2021-09-23Z" + }, + "dateModified": { + "@type": "xsd:date", + "@value": "2021-09-25Z" + }, + "datePublished": { + "@type": "xsd:date", + "@value": "2021-09-27Z" + }, + "editor": { + "@id": "http://www.example.com/6", + "@type": "Person" + }, + "encodingFormat": "text/plain", + "genre": "creative", + "hasPart": { + "@id": "http://www.example.com/8", + "@type": "CreativeWork", + "name": "another work", + "conditionsOfAccess": "CC", + "author": { + "@id": "http://www.example.com/6", + "@type": "Person" + }, + "inLanguage": "eng" + }, + "inLanguage": "eng", + "isAccessibleForFree": true, + "keywords": [ + "creative", + "work", + { + "@id": "http://www.taxonomy.com/1" + } + ], + "license": { + "@id": "http://www.creativecommons.com/cc" + }, + "maintainer": { + "@id": "http://www.example.com/6", + "@type": "Person", + "name": "John Doe" + }, + "mentions": { + "@id": "http://www.example.com/5", + "@type": "Thing", + "name": "another thing" + }, + "position": 1, + "publisher": { + "@id": "http://www.example.com/6", + "@type": "Person" + }, + "articleBody": "The article's content ...", + "pageEnd": 100, + "pageStart": 50 +} \ No newline at end of file