Created
December 9, 2021 16:34
-
-
Save tpluscode/ce9ed8eb2178904e58edf1dae8bae123 to your computer and use it in GitHub Desktop.
SHACL Compound properties
This file contains 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
<data-file> | |
a schema:MediaObject ; | |
schema:identifier "sample-data.csv" ; | |
schema:encodingFormat "text/csv"; | |
schema:contenUrl <https://s3.link/ugly-guid-link-whatever.csv> | |
. |
This file contains 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
import { html } from 'lit' | |
/** | |
@param properties JS object with values of property shapes mapped to schema:identifier | |
*/ | |
export default function(properties) { | |
return html`<a href=${properties.href}> | |
<format-icon format=${properties.mediaType}></format-icon> | |
Download ${properties.fileName} | |
</a>` | |
} |
This file contains 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
<> | |
sh:targetClass schema:MediaObject ; | |
sh:property | |
[ | |
schema:identifier "fileName" ; | |
sh:path schema:identifier ; | |
] , | |
[ | |
schema:identifier "mediaType" ; | |
sh:path schema:encodingFormat ; | |
dash:hidden true ; | |
] , | |
[ | |
schema:identifier "href" ; | |
sh:path schema:contenUrl ; | |
dash:hidden true ; | |
] , | |
[ | |
a dashing:CompoundProperty ; | |
dashing:module </render-download-link.js> | |
]; | |
. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment