-
Notifications
You must be signed in to change notification settings - Fork 3
Retrieve templates as RDF
michelleif edited this page Nov 25, 2020
·
1 revision
Sinopia treats templates just like any other resource, so templates are edited like any other resource: using the Sinopia Editor. For users who would like to work with templates in their raw form, outside of Sinopia, here's 2 ways to get the raw templates.
- From the Resource Templates tab, click the pencil icon next to the template you want to retrieve. This opens the template as if you were going to edit it (so don't change it!)
- Use the eye icon to open the template in Preview mode
- Change the Format dropdown to N-Triples
- Select all the text in the box and copy/paste it to wherever you want to work with it
You will need:
- wget: this should work on any OS with wget installed
- jq: this should work on any Unixy OS (Linux, OS X)
- Create a file urls.txt containing the URIs of the templates you want to retrieve. For example:
https://api.sinopia.io/resource/ld4p:RT:bf2:Cartographic:Instance
https://api.sinopia.io/resource/ld4p:RT:bf2:Cartographic:Work
https://api.sinopia.io/resource/ld4p:RT:bf2:Monograph:Instance:Un-nested
- Retrieve the templates:
wget -i urls.txt --show-progress --directory-prefix=templates --header "Accept: application/ld+json" -N
- Pretty and rename the files:
find templates/ -type f -exec bash -c "jq '' {} > {}.jsonld" \; -delete
- Home - How To Get Help
- Sinopia background
- Sinopia environments
- Supported browsers
- Ontology, vocabulary, BIBFRAME optimization
- Latest release / What's next
- Earlier releases
- Demo playlist
- Create an account
- Search
- RDF to MARC conversion
- Diacritics and character sets
- Permissions
- Action icons
- QuickStart in creating a description