You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Erich Bremer <er...@ebremer.com> on 2014/11/14 15:26:29 UTC
JSON-LD serializations
Jena converts numbers out as strings when serializing out to JSON-LD. I'm
assuming this has something to do with the 53-bit issues. Is there a way to
modify this behavior? - Erich
Duration comparison question
Posted by Arthur Keen <aa...@yahoo.com.INVALID>.
When I compare 28 days to 1 month and 365 days to 1 year in Fuseki 1.1.1 , I get the following:
SELECT ("P28D"^^<http://www.w3.org/2001/XMLSchema#duration> ="P1M"^^<http://www.w3.org/2001/XMLSchema#duration> as ?same) {}
--------
| same |
========
| true |
--------
SELECT ("P365D"^^<http://www.w3.org/2001/XMLSchema#duration> ="P1Y"^^<http://www.w3.org/2001/XMLSchema#duration> as ?same) {}
--------
| same |
========
| true |
--------
Shouldn't this be indeterminate in both cases?
Best regards
Arthur
3.2.6.2 Order relation on duration
The following table shows the strongest relationship that can be determined between example durations. The symbol <> means that the order relation is indeterminate. Note that because of leap-seconds, a seconds field can vary from 59 to 60. However, because of the way that addition is defined in Adding durations to dateTimes (§E), they are still totally ordered.
Relation
P1Y > P364D <> P365D <> P366D < P367D
P1M > P27D <> P28D <> P29D <> P30D <> P31D < P32D
P5M > P149D <> P150D <> P151D <> P152D <> P153D < P154D
Implementations are free to optimize the computation of the ordering relationship. For example, the following table can be used to compare durations of a small number of months against days.
Months 1 2 3 4 5 6 7 8 9 10 11 12 13 ...
Days Minimum 28 59 89 120 150 181 212 242 273 303 334 365 393 ...
Maximum 31 62 92 123 153 184 215 245 276 306 337 366 397 ...
Re: JSON-LD serializations
Posted by Erich Bremer <er...@ebremer.com>.
Hi Andy,
Jena 2.12.1
RDF-Turtle
@prefix : <http://crux.bmi.stonybrookmedicine.edu/dev/> .
@prefix x: <http://www.w3.org/2001/XMLSchema/> .
<urn:uuid:2e1891a8-6add-4f6e-856f-ff20edc6b310>
:FSD1 0.775643 ;
:FSD2 0.130934 ;
:FSD3 0.031545 ;
:FSD4 0.013257 ;
:FSD5 0.005997 ;
:FSD6 0.004298 ;
:HematoxlyinKurtosis "-NaN"^^x:double .
JSON-LD
{
"@graph" : [
{
"@id" : "urn:uuid:2e1891a8-6add-4f6e-856f-ff20edc6b310",
"FSD1" : "0.775643",
"FSD2" : "0.130934",
"FSD3" : "0.031545",
"FSD4" : "0.013257",
"FSD5" : "0.005997",
"FSD6" : "0.004298"}],
"@context" : {
"FSD2" : {
"@id" : "http://crux.bmi.stonybrookmedicine.edu/dev/FSD2",
"@type" : "http://www.w3.org/2001/XMLSchema#decimal"
},
"FSD5" : {
"@id" : "http://crux.bmi.stonybrookmedicine.edu/dev/FSD5",
"@type" : "http://www.w3.org/2001/XMLSchema#decimal"
},
"FSD6" : {
"@id" : "http://crux.bmi.stonybrookmedicine.edu/dev/FSD6",
"@type" : "http://www.w3.org/2001/XMLSchema#decimal"
},
"FSD3" : {
"@id" : "http://crux.bmi.stonybrookmedicine.edu/dev/FSD3",
"@type" : "http://www.w3.org/2001/XMLSchema#decimal"
},
"FSD1" : {
"@id" : "http://crux.bmi.stonybrookmedicine.edu/dev/FSD1",
"@type" : "http://www.w3.org/2001/XMLSchema#decimal"
},
"FSD4" : {
"@id" : "http://crux.bmi.stonybrookmedicine.edu/dev/FSD4",
"@type" : "http://www.w3.org/2001/XMLSchema#decimal"
},
":HematoxlyinKurtosis" : {
"@type" : "x:double",
"@value" : "-NaN"
},
"" : "http://crux.bmi.stonybrookmedicine.edu/dev/"
}
}
- Erich
On Fri, 14 Nov 2014 15:27:18 +0000
Andy Seaborne <an...@apache.org> wrote:
> On 14/11/14 14:26, Erich Bremer wrote:
>> Jena converts numbers out as strings when serializing
>>out to JSON-LD.
>> I'm assuming this has something to do with the 53-bit
>>issues. Is there
>> a way to modify this behavior? - Erich
>>
>>
> Complete, minimal example? Version? Because it does
>for me when it's possible. 53-bit isms being one one of
>the issues. Preserving datatype is another.
>
> TTL:
> <http://example/> <http://example/p> 123 .
>
> JSON-LD:
> {
> "@id" : "http://example/",
> "http://example/p" : 123,
> "@context" : {
> "p" : {
> "@id" : "http://example/p",
> "@type" :
>"http://www.w3.org/2001/XMLSchema#integer"
> }
> }
> }
>
>
> Andy
Re: JSON-LD serializations
Posted by Andy Seaborne <an...@apache.org>.
On 14/11/14 14:26, Erich Bremer wrote:
> Jena converts numbers out as strings when serializing out to JSON-LD.
> I'm assuming this has something to do with the 53-bit issues. Is there
> a way to modify this behavior? - Erich
>
>
Complete, minimal example? Version? Because it does for me when it's
possible. 53-bit isms being one one of the issues. Preserving datatype
is another.
TTL:
<http://example/> <http://example/p> 123 .
JSON-LD:
{
"@id" : "http://example/",
"http://example/p" : 123,
"@context" : {
"p" : {
"@id" : "http://example/p",
"@type" : "http://www.w3.org/2001/XMLSchema#integer"
}
}
}
Andy