You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The repos, tutorial, and examples are useful but not extensive or informative enough. This issue will collect useful commands from these and other sources, and try to work them into a framework of usage specific to our shacl-vue needs.
const fileUrl = new URL('../../node_modules/housemd/dist/housemd.nt', import.meta.url)
const fileRelativeUrl = './node_modules/housemd/dist/housemd.nt'
const httpUrl = 'https://housemd.rdf-ext.org/person/gregory-house'
async function main () {
// read a Dataset from a file URL
const gregoryHouseFile = await rdf.io.dataset.fromURL(fileUrl)
console.log(`read ${gregoryHouseFile.size} triples from ${fileUrl}`)
// read a Dataset from a relative file URL
const gregoryHouseFileRelative = await rdf.io.dataset.fromURL(fileRelativeUrl)
console.log(`read ${gregoryHouseFileRelative.size} triples from ${fileRelativeUrl}`)
// read a Dataset from a http URL
const gregoryHouseHttp = await rdf.io.dataset.fromURL(httpUrl)
console.log(`read ${gregoryHouseHttp.size} triples from ${httpUrl}`)
}
Serializing
import formatsPretty from '@rdfjs/formats/pretty.js'
// clone the default environment
const rdfPretty = rdf.clone()
// import pretty print serializers
rdfPretty.formats.import(formatsPretty)
// it's also possible import into the default like this:
// rdf.formats.import(formatsPretty)
// serialize a Dataset to plain text
console.log(await rdfPretty.io.dataset.toText('text/turtle', gregoryHouseHttp))
Sources:
The repos, tutorial, and examples are useful but not extensive or informative enough. This issue will collect useful commands from these and other sources, and try to work them into a framework of usage specific to our
shacl-vue
needs.Namespaces
Nodes and quads
Datasets
Datasets from URLs
Serializing
Dataset traversal
This uses grapoi
in()
out()
trim()
quads()
distinct()
hasIn(predicate, object)
hasOut(predicate, object)
The text was updated successfully, but these errors were encountered: