Skip to content

Load a json-ld string into a Grax schema #25

Answered by marcelotto
carlotm asked this question in Q&A
Discussion options

You must be logged in to vote

Oh, I thought load/2 would accept datasets. Maybe I'll change that.

The then, however, shouldn't be necessary.

BTW: if you're input indeed consists of multiple graphs and you want to load from all of them, you can aggregate the dataset with RDF.Graph.new/1:

input_str
|> JSON.LD.read_string!()
|> RDF.Graph.new()
|> Cjp.Schema.Organization.load(~I<https://www.acme.com#org>)

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@carlotm
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by carlotm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants