Documentation: Register RDF Namespaces used by Drupal 8 in Fedora4

Created on 18 Aug 2016  路  16Comments  路  Source: Islandora/documentation

We could need namespace registration logic on module install (or on when adding new predicates via UI that make use of a non existing/previouls registered rdf namespace) .

Fedora 4 keeps track of each use namespace/prefix globally. Keeping track of prefix + namespaces in RDF can be tricky since there is no easy way to "extract" prefixing from full RDF documents, at least not in EasyRDF (our RDF library), which can lead to multiple ns1, ns2, etc or even conflicts. So it could be useful to register(create a fake resource for example) all commonly used namespaces and prefixes to make CRUD easier and slimmer and avoid complications of miss matching prefixes (dc11 versus dc?)

MVP Vagrant drupal fcrepo

Most helpful comment

Bibframe is another possibility: bf for http://id.loc.gov/ontologies/bibframe/

All 16 comments

I just remembered... I think @acoburn has something he uses to register namespaces & prefixes in Fedora.

@Islandora-CLAW/committers Please review this stub list below, and let me know of any other prefixes that we should instantiate Fedora with.

@Islandora-CLAW/sprinters feel free to jump in here too.

PREFIX acl: <http://www.w3.org/ns/auth/acl#>
PREFIX bf: <http://id.loc.gov/ontologies/bibframe/>
PREFIX cc: <http://creativecommons.org/ns#>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX dwc: <http://rs.tdwg.org/dwc/terms/>
PREFIX ebucore: <http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#>
PREFIX exif: <http://www.w3.org/2003/12/exif/ns#>
PREFIX fedoraconfig: <http://fedora.info/definitions/v4/config#>
PREFIX fedora: <http://fedora.info/definitions/v4/repository#>
PREFIX fedoramodel: <info:fedora/fedora-system:def/model#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
PREFIX gn: <http://www.geonames.org/ontology#>
PREFIX iana: <http://www.iana.org/assignments/relation/>
PREFIX image: <http://www.modeshape.org/images/1.0>
PREFIX islandorarelsext: <http://islandora.ca/ontology/relsext#>
PREFIX islandorarelsint: <http://islandora.ca/ontology/relsint#>
PREFIX jcr: <http://www.jcp.org/jcr/1.0>
PREFIX ldp: <http://www.w3.org/ns/ldp#>
PREFIX mix: <http://www.jcp.org/jcr/mix/1.0>
PREFIX mode: <http://www.modeshape.org/1.0>
PREFIX nfo: <http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#>
PREFIX nt: <http://www.jcp.org/jcr/nt/1.0>
PREFIX ore: <http://www.openarchives.org/ore/terms/>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX pcdm: <http://pcdm.org/models#>
PREFIX pcdmfmt: <http://pcdm.org/2015/10/14/file-format-types>
PREFIX pcdmrts: <http://pcdm.org/rights#>
PREFIX pcdmuse: <http://pcdm.org/use#>
PREFIX pcdmwrks: <http://pcdm.org/works#>
PREFIX premis: <http://www.loc.gov/premis/rdf/v1#>
PREFIX prov: <http://www.w3.org/TR/prov-o/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rel: <http://id.loc.gov/vocabulary/relators/>
PREFIX schema: <http://schema.org>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX sv: <http://www.jcp.org/jcr/sv/1.0>
PREFIX test: <info:fedora/test/>
PREFIX xml: <http://www.w3.org/XML/1998/namespace>
PREFIX xmlns: <http://www.w3.org/2000/xmlns/>
PREFIX xs: <http://www.w3.org/2001/XMLSchema>
PREFIX xsi: <http://www.w3.org/2001/XMLSchema-instance>

Some of those prefixes are server managed by fedora 4. Not sure if re-registering them would fail at all, end with server generated/duplicated namespaces (ns1, etc) or just be ignored.

Also, each user contributed ontology should also trigger prefix registering by hooking somehow to the rdf api on Drupal.

We should also add:
http://www.w3.org/TR/prov-o/ simple description here
@prefix schema: http://schema.org, since we are using that on drupal,
@prefix owl: http://www.w3.org/2002/07/owl# .

And this one, why did i not see it before? 馃槃
http://www.bbc.co.uk/ontologies/cms !!

The question on what method ( @acoburn 's one was mentioned) we want to use is still open.

@DiegoPino updated the list.

Re-reading this thread, we have a couple options:

  • Edit fedora-node-types.cnd - which is probably a bad idea for a variety of reasons
  • Create a fcrepoNamespaceConfig utility similar to what @awead has done here and here
  • Some thing else?

Either way, @awead and I will have to do this for the NYC Fedora Camp vagrant, which means I'll do the same here. ...or other way around :smile:

is purl a good prefix for http://purl.org/dc/terms/? I would think dcterms might be better.

ore could also be useful.

From the Prov website:

We suggest the use of prov as a prefix for this namespace.

So, I'd also suggest using prov instead of provo.

I also recall a way to change the prefixes after they'd been registered. Perhaps this is dark magic?

And 馃憤 to whatever @acoburn says. I would _not_ take my prefix uris as gospel.

@acoburn good catches. I've updated my list.

@awead there is this utility for changing namespaces, but it's also a bit wonky and has certain limitations (i.e. you can't change any prefix that is used with rdf:type). I am not sure I would recommend its use.

pcdmformat for http://pcdm.org/file-format-types# is another namespace that could be useful.

dwc is, I think, the standard prefix for Darwin Core: http://rs.tdwg.org/dwc/terms/
This is a vocabulary that is really useful for scientific (esp. biological) resources.

@acoburn heh. I was just adding the pcdm extentions :smile:

cc for Creative Commons: http://creativecommons.org/ns#

Also, I know I'm planning to use Geonames data, but I'm not sure that the geonames namespace will be entirely necessary (e.g. <> dcterms:spatial <http://sws.geonames.org/4929022/>). That said, if there is interest in using the Geonames ontology, this would be the namespace: gn for: http://www.geonames.org/ontology#

Bibframe is another possibility: bf for http://id.loc.gov/ontologies/bibframe/

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dannylamb picture dannylamb  路  3Comments

Natkeeran picture Natkeeran  路  3Comments

manez picture manez  路  5Comments

acoburn picture acoburn  路  5Comments

acoburn picture acoburn  路  4Comments