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

Framing JSON-LD Star #58

Open
saumier opened this issue Apr 17, 2023 · 8 comments
Open

Framing JSON-LD Star #58

saumier opened this issue Apr 17, 2023 · 8 comments
Labels

Comments

@saumier
Copy link

saumier commented Apr 17, 2023

When using Annotation Objects in a JSON-LD-star document, and then using JSON-LD Framing, I am losing the @Annotate node.

Does JSON::LD::API.frame need to have the setting rdfstar: true ?

 input =  JSON.parse %({
      "@context": {
        "@base":"http://www.artsdata.ca/resource/",
        "@vocab":"http://www.artsdata.ca/resource/"
      },
      "@graph": [
        {
          "@id": "TheShow",
          "@type": "Performance",
          "performer": {
            "@id": "John",
            "@annotation": {
                "certainty": 1
            }
          }
        },
        {
          "@id": "John",
          "@type": "Person",
          "name" : "John Smith"
        }
      ]
    })

frame = JSON.parse %({
      "@context": {
        "@vocab": "http://ontology.artsdata.ca/"
       },
       "@type": "Performance"
    })

JSON::LD::API.frame(input, frame)

The above example results in the loss of the @Annotate node as shown below:

{
  "@context"=>{
     "@base"=>"http://www.artsdata.ca/resource/", 
     "@vocab"=>"http://www.artsdata.ca/resource/"
  }, 
  "@id"=>"TheShow", 
  "@type"=>"Performance", 
  "performer"=>{"@id"=>"John", "@type"=>"Person", "name"=>"John Smith"}
}
@gkellogg
Copy link
Member

That’s likely the issue, (needing to use the rdfstar option) as annotation is experimental and very well may change radically depending on how the RDF-star group progresses. You might also be running into implementation corner cases which I may be able to address.

@saumier
Copy link
Author

saumier commented Apr 18, 2023

I tried using JSON::LD::API.frame(input, frame, { rdfstar: true }) to no avail.

@gkellogg
Copy link
Member

I’ll look into it soonish.

@saumier
Copy link
Author

saumier commented Apr 18, 2023

Thanks in advance. That would be a big help. I hope to contribute back one day :-)

@saumier
Copy link
Author

saumier commented Apr 25, 2023

Hi. I apologize for disturbing you. I am having a meeting this week on the delivery of project related to the Swiss Archives of Performing Arts. I was wondering if I could say to them that you are looking into this issue, or rather say there is a known issue and a workaround must be found. Thx for your feedback.

@gkellogg
Copy link
Member

Sorry, on vacation this week, and I am backed up with other things on a timeline. I will look into it, but it may be another week or two before I can figure it out and release an update.

I’ll update sooner if I can localize the issue that suggests a fix. I don’t expect it to be difficult, and it may also impact the algorithm from the spec.

@gkellogg
Copy link
Member

I've looked at the code, and IIRC, the @annotation implementation for flattening and framing is fairly unexplored, and will require some more investigation. Your use case should be supported but it is missing tests and may take some time to explore.

Note, as said above, that RDF-star is pretty exerimental, and the semantics are still being worked out, and the annotation property may change or even go away, depending on how standards efforts develop. I'd caution you against depending on it for any product use before standards work progresses in RDF-star, and JSON-LD-star is updated to consider this change, and subsequently this implementation.

That said, the use of @annotation is intended to work in this gem, and missing functionality should be implemented, but it will be more than a simple fix, I'm afraid.

@gkellogg gkellogg added the bug label Apr 25, 2023
@saumier
Copy link
Author

saumier commented Apr 25, 2023

Thanks for your valuable insights. I’ll follow the development closely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants