ropensci / jsonld

R wrapper for jsonld.js JavaScript library
https://docs.ropensci.org/jsonld
Other
35 stars 0 forks source link

jsonld_to_rdf and jsonld_from_rdf should be convert back to original #19

Open wincowgerDEV opened 2 years ago

wincowgerDEV commented 2 years ago

I was working through the examples and was surprised that this logical expression to test whether doc can be translated to RDF and back to JSON-LD in its exact form does not work.

doc <- '{
  "http://schema.org/name": "Manu Sporny",
  "http://schema.org/url": {"@id": "http://manu.sporny.org/"},
  "http://schema.org/image": {"@id": "http://manu.sporny.org/images/manu.png"}
}'

cat(nquads <- jsonld_to_rdf(doc))

#I would expect this expression to be TRUE but it is false. 
jsonld_from_rdf(nquads) == doc
#FALSE

After further inspection of json_fromrdf it looks like a "@id": ":b0", is being added as the first expression. Is this the desired behavior?

If this is something the team would like to add, I would be interested in working on it.

jeroen commented 2 years ago

We're not super actively maintaining this package, but if you have suggestions you are welcome to contribute, and I'll try to merge them.

wincowgerDEV commented 2 years ago

Thanks for this feedback. Are there other r jsonld packages that you think may superced this one or is there another reason it isn't being actively maintained? I'm planning on putting in a lot of effort over the next two years to streamline jsonld integration in R. Are there other packages you think I should be aware of so that I don't reinvent the wheel?

On Sat, Mar 5, 2022, 9:57 AM Jeroen Ooms @.***> wrote:

We're not super actively maintaining this package, but if you have suggestions you are welcome to contribute, and I'll try to merge them.

— Reply to this email directly, view it on GitHub https://github.com/ropensci/jsonld/issues/19#issuecomment-1059796353, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGMUJU3PMZ3QTWTCFLMU5TDU6OG7PANCNFSM5P74L5HQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

jeroen commented 2 years ago

AFAIK this is the only package. You are welcome to take over maintenance if you are seriously interested.

wincowgerDEV commented 2 years ago

That is an exciting offer, I'm only maintaining one other package at the moment so I think I'd have the capacity and this package doesn't appear to be too complicated yet. Let me dive into the code backend and make a couple pull requests so that I can get a feel for it before I commit but I'm definitely interested.

On Sat, Mar 5, 2022, 2:55 PM Jeroen Ooms @.***> wrote:

AFAIK this is the only package. You are welcome to take over maintenance if you are seriously interested.

— Reply to this email directly, view it on GitHub https://github.com/ropensci/jsonld/issues/19#issuecomment-1059829959, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGMUJU2I45GKRNZUUY5Z6BTU6PC2NANCNFSM5P74L5HQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>