Skip to content

Instantly share code, notes, and snippets.

@epoz
Created February 13, 2024 14:37
Show Gist options
  • Save epoz/b6b9dba9f9d859e1fa136ff3f3ead0b9 to your computer and use it in GitHub Desktop.
Save epoz/b6b9dba9f9d859e1fa136ff3f3ead0b9 to your computer and use it in GitHub Desktop.
from nfdi4culture import cto
from lidolator import from_file
item = cto.Item()
item.datafeed = "https://nfdi4culture.de/id/E5320"
# Or should we have cto.DataFeed("https://nfdi4culture.de/id/E5320") and the rest happens from there?
# either of the above will set things like .publisher on the Item too.
# and create the relevant schema.DataFeedItem and schema.DataFeed triples?
item.sourcefile = "http://foo.com/bar/baz.oai-pmh?id=123456"
# the update method expects a dict with key-value mappings
# the cto.Item objet knows how to map a key and value to the relevant fields.
# How do we specify this field mapping?
# And do we split it into a NamedNode/Literal difference?
item.update(from_file(filepath))
item.ntriples()
# or
item.turtle()
@epoz
Copy link
Author

epoz commented Feb 15, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment