- From: James Hudson <jameshudson3010@gmail.com>
- Date: Fri, 1 May 2020 14:40:39 -0400
- To: Robert Sanderson <azaroth42@gmail.com>
- Cc: Linked JSON <public-linked-json@w3.org>
- Message-ID: <CAEUVO9FaOWp3vn5_KjbQ_iHM5zkoXCUQ74i0kPC4MutBaEQjFg@mail.gmail.com>
Hello Robert,
Thank you for confirming what I suspected.
However, as I understand it, doing this is possible using
https://www.w3.org/TR/json-ld11-framing
But, it is unclear what my frame should look like.
Ideally, I would like to be able to start with:
{
"@context": {
"ex": "http://example.com/",
"yyyy": "ex:yyyy",
"name": "ex:name",
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
"sch": "http://schema.org/",
"xml": "http://www.w3.org/XML/1998/namespace",
"xsd": "http://www.w3.org/2001/XMLSchema#"
},
"yyyy": {
"name": "my name"
}
}
and end up with the desired result. I just need two "@types" inserted in
this simple example.
If anyone can provide any assistance, it would be appreciated as I continue
to read about framing.
Regards,
James
On Fri, May 1, 2020 at 1:14 PM Robert Sanderson <azaroth42@gmail.com> wrote:
>
>
> Hi James,
>
> You are not missing anything, that's not possible using JSON-LD.
>
> There have been several requests for this sort of functionality, but it
> falls out of scope as it creates new data or transforms data, which is out
> of scope of the functionality of a context document.
> For example, these issues were rejected for this reason:
>
> https://github.com/w3c/json-ld-syntax/issues?q=+is%3Aissue+label%3A%22out+of+scope%3A+transformation%22+
>
> Rob
>
>
> On Fri, May 1, 2020 at 6:58 AM James Hudson <jameshudson3010@gmail.com>
> wrote:
>
>> Hello,
>>
>> Either this is not possible or I am missing something obvious. I am not
>> sure which.
>>
>> I have the following json-ld document:
>>
>> {
>> "@id": "ex:Bobe",
>> "@type": "ex:MyType",
>> "@context": {
>> "ex": "http://example.com/",
>> "yyyy": "ex:yyyy",
>> "name": "ex:name",
>> "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
>> "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
>> "sch": "http://schema.org/",
>> "xml": "http://www.w3.org/XML/1998/namespace",
>> "xsd": "http://www.w3.org/2001/XMLSchema#"
>> },
>> "yyyy": {
>> "@type": "ex:XXXX",
>> "name": "my name"
>> }
>> }
>>
>> which has the following RDF representation:
>> ( using https://github.com/RDFLib/rdflib )
>>
>> @prefix ex: <http://example.com/> .
>> @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
>> @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
>> @prefix sch: <http://schema.org/> .
>> @prefix xml: <http://www.w3.org/XML/1998/namespace> .
>> @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
>>
>> ex:Bobe a ex:MyType ;
>> ex:yyyy [ a ex:XXXX ;
>> ex:name "my name" ] .
>>
>> What I would like to be able to do is write "yyyy": { ... } as
>>
>> "yyyy": {
>> "name": "my name"
>> }
>>
>> and have "@type": "ex:XXXX" specified in the "@context".
>>
>> Is this possible?
>>
>> What I have tried:
>>
>> {
>> "@id": "ex:Bobe",
>> "@type": "ex:MyType",
>> "@context": {
>> "ex": "http://example.com/",
>> "yyyy": {
>> "@id": "ex:yyyy",
>> "@type": "ex:XXXX"
>> },
>> "name": "ex:name",
>> "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
>> "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
>> "sch": "http://schema.org/",
>> "xml": "http://www.w3.org/XML/1998/namespace",
>> "xsd": "http://www.w3.org/2001/XMLSchema#"
>> },
>> "yyyy": {
>> "name": "my name"
>> }
>> }
>>
>> which has the following RDF representation:
>> ( using https://github.com/RDFLib/rdflib )
>>
>> @prefix ex: <http://example.com/> . a
>> @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
>> @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
>> @prefix sch: <http://schema.org/> .
>> @prefix xml: <http://www.w3.org/XML/1998/namespace> .
>> @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
>>
>> ex:Bobe a ex:MyType ;
>> ex:yyyy [ ex:name "my name" ] .
>>
>> The N-Quad representation on the JSON-LD Playground is:
>>
>> <http://example.com/Bobe> <http://example.com/yyyy> _:b0 .
>> <http://example.com/Bobe> <
>> http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <
>> http://example.com/MyType> .
>> _:b0 <http://example.com/name> "my name" .
>>
>>
>> The "@type" information is lost.
>>
>> Regards,
>> James
>>
>>
>>
>
> --
> Rob Sanderson
> Semantic Architect
> The Getty Trust
> Los Angeles, CA 90049
>
Received on Friday, 1 May 2020 18:41:05 UTC