-
Notifications
You must be signed in to change notification settings - Fork 71
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
Serialize Media entities as LDP-RS describing the File, not itself #662
Comments
@dannylamb is that something you want to have fixed as such? Since Media entities are not file entities, not sure how to handle that. I would have guessed that media entities were a way of managing nicely images, etc, but the real Non RDF Source payload would come from one of the file entities connected to them. jsonld module handles, or at least would like to handle this, as generic and ldp-less as possible: Says the jsonld module 😺 |
@DiegoPino That's precisely the conundrum. The Drupal and LDP models a bit at odds. So long as we're ok with the fact that the JSONLD we generate for Media has the wrong subject w/r/t LDP, then it's reasonable to do this conversion elsewhere. |
And FWIW I'm totally ok with that. |
@dannylamb so I did this and it has no effect. I am guessing because you are only grabbing the media elements graph and by moving this triple from the media -> file to file -> media it is outside that graph. So its the same as removing it. |
Whoa! missed the @rosiel comment. reading now. |
Okay, I agree with @rosiel above. This is not working due to our serializing method, but even if it did it wouldn't necessarily make sense. A simple way to add this (not that it makes sense) would be to replace So But in Fedora it would become I'm not sure its worth the hassle though. |
This issue is from 2017, and I don't see any Using curl, I see it in the header for /media/x?_format=jsonld. To rewrite the original issue to reflect current behaviour:
|
@rosiel That link header is indeed accurate. As is your summary about the subject uri. The missing piece we should add on top is an To stick with your example, something like this in a jsonld GET response for a media
with a |
Ok, here's what we have now {
"@graph":[
{
"@id":"http:\/\/localhost:8000\/media\/1",
"@type":[
"http:\/\/pcdm.org\/models#File",
"http:\/\/pcdm.org\/use#OriginalFile"
],
"http:\/\/purl.org\/dc\/terms\/title":[
{
"@value":"Original Image",
"@language":"en"
}
],
"http:\/\/www.w3.org\/1999\/02\/22-rdf-syntax-ns#label":[
{
"@value":"Original Image",
"@language":"en"
}
],
"http:\/\/schema.org\/author":[
{
"@id":"http:\/\/localhost:8000\/user\/1"
}
],
"http:\/\/schema.org\/dateCreated":[
{
"@value":"2019-05-15T19:21:42+00:00",
"@type":"http:\/\/www.w3.org\/2001\/XMLSchema#dateTime"
}
],
"http:\/\/schema.org\/dateModified":[
{
"@value":"2019-05-15T19:22:12+00:00",
"@type":"http:\/\/www.w3.org\/2001\/XMLSchema#dateTime"
}
],
"http:\/\/www.ebu.ch\/metadata\/ontologies\/ebucore\/ebucore#height":[
{
"@value":"1018",
"@type":"http:\/\/www.w3.org\/2001\/XMLSchema#int"
}
],
"http:\/\/pcdm.org\/models#fileOf":[
{
"@id":"http:\/\/localhost:8000\/node\/1"
}
],
"http:\/\/www.ebu.ch\/metadata\/ontologies\/ebucore\/ebucore#hasMimeType":[
{
"@value":"image\/jpeg",
"@type":"http:\/\/www.w3.org\/2001\/XMLSchema#string"
}
],
"http:\/\/www.ebu.ch\/metadata\/ontologies\/ebucore\/ebucore#width":[
{
"@value":"904",
"@type":"http:\/\/www.w3.org\/2001\/XMLSchema#int"
}
],
"http:\/\/schema.org\/sameAs":[
{
"@value":"http:\/\/localhost:8000\/_flysystem\/fedora\/2019-05\/Flemming-Magic.jpg"
}
]
},
{
"@id":"http:\/\/localhost:8000\/user\/1",
"@type":[
"http:\/\/schema.org\/Person"
]
},
{
"@id":"http:\/\/localhost:8000\/node\/1",
"@type":[
"http:\/\/pcdm.org\/models#Object"
]
}
]
} Feels like we've batted around two ways of doing this
which isn't 100% over-the-top semantically correct, but is actually the more intuitive solution to folks coming from outside the ldp sphere. We'd then further process it in Crayfish/Alpaca to have it make sense in fedora and the triplestore.
This is the most semantically correct, but may come off as strange to the uninitiated. It would require less processing to get into the right shape for Fedora and the Triplestore, though. |
No. 2 makes sense. |
@rosiel your diagram in #662 (comment) is epic. Mind if I use it in my Open Repositories and iCamp slide decks, with full and genuflecting attribution? |
@mjordan Yes, but no genuflecting please, and it was a product of collaborating with @elizoller. [edit: also, unless things change by then, please include the fileOf arrow that gets crossed out and redirected to Drupal. ;) ] |
OK, will nix the genuflecting, cocredit @elizoller, and note updates. 😃 |
Right now a Media entity, when serialized, has itself as the subject and contains a triple of the form
<uri_of_media> iana:describes <uri_of_file>
, but really it needs to be<uri_of_file> iana:describedby <uri_of_media>
to be in line with how Fedora generates a LDP-RS for every LDP-NR that gets created. This amounts to adding a special case for Media entities in the jsonld module.Here's what it looks like now (non-relevant triples removed for brevity):
And here's what it should look like:
The text was updated successfully, but these errors were encountered: