Skip to content

Commit

Permalink
issue #8: made rdfilesystemstorage raise notimplemented
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyler Danstrom committed Sep 7, 2017
1 parent 5547a01 commit 93d2a29
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 13 deletions.
5 changes: 2 additions & 3 deletions debug.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/bash

APP_SAVE=$FLASK_APP
FLASK_APP=metadatastorageapi
python -m flask run
APP_SAVE=$FLASK_APP
python -m flask run --debugger
export FLASK_APP=$APP_SAVE
2 changes: 1 addition & 1 deletion metadatastorageapi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from .blueprint import BLUEPRINT

class Configuration(metaclass=MetaFlaskEnv):
ENV_PREFIX='METADATA_STORAGE_API_'
ENV_PREFIX='MSAPI_'
DEBUG = False
DEFER_CONFIG = False

Expand Down
30 changes: 21 additions & 9 deletions metadatastorageapi/blueprint/storagelib/rdffilesystemstorage.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,37 @@

from rdflib import Graph, URIRef
from rdflib import Graph, URIRef, Namespace
from rdflib.namespace import RDF

from .storagesystem import StorageSystem

class RDFFileSystemStorage(StorageSystem):
def __init__(self, file_path):
self.graph = Graph().parse(file_path)
self._namespaces = {"dc":Namespace("http://purl.org/dc/elements/1.1/"),
"dcterms":Namespace("http://purl.org/dc/terms/"),
"ldr":Namespace("http://lib.uchicago.edu/ldr/")}
self._graph = Graph().parse(file_path)

def find_root(self):
root = URIRef("http://metadatastorage.lib.uchicago.edu/collection/ldr")
print([x for x in self.graph.subjects() if x == root])
return []
root = URIRef(self._namespaces["ldr"]["ldr"])
print(root)
query = self._graph.query(
"""SELECT DISTINCT ?aname ?bname
WHERE {
?a dc:isPartOf "ldr".
}
"""
)
print(query)
raise NotImplementedError

def find_specific_collection(self, identifier):
return []
raise NotImplementedError

def find_extension(self, extension):
return None
raise NotImplementedError

def find_collection_extensions(self, collection_id):
return []
raise NotImplementedError

def find_core_metadata(self, collection_id):
return {}
raise NotImplementedError

0 comments on commit 93d2a29

Please sign in to comment.