diff --git a/src/index.js b/src/index.js index 356257f94..6166359ab 100644 --- a/src/index.js +++ b/src/index.js @@ -13,6 +13,7 @@ var $rdf = { N3Parser: require('./n3parser'), NamedNode: require('./named-node'), Namespace: require('./namespace'), + ns: require('./ns'), Node: require('./node'), parse: require('./parse'), Query: require('./query').Query, diff --git a/src/node.js b/src/node.js index c3a4f85bf..4206edc8e 100644 --- a/src/node.js +++ b/src/node.js @@ -75,6 +75,7 @@ Node.fromValue = function fromValue (value) { } Node.toJS = function fromJS (term) { + const ns = require('./ns') if (term.elements) { return term.elements.map(Node.toJS) // Array node (not standard RDFJS) } diff --git a/src/ns.js b/src/ns.js new file mode 100644 index 000000000..b6201fdd9 --- /dev/null +++ b/src/ns.js @@ -0,0 +1,60 @@ +const Namespace = require('./namespace') + +const ns = { + adms: Namespace("http://www.w3.org/ns/adms#"), + as: Namespace("https://www.w3.org/ns/activitystreams#"), + bibo: Namespace("http://purl.org/ontology/bibo/"), + cc: Namespace("http://creativecommons.org/ns#"), + dbo: Namespace("http://dbpedia.org/ontology/"), + dbp: Namespace("http://dbpedia.org/property/"), + dbpedia: Namespace("http://dbpedia.org/resource/"), + dcat: Namespace("http://www.w3.org/ns/dcat#"), + dcterms: Namespace("http://purl.org/dc/terms/"), + dctype: Namespace("http://purl.org/dc/dcmitype/"), + dce: Namespace("http://purl.org/dc/elements/1.1/"), + doap: Namespace("http://usefulinc.com/ns/doap#"), + event: Namespace("http://purl.org/NET/c4dm/event.owl#"), + ex: Namespace("http://example.com/"), + exNS: Namespace("http://example.com/ns#"), + fhir: Namespace("http://hl7.org/fhir/"), + fhir3: Namespace("http://hl7.org/fhir/STU3"), + foaf: Namespace("http://xmlns.com/foaf/0.1/"), + geo: Namespace("http://www.w3.org/2003/01/geo/wgs84_pos#"), + gsp: Namespace("http://www.opengis.net/ont/geosparql#"), + gr: Namespace("http://purl.org/goodrelations/v1#"), + http: Namespace("http://www.w3.org/2011/http#"), + http07: Namespace("http://www.w3.org/2007/ont/http#"), + httph: Namespace("http://www.w3.org/2007/ont/httph#"), + hydra: Namespace("http://www.w3.org/ns/hydra/core#"), + ianalr: Namespace("http://www.w3.org/ns/iana/link-relations/relation#"), + ianamt: Namespace("http://www.w3.org/ns/iana/media-types/"), + link: Namespace("http://www.w3.org/2007/ont/link#"), + org: Namespace("http://www.w3.org/ns/org#"), + owl: Namespace("http://www.w3.org/2002/07/owl#"), + p: Namespace("http://www.wikidata.org/prop/"), + prov: Namespace("http://www.w3.org/ns/prov#"), + qb: Namespace("http://purl.org/linked-data/cube#"), + rdf: Namespace("http://www.w3.org/1999/02/22-rdf-syntax-ns#"), + rdfs: Namespace("http://www.w3.org/2000/01/rdf-schema#"), + schema: Namespace("http://schema.org/"), + sh: Namespace("http://www.w3.org/ns/shacl#"), + sioc: Namespace("http://rdfs.org/sioc/ns#"), + skos: Namespace("http://www.w3.org/2004/02/skos/core#"), + ssn: Namespace("http://www.w3.org/ns/ssn/"), + sosa: Namespace("http://www.w3.org/ns/sosa/"), + time: Namespace("http://www.w3.org/2006/time#"), + vann: Namespace("http://purl.org/vocab/vann/"), + vcard: Namespace("http://www.w3.org/2006/vcard/ns#"), + void: Namespace("http://rdfs.org/ns/void#"), + vs: Namespace("http://www.w3.org/2003/06/sw-vocab-status/ns#"), + wd: Namespace("http://www.wikidata.org/entity/"), + wdata: Namespace("https://www.wikidata.org/wiki/Special:EntityData/"), + wdref: Namespace("http://www.wikidata.org/reference/"), + wds: Namespace("http://www.wikidata.org/entity/statement/"), + wdt: Namespace("http://www.wikidata.org/prop/direct/"), + wdv: Namespace("http://www.wikidata.org/value/"), + xmlns: Namespace("http://www.w3.org/2000/xmlns/"), + xsd: Namespace("http://www.w3.org/2001/XMLSchema#"), +} + +module.exports = ns