Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
168 commits
Select commit Hold shift + click to select a range
df36063
RO-Crate previewer
ErykKul Sep 29, 2023
2750e56
merged ro crate previewer branch
ErykKul Oct 5, 2023
9736acc
deleted elephant
ErykKul Oct 5, 2023
572f38f
window.onload -> onload
ErykKul Oct 5, 2023
2701d75
window.onload -> onload
ErykKul Oct 5, 2023
adc605a
5 second deleay for onload
ErykKul Oct 5, 2023
af36cb6
revert to window.onload()
ErykKul Oct 5, 2023
ba0a45e
back to working version
ErykKul Oct 5, 2023
f5f91e3
back to working version
ErykKul Oct 5, 2023
eeb9075
wondow.onload() in separate script tag
ErykKul Oct 5, 2023
d20afaa
wondow.onload() in separate script tag with delay
ErykKul Oct 5, 2023
e351d22
wondow.onload() -> onload(), without timeout
ErykKul Oct 5, 2023
c528a8f
while loop until onload is defined
ErykKul Oct 5, 2023
0fa8e9c
revert of the evil while loop
ErykKul Oct 5, 2023
12f24e1
back to working version
ErykKul Oct 5, 2023
53f1b46
RO-Crate previewer Deltablot version
ErykKul Oct 11, 2023
a141d22
removed type module from the script tag
ErykKul Oct 13, 2023
f18ca32
refactoring
ErykKul Oct 13, 2023
195ea5e
refactoring
ErykKul Oct 13, 2023
b37b08e
refactoring
ErykKul Oct 13, 2023
d0fa1ab
refactoring
ErykKul Oct 13, 2023
8b9f686
css and html structure
ErykKul Oct 13, 2023
a96ed38
visual tweaks
ErykKul Oct 13, 2023
0453d64
visual tweaks
ErykKul Oct 13, 2023
dc4644e
visual tweaks
ErykKul Oct 13, 2023
e9afa0d
visual tweaks
ErykKul Oct 13, 2023
12b4a22
visual tweaks
ErykKul Oct 13, 2023
0fd178b
visual tweaks
ErykKul Oct 13, 2023
c1919f7
removed unneeded function
ErykKul Oct 13, 2023
efcea6f
added newlines at the end of files
ErykKul Oct 13, 2023
5ee5aa2
removed not working elements from RO-Crate lib
ErykKul Oct 13, 2023
7bb0286
zip previewer test on s3 -> forceRangeRequests set to true
ErykKul Oct 19, 2023
d812583
removed http workaround -> default https
ErykKul Oct 19, 2023
462e1c5
merged RO-Crate previewer branch
ErykKul Oct 20, 2023
f04e031
Merge branch '23_RO-Crate_previewer'
ErykKul Oct 20, 2023
5fe469d
support for tables in markdown previewer
ErykKul Jul 9, 2024
8beb370
Add CDI previewer with SHACL shapes support
ErykKul Nov 11, 2025
9cc0aaf
Merge feature/cdi-previewer into master
ErykKul Nov 11, 2025
38e5760
Add CDI test tool and comprehensive testing documentation
ErykKul Nov 11, 2025
c71daa9
Add 5 example CDI files for testing
ErykKul Nov 11, 2025
c8914c8
Update CDI documentation and tools to enforce DDI-CDI MIME type with …
ErykKul Nov 11, 2025
8429a4c
Enhance CDI Test Guide with detailed ecosystem overview and installat…
ErykKul Nov 11, 2025
f16f827
Revise CDI Test Guide for clarity and conciseness; streamline install…
ErykKul Nov 11, 2025
bf9e69e
Revise CDI Test Guide to enhance clarity and structure; update instal…
ErykKul Nov 11, 2025
de785ff
Merge feature/cdi-test-tool: Add CDI previewer, test tools, and docum…
ErykKul Nov 11, 2025
fc94bcf
Fix test upload tool: use signed URLs instead of requiring manual API…
ErykKul Nov 11, 2025
c5ada29
Merge feature/cdi-test-tool: Fix upload tool to use signed URLs
ErykKul Nov 11, 2025
c4630e4
Fix test upload tool to properly handle callback parameter with signe…
ErykKul Nov 11, 2025
947100e
Merge feature/cdi-test-tool: Fix upload tool callback handling for si…
ErykKul Nov 11, 2025
ea423a9
Add debugging for signed URL issues
ErykKul Nov 11, 2025
e3ecc74
Merge feature/cdi-test-tool: Add debugging for signed URL
ErykKul Nov 11, 2025
163e363
Simplify to use API token instead of signed URLs
ErykKul Nov 11, 2025
b59e550
Merge feature/cdi-test-tool: Use API token approach
ErykKul Nov 11, 2025
040985f
Fix: Use contentType instead of mimeType for file upload
ErykKul Nov 11, 2025
ecf4001
Merge fix: Use contentType for file MIME type
ErykKul Nov 11, 2025
b0d846f
Fix: Set MIME type with profile on Blob itself
ErykKul Nov 11, 2025
9e55f06
Merge fix: Set CDI MIME type on Blob
ErykKul Nov 11, 2025
ea89f82
Update comment to emphasize exact MIME type matching
ErykKul Nov 11, 2025
d11f3d5
Merge: Update comment for MIME type matching
ErykKul Nov 11, 2025
64eb3e0
Fix: Remove manual root subject detection, let SHACL shapes auto-detect
ErykKul Nov 11, 2025
209c019
Merge: Fix SHACL root node shape detection
ErykKul Nov 11, 2025
b2508d9
Add SHACL form patch to preserve multi-value blank nodes
ErykKul Nov 11, 2025
1ea640b
Merge: Add SHACL form patch for multi-value blank nodes
ErykKul Nov 11, 2025
479ade5
Fix SHACL target query and add comprehensive error reporting
ErykKul Nov 11, 2025
4243818
Fix SHACL form rendering by setting explicit shape and values subjects
ErykKul Nov 11, 2025
9e1f223
Fix MIME type URL case sensitivity for CDI test tool
ErykKul Nov 11, 2025
952867b
Fix MIME type URL case sensitivity in curl commands
ErykKul Nov 11, 2025
6d0b7a6
Merge branch 'feature/cdi-test-tool'
ErykKul Nov 11, 2025
9a71939
Merge branch 'feature/cdi-previewer'
ErykKul Nov 11, 2025
987230f
Fix Turtle syntax error in SHACL shapes file
ErykKul Nov 11, 2025
0c843e7
Merge branch 'feature/cdi-previewer'
ErykKul Nov 11, 2025
2b0aa53
Add comprehensive diagnostic logging for SHACL form debugging
ErykKul Nov 11, 2025
270b233
Merge feature/cdi-previewer with diagnostic logging
ErykKul Nov 11, 2025
fed879e
Fix CDI form rendering: replace unreachable @context and detect DDI-C…
ErykKul Nov 11, 2025
69087bc
Merge CDI form rendering fixes from feature branch
ErykKul Nov 11, 2025
4615f51
Fix formatting of prefix declarations in SHACL shapes file
ErykKul Nov 12, 2025
56b89aa
Fix SHACL target query to match DDI-CDI dataset types (WideDataSet, L…
ErykKul Nov 12, 2025
34723da
Merge SHACL query fix from master
ErykKul Nov 12, 2025
d91a1a0
CRITICAL FIX: Add sh:targetClass to SHACL shapes for type-based disco…
ErykKul Nov 12, 2025
6d76ba8
feat(cdi-preview): Add comprehensive DDI-CDI viewer/editor with SHACL…
ErykKul Nov 12, 2025
cc27493
style(CdiPreview): Reduce padding and margins for improved layout con…
ErykKul Nov 12, 2025
2bbce16
style(CdiPreview): Adjust margin increment for node cards to 8px per …
ErykKul Nov 12, 2025
8092e30
style(CdiPreview): Adjust node card indentation to a fixed 8px for de…
ErykKul Nov 12, 2025
2e8dcbe
refactor(CdiPreview): Separate change collection logic into a dedicat…
ErykKul Nov 12, 2025
2cb6a6a
feat(CdiPreview): Implement save modal with API token input and loadi…
ErykKul Nov 12, 2025
4085dc5
feat(CdiPreview): Enhance save modal for test mode with alert cleanup…
ErykKul Nov 12, 2025
fabdf15
refactor(CdiPreview): Simplify file loading logic and remove test mod…
ErykKul Nov 12, 2025
05a6baf
feat(CdiPreview): Add support for external tool invocation with callb…
ErykKul Nov 12, 2025
670e0fa
refactor(CdiPreview): Simplify parameter extraction logic in API resp…
ErykKul Nov 12, 2025
17e5d22
feat(CdiPreview): Add MIME type specification for DDI-CDI profile in …
ErykKul Nov 12, 2025
d8e4ab6
refactor(CdiPreview): Optimize jsonData update logic to preserve unch…
ErykKul Nov 12, 2025
c4bdabd
feat(CdiPreview): Enhance filename handling by retrieving original fi…
ErykKul Nov 12, 2025
3eb2eff
refactor(CdiPreview): Remove page reload after successful data update
ErykKul Nov 12, 2025
e93bc48
fix(CdiPreview): Correct MIME type specification for DDI-CDI profile …
ErykKul Nov 13, 2025
402d901
refactor(CdiPreview): Improve change detection logic and add console …
ErykKul Nov 13, 2025
7b3af8a
fix(CdiPreview): Update MIME type specification for external tool reg…
ErykKul Nov 13, 2025
3fe2c5f
fix: Remove space after semicolon in MIME type for CDI tool registration
ErykKul Nov 13, 2025
a0dc52c
fix: Remove space after semicolon in MIME type description for CDI up…
ErykKul Nov 13, 2025
dc87cbe
feat(CdiPreview): Add SHACL shape selector and custom URL input for d…
ErykKul Nov 14, 2025
e6183b1
feat(CdiPreview): Add functionality to create and add root nodes with…
ErykKul Nov 14, 2025
b783697
feat(CdiPreview): Add normalization notice and function for JSON-LD t…
ErykKul Nov 14, 2025
66f6e6c
style(CdiPreview): Adjust toolbar layout for improved button alignmen…
ErykKul Nov 14, 2025
b55c57b
feat(CdiPreview): Add special handling for DDI-CDI format to normaliz…
ErykKul Nov 14, 2025
3e61f33
style(CdiPreview): Adjust button spacing for improved layout
ErykKul Nov 14, 2025
43d2fd0
feat(CdiPreview): Add dropdown controls for controlled vocabulary fields
ErykKul Nov 14, 2025
29ccc8f
style(CdiPreview): Reduce button right margin for improved spacing
ErykKul Nov 14, 2025
c2dd507
fix(CdiPreview): Remove mimeType parameter to match working master br…
ErykKul Nov 14, 2025
191317c
style(CdiPreview): Remove right margin from buttons for improved alig…
ErykKul Nov 14, 2025
b1c2e71
feat(CdiPreview): Add standalone mode for loading local JSON-LD files
ErykKul Nov 17, 2025
27991b1
Refactor code structure for improved readability and maintainability
ErykKul Nov 17, 2025
8142568
fix(CdiPreview): Update message to reflect correct button position fo…
ErykKul Nov 17, 2025
a3ebf9f
Refactor code structure for improved readability and maintainability
ErykKul Nov 17, 2025
ed8520b
feat(CdiPreview): Enhance SHACL support with SPARQL targeting and log…
ErykKul Nov 17, 2025
7254c59
fix(CdiPreview): Resolve namespace mismatch in CDIF Discovery Core sh…
ErykKul Nov 18, 2025
a98d252
feat(CdiPreview): Update SHACL shape loading to use selected shape fr…
ErykKul Nov 18, 2025
aae27c8
feat(CdiPreview): Update shape selector default and enhance SPARQL lo…
ErykKul Nov 18, 2025
4935866
feat(CdiPreview): Add example CDIF dataset for testing Discovery Core…
ErykKul Nov 18, 2025
2c6097f
feat(CdiPreview): Enhance path handling in SHACL shape processing to …
ErykKul Nov 18, 2025
c402e18
feat: Add favicon.ico for improved branding and user experience
ErykKul Nov 18, 2025
27ae87b
feat(CdiPreview): Add favicon link for improved branding
ErykKul Nov 18, 2025
0229a83
feat(CdiPreview): Enhance value display for complex objects in view mode
ErykKul Nov 18, 2025
31515fb
fix(CDIF-Discovery-Core-Shapes): resolve namespace mismatch and relax…
ErykKul Nov 18, 2025
1ac0e00
fix(cdi-preview): clarify property shape reference in SHACL processing
ErykKul Nov 18, 2025
88cd1b5
fix(CDIF-Discovery-Core-Shapes): enhance property recognition for CDI…
ErykKul Nov 18, 2025
4df6a83
Add SHACL validation and property suggestion features to CDI Previewer
ErykKul Nov 18, 2025
d101ce6
fix(plan): update status of CDIF Discovery shapes and enhance module …
ErykKul Nov 18, 2025
27d5056
formatting
ErykKul Nov 18, 2025
d2f1b34
feat(CdiPreview): add SHACL UI helpers for property classification an…
ErykKul Nov 18, 2025
9bfe5bf
feat(CdiPreview): add SHACL-based UI helpers for property classificat…
ErykKul Nov 18, 2025
972bfa7
feat(render): add support for rendering nested JSON objects in edit a…
ErykKul Nov 18, 2025
7e901bf
feat(render): update nested JSON rendering to support view mode only
ErykKul Nov 18, 2025
321e912
reverted to working code
ErykKul Nov 18, 2025
b06671c
feat(render): add inline rendering for nested objects in property dis…
ErykKul Nov 18, 2025
9889678
Refactor code structure for improved readability and maintainability
ErykKul Nov 18, 2025
764fbeb
Refactor code structure for improved readability and maintainability
ErykKul Nov 18, 2025
d19cdc5
refactor(validation): streamline data dataset preparation by removing…
ErykKul Nov 18, 2025
80e04a2
feat(validation): enhance validation feedback with detailed violation…
ErykKul Nov 18, 2025
795c771
feat(jsonld): implement custom document loader for DDI-CDI context URLs
ErykKul Nov 18, 2025
3cf9f81
feat(validation): enhance error handling for SPARQL constraint valida…
ErykKul Nov 18, 2025
4d6cc9c
feat(validation): update SHACL shapes for dataset validation and enha…
ErykKul Nov 18, 2025
dd5ab87
feat(validation): replace SPARQL components with Core SHACL constrain…
ErykKul Nov 18, 2025
c19e2e0
feat(validation): enhance type URI handling in SHACL property classif…
ErykKul Nov 18, 2025
ed2fb3a
Remove CDIF-Discovery-Core-Shapes.ttl file as it is no longer needed …
ErykKul Nov 18, 2025
ec3ccb3
feat(docs): update file headers for clarity and consistency across mo…
ErykKul Nov 18, 2025
50a637d
feat(data-extraction): update collectChangesFromDOM to clear changed …
ErykKul Nov 19, 2025
cc9a62b
feat(cdi-preview): add CDIF Discovery Core option and shapes for vali…
ErykKul Nov 19, 2025
1a93ca0
fix: update schema.org URIs from HTTPS to HTTP for consistency across…
ErykKul Nov 19, 2025
8bca1be
feat(cdi-preview): enhance classifyProperty to support array context …
ErykKul Nov 19, 2025
a3421c3
feat(cdi-preview): add recommended Schema.org properties for enhanced…
ErykKul Nov 19, 2025
6c5de57
feat(cdi-preview): update documentation for CDIF Discovery Core shape…
ErykKul Nov 19, 2025
afe1c9e
feat(cdi-preview): implement robust context resolution and fallback m…
ErykKul Nov 20, 2025
36e01f7
feat(cdi-preview): improve user notifications and validation messages…
ErykKul Nov 20, 2025
5d481c7
Refactor SHACL shapes in cdif-core.ttl and add test HTML for CDI View…
ErykKul Nov 20, 2025
139b7cd
chore(preview): update bundled cdi-viewer and use loadBody() from bundle
ErykKul Nov 26, 2025
c5565e0
chore(preview): refresh cdi-viewer bundle (inlined HTML/CSS)
ErykKul Nov 26, 2025
ef1a7e9
fix(preview): handle inlined index.html import and avoid .match() error
ErykKul Nov 26, 2025
41ad837
chore(preview): remove local APP_BODY_HTML fallback; require inlined …
ErykKul Nov 26, 2025
bfe54e2
chore(preview): remove favicon link and delete unused cdi-preview.css…
ErykKul Nov 26, 2025
d5afc73
cleanup
ErykKul Nov 26, 2025
06db1ef
restore deleted files from origin/develop (undo accidental deletions)
ErykKul Nov 26, 2025
e49d544
chore(preview): remove obsolete files related to CDI previewer
ErykKul Nov 26, 2025
0e13ec3
restore .gitignore, ROCrate.html and zip.js from origin/develop
ErykKul Nov 26, 2025
dcd83c0
docs: add link to standalone cdi-viewer implementation repository
ErykKul Nov 26, 2025
bfeab58
docs: update CDI previewer description and link to implementation
ErykKul Nov 26, 2025
6ddb385
feat(preview): add favicon for beta test previewer
ErykKul Nov 26, 2025
3277043
chore(preview): remove favicon files from beta test previewer
ErykKul Nov 26, 2025
af65424
moved curl commands to betetest section
ErykKul Nov 28, 2025
900ae4b
remove 5.2 version curl commands; 5.2 is not supported
ErykKul Nov 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions 6.1curlcommands.md
Original file line number Diff line number Diff line change
Expand Up @@ -1797,3 +1797,46 @@ curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin
## Beta Versions:
As updates and additions are made, they will be added to a /betatest sub-folder which will make them accessible to users via github.io without affecting people who are using the latest numbered release (e.g. v1.5). When previewers in the betatest branch are included in the next release (e.g. v1.6), sites may wish to change their registration of the tools to use the stable version as the betatest version may continue to receive changes.

### CDI Previewer

```bash
curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin/externalTools -d \
'{
"displayName":"View CDI Metadata",
"description":"View DDI Cross-Domain Integration (CDI) metadata file using SHACL shapes.",
"toolName":"cdiPreviewer",
"scope":"file",
"types":["preview"],
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/betatest/CdiPreview.html",
"toolParameters": {
"queryParameters":[
{"fileid":"{fileId}"},
{"siteUrl":"{siteUrl}"},
{"datasetid":"{datasetId}"},
{"datasetversion":"{datasetVersion}"},
{"locale":"{localeCode}"}
]
},
"contentType":"application/ld+json; profile=\"http://www.w3.org/ns/json-ld#flattened http://www.w3.org/ns/json-ld#compacted https://ddialliance.org/specification/ddi-cdi/1.0\"",
"allowedApiCalls": [
{
"name": "retrieveFileContents",
"httpMethod": "GET",
"urlTemplate": "/api/v1/access/datafile/{fileId}?gbrecs=true",
"timeOut": 3600
},
{
"name": "downloadFile",
"httpMethod": "GET",
"urlTemplate": "/api/v1/access/datafile/{fileId}?gbrecs=false",
"timeOut": 3600
},
{
"name": "getDatasetVersionMetadata",
"httpMethod": "GET",
"urlTemplate": "/api/v1/datasets/{datasetId}/versions/{datasetVersion}",
"timeOut": 3600
}
]
}'
```
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ The Spreadsheet Previewer was contributed by [anncie-pcss](https://github.com/an

[Max Planck Digital Library](https://github.com/MPDL) contributed the ZIP Previewer.

[erykkul](https://github.com/erykkul) contributed the Markdown (MD) Previewer and the RO-Crate previewer.
[erykkul](https://github.com/erykkul) contributed the Markdown (MD) Previewer, the RO-Crate previewer, and the CDI (DDI Cross-Domain Integration) previewer. The CDI previewer displays all JSON-LD data nodes and properties with real-time SHACL validation, smart property classification (required/optional/extra fields), support for complex nested objects, and editing capabilities. See [https://github.com/libis/cdi-viewer](https://github.com/libis/cdi-viewer) for the source code, documentation and implementation details.

[Jan Range](https://github.com/JR-1991) contributed the H5Web Previewer, Rich Html Previewer.

Expand Down
25 changes: 25 additions & 0 deletions previewers/betatest/CdiPreview.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>CDI Data Viewer & Editor</title>

<!-- External CSS -->
<link
rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
/>

<!-- External JavaScript Libraries -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

<!-- CDI Viewer Application (ES6 modules with SHACL + SPARQL validation) -->
<script src="lib/cdi-viewer.bundle.min.js"></script>
</head>

<body>
<script>loadBody()</script>
</body>
</html>
1 change: 1 addition & 0 deletions previewers/betatest/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"mdPreviewText": "Markdown Preview",
"ncmlPreviewText": "NcML Preview",
"rocratePreviewText": "RO-Crate Preview",
"cdiPreviewText": "CDI Preview",
"prev": "Previous",
"next": "Next",
"pageText": "Page:",
Expand Down
1 change: 1 addition & 0 deletions previewers/betatest/i18n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"mdPreviewText": "Previsualización de Markdown",
"ncmlPreviewText": "Previsualización de NcML",
"rocratePreviewText": "Previsualización de RO-Crate",
"cdiPreviewText": "Previsualización de CDI",
"prev": "Anterior",
"next": "Siguiente",
"pageText": "Página:",
Expand Down
1 change: 1 addition & 0 deletions previewers/betatest/i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"mdPreviewText": "Aperçu Markdown",
"ncmlPreviewText": "Aperçu NcML",
"rocratePreviewText": "Aperçu RO-Crate",
"cdiPreviewText": "Aperçu CDI",
"prev": "Précédent",
"next": "Suivant",
"pageText": "Page:",
Expand Down
97 changes: 97 additions & 0 deletions previewers/betatest/lib/cdi-viewer.bundle.min.js

Large diffs are not rendered by default.

158 changes: 158 additions & 0 deletions previewers/betatest/shapes/cdif-core.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
@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 xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix schema: <http://schema.org/>.
@prefix dcterms: <http://purl.org/dc/terms/>.
@prefix cdifd: <https://cdif.org/validation/0.1/shacl#> .
@base <https://www.ogc.org/rules/template/> .

cdifd:CDIFDatasetMandatoryShape a sh:NodeShape ;
# only apply to elements that are child of root dataset
sh:target [
a sh:SPARQLTarget ;
sh:prefixes (
[ sh:prefix "schema" ; sh:namespace "http://schema.org/" ]
[ sh:prefix "ex" ; sh:namespace "https://example.org/" ]
);
# do we need to deal with schema:Dataset with parent = @graph? pyshacl work with these rules
# for graph serialization.
sh:select """
PREFIX schema: <http://schema.org/>
PREFIX ex: <https://example.org/>
SELECT ?this
WHERE {
?this a schema:Dataset .
MINUS {
?parent a schema:Dataset .
?parent ?p ?this .
FILTER (?parent != ?this)
FILTER (?p != schema:about)
}
}
""" ;
] ;

sh:property
cdifd:resourceIdentifierProperty,
cdifd:nameProperty,
cdifd:rightsProperty,
cdifd:dateModifiedProperty
.

cdifd:resourceIdentifierProperty
# identifier for the resource described by the graph node, implement as either xsd:string or
# schema:PropertyValue with required [either scheme:url or schema:value]
a sh:PropertyShape ;
sh:path schema:identifier ;
sh:minCount 1 ;
sh:or (
[sh:datatype xsd:string ;]
[sh:class schema:PropertyValue ;
sh:property
[sh:path schema:propertyID ;
sh:datatype xsd:string ;
sh:severity sh:Warning ;
sh:message "If specifying an identifier via the PropertyValue, the scheme (authority, domain) within which the identifier is assigned and unique must be identifed, either by name or preferably using a URI. See https://registry.identifiers.org/registry"
];
sh:or (
[sh:property
[sh:path schema:url ;
sh:datatype xsd:string ;
sh:message "if possible, provide a resolvable URI that will provide a representation of the identified resource."
]]
[sh:property
[sh:path schema:value ;
sh:datatype xsd:string ;
sh:message "The identifer string; include applicable prefix (e.g. doi:, ark:, http:, isbn:)"
]]
)
]
);
sh:message "An identifier for the documented resource must be provided"
.

cdifd:nameProperty
# names must be a literal, .
a sh:PropertyShape ;
sh:path schema:name;
sh:minCount 1 ;
sh:datatype xsd:string ;
sh:minLength 5 ;
sh:message "a name for the person must be provided, and have a length of at least 5 characters."
.

cdifd:rightsProperty
a sh:PropertyShape ;
# some indication of rights is required, either a license or statement on conditions of access
sh:path [sh:alternativePath ( schema:license schema:conditionsOfAccess ) ];
sh:or (
[sh:nodeKind sh:IRI ]
[sh:datatype xsd:string ]
# use schema:CreativeWork to implement a labeled link, only URL is required, but schema:name is expected
[sh:class schema:CreativeWork;
sh:property
[
sh:path schema:url ;
sh:minCount 1 ;
sh:datatype xsd:string ;
# sh:pattern "^[a-zA-Z][a-zA-Z0-9+.-]*:[^\\s]*$";
sh:pattern "^https?:\\/\\/[^\\s]+$" ;
sh:message "value must be a resolvable URL, but we aren't testing to see if the URL resolves..... Can't get xsd:anyURI to work with JSON Schema validation..."
]
]
);
sh:minCount 1 ;
sh:message "To meet the requirements for FAIR data, information about licenses or other security, usage, or access limitations must be described"
.

cdifd:dateModifiedProperty
a sh:PropertyShape ;
sh:path schema:dateModified;
# pyshacl doesn't seem to work validating xsd:date or xsd:dateTime in JSON-LD
# sh:datatype xsd:dateTime ;
sh:minCount 1 ;
sh:datatype xsd:string ;
# messy regex to screen for ISO8601 formats
sh:pattern "^[1-2][0-9]{3}-([0][1-9]|[1][0-2])(-([0-2][0-9]|[3][0-1])(T([0-1][0-9]|[2][0-3]):[0-5][0-9](:[0-5][0-9](Z|[+-][0-2][0-9]:[0-5][0-9])?)?)?)?$" ;
sh:message "Date of most recent update to resource content is required, using ISO8601 format with at least a year and a month."
.

cdifd:CDIFMetaMetadataShape
a sh:NodeShape ;
# only apply to dataset nodes that are 'about' a dataset node. Need to refine rule so 'about' is the
# root node of the containing resource. Parent might be any of the allowed resource types for CDIF
sh:target [
a sh:SPARQLTarget ;
sh:select """
PREFIX schema: <http://schema.org/>
SELECT ?this
WHERE {
?this a schema:Dataset ;
schema:about ?parent.
}
""";
] ;
sh:nodeKind sh:IRI ;
sh:property cdifd:metadataProfileProperty ;
sh:property cdifd:metadataSubjectProperty ;
sh:message "The target of the metadata record (about)."
.

cdifd:metadataProfileProperty
# Metadata needs to identify conventions followed in the serialization of this record.
a sh:PropertyShape ;
sh:path dcterms:conformsTo ;
sh:minCount 1 ;
sh:nodeKind sh:IRI ;
sh:message "provide identifiers for specifications used in this record to provide guidance for machine agents processing the metadata record"
.

cdifd:metadataSubjectProperty
# Metadata needs to identify conventions followed in the serialization of this record.
a sh:PropertyShape ;
sh:path schema:about ;
sh:nodeKind sh:IRI ;
sh:minCount 1 ;
sh:message "link to the target of the metadata metadata node using the about property"
.
Loading