Просмотр исходного кода

Change fedora and fedoraconfig ns to fcrepo and fcrconfig.

Stefano Cossu 7 лет назад
Родитель
Сommit
a85cb14ba2

+ 2 - 7
lakesuperior/core/namespaces.py

@@ -13,8 +13,8 @@ core_namespaces = {
     'dc' : rdflib.namespace.DC,
     'dcterms' : rdflib.namespace.DCTERMS,
     'ebucore' : Namespace('http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#'),
-    'fedora' : Namespace('http://fedora.info/definitions/v4/repository#'),
-    'fedoraconfig' : Namespace('http://fedora.info/definitions/v4/config#'), # fcrepo =< 4.7
+    'fcrepo' : Namespace('http://fedora.info/definitions/v4/repository#'),
+    'fcrconfig' : Namespace('http://fedora.info/definitions/v4/config#'), # fcrepo =< 4.7
     'gen' : Namespace('http://www.w3.org/2006/gen/ont#'),
     'iana' : Namespace('http://www.iana.org/assignments/relation/'),
     'lake' : Namespace('http://definitions.artic.edu/ontology/lake#'),
@@ -42,8 +42,3 @@ ns_pfx_sparql = dict()
 # Collection of prefixes in a dict.
 for ns,uri in ns_collection.items():
     ns_mgr.bind(ns, uri, override=False)
-    #ns_pfx_sparql[ns] = 'PREFIX {}: <{}>'.format(ns, uri)
-
-# Prefix declarations formatted for SPARQL queries.
-#pfx_decl='\n'.join(ns_pfx_sparql.values())
-

+ 4 - 4
lakesuperior/model/ldpr.py

@@ -125,7 +125,7 @@ class Ldpr(metaclass=ABCMeta):
     All conversion from request payload strings is done here.
     '''
 
-    FCREPO_PTREE_TYPE = nsc['fedora'].Pairtree
+    FCREPO_PTREE_TYPE = nsc['fcrepo'].Pairtree
     LDP_NR_TYPE = nsc['ldp'].NonRDFSource
     LDP_RS_TYPE = nsc['ldp'].RDFSource
 
@@ -532,7 +532,7 @@ class Ldpr(metaclass=ABCMeta):
         fcres:a/b/c, which may be confusing.
         '''
         g = Graph()
-        g.add((uri, RDF.type, nsc['fedora'].Pairtree))
+        g.add((uri, RDF.type, nsc['fcrepo'].Pairtree))
         g.add((uri, RDF.type, nsc['ldp'].Container))
         g.add((uri, RDF.type, nsc['ldp'].BasicContainer))
         g.add((uri, RDF.type, nsc['ldp'].RDFSource))
@@ -629,8 +629,8 @@ class LdpRs(Ldpr):
 
         self.rdfly.patch_rsrc(self.urn, data, ts)
 
-        self.rdfly.ds.add((self.urn, nsc['fedora'].lastUpdated, ts))
-        self.rdfly.ds.add((self.urn, nsc['fedora'].lastUpdatedBy,
+        self.rdfly.ds.add((self.urn, nsc['fcrepo'].lastUpdated, ts))
+        self.rdfly.ds.add((self.urn, nsc['fcrepo'].lastUpdatedBy,
                 Literal('BypassAdmin')))
 
 

+ 11 - 11
lakesuperior/store_layouts/rdf/simple_layout.py

@@ -41,7 +41,7 @@ class SimpleLayout(BaseRdfLayout):
             etag = digest.identifier.split(':')[-1]
             headers['ETag'] = 'W/"{}"'.format(etag),
 
-        last_updated_term = self.rsrc.value(nsc['fedora'].lastUpdated)
+        last_updated_term = self.rsrc.value(nsc['fcrepo'].lastUpdated)
         if last_updated_term:
             headers['Last-Modified'] = arrow.get(last_updated_term)\
                 .format('ddd, D MMM YYYY HH:mm:ss Z')
@@ -88,19 +88,19 @@ class SimpleLayout(BaseRdfLayout):
                     .format(self.rsrc.identifier))
 
             # Delete all triples but keep creation date and creator.
-            created = self.rsrc.value(nsc['fedora'].created)
-            created_by = self.rsrc.value(nsc['fedora'].createdBy)
+            created = self.rsrc.value(nsc['fcrepo'].created)
+            created_by = self.rsrc.value(nsc['fcrepo'].createdBy)
 
             self.delete_rsrc()
         else:
             created = ts
             created_by = Literal('BypassAdmin')
 
-        self.rsrc.set(nsc['fedora'].created, created)
-        self.rsrc.set(nsc['fedora'].createdBy, created_by)
+        self.rsrc.set(nsc['fcrepo'].created, created)
+        self.rsrc.set(nsc['fcrepo'].createdBy, created_by)
 
-        self.rsrc.set(nsc['fedora'].lastUpdated, ts)
-        self.rsrc.set(nsc['fedora'].lastUpdatedBy, Literal('BypassAdmin'))
+        self.rsrc.set(nsc['fcrepo'].lastUpdated, ts)
+        self.rsrc.set(nsc['fcrepo'].lastUpdatedBy, Literal('BypassAdmin'))
 
         for s, p, o in g:
             self.ds.add((s, p, o))
@@ -113,8 +113,8 @@ class SimpleLayout(BaseRdfLayout):
         # @TODO Use gunicorn to get request timestamp.
         ts = Literal(arrow.utcnow(), datatype=XSD.dateTime)
 
-        self.rsrc.set(nsc['fedora'].created, ts)
-        self.rsrc.set(nsc['fedora'].createdBy, Literal('BypassAdmin'))
+        self.rsrc.set(nsc['fcrepo'].created, ts)
+        self.rsrc.set(nsc['fcrepo'].createdBy, Literal('BypassAdmin'))
 
         cksum = Digest.rdf_cksum(self.rsrc.graph)
         self.rsrc.set(nsc['premis'].hasMessageDigest,
@@ -134,8 +134,8 @@ class SimpleLayout(BaseRdfLayout):
         q = Translator.localize_string(data).replace(
                 '<>', self.rsrc.identifier.n3())
 
-        self.rsrc.set(nsc['fedora'].lastUpdated, ts)
-        self.rsrc.set(nsc['fedora'].lastUpdatedBy, Literal('BypassAdmin'))
+        self.rsrc.set(nsc['fcrepo'].lastUpdated, ts)
+        self.rsrc.set(nsc['fcrepo'].lastUpdatedBy, Literal('BypassAdmin'))
 
         self.ds.update(q)