Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document RDF/EDN #12

Open
aamedina opened this issue Aug 29, 2023 · 0 comments
Open

Document RDF/EDN #12

aamedina opened this issue Aug 29, 2023 · 0 comments
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@aamedina
Copy link
Owner

aamedina commented Aug 29, 2023

Problem:
I need a way to serialize arbitrary RDF models as EDN.

Solution:
I use Apache Jena and Aristotle to read from some RDF source (could be JSON-LD, Turtle, RDF/XML etc.) and convert the triples into maps of subjects. The blank nodes are represented by subjects with a :db/id and named resources are given a :db/ident iff a prefix mapping exists at the time the RDF model is parsed by Jena. If no prefix mapping is found resources are identified by :rdfa/uri.

Typed literals are read as EDN tagged literals using the IRI of the datatype as the tag.

Language tagged literals are read as #rdf/langString "hello@en".

#rdf/List [:owl/Class :rdfs/Class]  
=> 
{:rdf/type :rdf/List,
 :rdf/first :owl/Class,
 :rdf/rest
 {:rdf/type :rdf/List, :rdf/first :rdfs/Class, :rdf/rest :rdf/nil}}

Subsumes #6

@aamedina aamedina added documentation Improvements or additions to documentation enhancement New feature or request labels Aug 29, 2023
@aamedina aamedina self-assigned this Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant