Re: type coercion question

Yes, I meant to say something like this...

This is only possible because of the uniqueness of the outer properties
though.

Another view of the same answer provided:

https://v.jsld.org/3cyA6N1XbUnEyubBUPsEixA1a3icoEzZY1F7j7NU8qvhikQRWc9aAjLNtr7h8fTP9DfZjuTXgR2GwZsgDvkDQXQeE1WLLMyUzip4pgYhQr71V62VxWPiRk6dogTWrtwCvBSC6iqhYiey7ZE6n3VREEo8wKTfLh6Eck87ySEW3ZarhfTy1QEqesyqovu4kHb8r4Ra9pi4FM6qT6bLxJBRjuVBzf2r8ax8bKdsCpD7SrbC58NiypiCvbg6qnUgQQzBN3yMatFh6KBFVNFsRqtpbqd8nEg5YN

OS

On Thu, Nov 17, 2022 at 8:24 AM Roman Evstifeev <someuniquename@gmail.com>
wrote:

> On Thu, 17 Nov 2022 at 06:24, Paul Tyson <phtyson@sbcglobal.net> wrote:
> >
> > I have a property that can take any type of RDF term as a value.
> >
> > {
> >      "@context": {
> >      "ex": "http://example.org/ns/",
> >      },
> >      "ex:thing1": {"ex:foo": 1},
> >      "ex:thing2": {"ex:foo": "a string"},
> >      "ex:thing3": {"ex:foo": "http://example.org/yugo"}
> >      "ex:thing4": {"ex:foo": "2022-11-16T21:04:41"}
> > }
> >
> > Is there any way to construct the context to make this come out in RDF
> like:
> >
> > _:b0 <http://example.org/ns/thing1> _:b1 .
> > _:b0 <http://example.org/ns/thing2> _:b2 .
> > _:b0 <http://example.org/ns/thing3> _:b3 .
> > _:b0 <http://example.org/ns/thing4> _:b4 .
> > _:b1 <http://example.org/ns/foo>
> > "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
> > _:b2 <http://example.org/ns/foo> "a string" .
> > _:b3 <http://example.org/ns/foo> <http://example.org/yugo> .
> > _:b4 <http://example.org/ns/foo>
> > "2022-11-16T21:04:41"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
> >
> > Thanks and regards,
> > --Paul
> >
> >
>
> You can use property-scoped context:
>
> {
>      "@context": {
>        "ex": "http://example.org/ns/",
>        "xsd": "http://www.w3.org/2001/XMLSchema#",
>        "ex:thing3": {
>          "@context": {
>            "ex:foo": {
>                "@type": "@id"
>            }
>          }
>        },
>        "ex:thing4": {
>          "@context": {
>            "ex:foo": {
>              "@type": "xsd:dateTime"
>            }
>          }
>        }
>
>      },
>      "ex:thing1": {"ex:foo": 1},
>      "ex:thing2": {"ex:foo": "a string"},
>      "ex:thing3": {"ex:foo": "http://example.org/yugo"},
>      "ex:thing4": {"ex:foo": "2022-11-16T21:04:41"}
> }
>
> json-ld playground: https://tinyurl.com/dwpf68db
>
>

-- 
*ORIE STEELE*
Chief Technical Officer
www.transmute.industries

<https://www.transmute.industries>

Received on Thursday, 17 November 2022 15:22:51 UTC