-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
issue #8: made rdfilesystemstorage raise notimplemented
- Loading branch information
Tyler Danstrom
committed
Sep 7, 2017
1 parent
5547a01
commit 93d2a29
Showing
3 changed files
with
24 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 21 additions & 9 deletions
30
metadatastorageapi/blueprint/storagelib/rdffilesystemstorage.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |