Giter Site home page Giter Site logo

Comments (5)

dr-shorthair avatar dr-shorthair commented on July 23, 2024

I'm using the SPARQL engine built in to TopBraid Composer.
Result for targetAge 65. - five eras

[era] rank begin end name targetAge
isc:Cenozoic rank:Era 66.0 0.0 Cenozoic Era 65.
isc:Danian rank:Age 66.0 61.6 Danian Age 65.
isc:Paleocene rank:Epoch 66.0 56 Paleocene Epoch 65.
isc:Paleogene rank:Period 66.0 23.03 Paleogene Period 65.
isc:Phanerozoic rank:Eon 541.0 0.0 Phanerozoic Eon 65.

for 66. - one era

isc:Phanerozoic rank:Eon 541.0 0.0 Phanerozoic Eon 66.

and for 67. - five eras again

isc:Cretaceous rank:Period 145.0 66.0 Cretaceous Period 67.
isc:Maastrichtian rank:Age 72.1 66.0 Maastrichtian Age 67.
isc:Mesozoic rank:Era 251.902 66.0 Mesozoic Era 67.
isc:Phanerozoic rank:Eon 541.0 0.0 Phanerozoic Eon 67.
isc:UpperCretaceous rank:Epoch 100.5 66.0 Upper Cretaceous Epoch 67.

However, I notice that while you cast 66. to xsd:decimal, the data actually has a mixture of xsd:float and time:Number (I could probably do better ...). TopBraid appears to be handling the mixed-type comparisons OK (dunno if the SPARQL spec says anything about this), but looks like Blazegraph doesn't know what to do with time:Number (two of the eras in the first and last have one or other limit where the literal is time:Number, and this includes isc:Phanerozoic which is the single 66. result.

from geologictimescale.

fils avatar fils commented on July 23, 2024

Simon,
Ugh.. the twisted world of SPARQL implementations.. not the first time it has caused me pain.

I'll update to the latest version (2.1.5) of blazegraph and try that. If the results are the same I will reference this issue over in the blazegraph repo at https://github.com/blazegraph/database

Unless 2.1.5 fixes it though I will likely have to search around for another triple store as I suspect it would take a while for this to propagate through. I could go back to Virtuoso I guess.

from geologictimescale.

fils avatar fils commented on July 23, 2024

same exact behavior with 2.1.5 SNAPSHOT

from geologictimescale.

fils avatar fils commented on July 23, 2024

I think this issue can be closed!

prefix gts: <http://resource.geosciml.org/ontology/timescale/gts#> 
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX time: <http://www.w3.org/2006/time#>
SELECT *
WHERE {
               ?era gts:rank ?rank .
               ?era time:hasBeginning/time:inTemporalPosition/time:numericPosition ?begin .
               ?era time:hasEnd/time:inTemporalPosition/time:numericPosition ?end .
               ?era rdfs:label ?name .
               BIND ( "65."^^xsd:decimal AS ?targetAge )
               FILTER ( ?targetAge > xsd:decimal(?end) )
               FILTER ( ?targetAge < xsd:decimal(?begin) )
  
}

results in

era	rank	begin	end	name	targetAge
<http://resource.geosciml.org/classifier/ics/ischart/Cenozoic>	<http://resource.geosciml.org/ontology/timescale/rank/Era>	66	0	Cenozoic Era	65.
<http://resource.geosciml.org/classifier/ics/ischart/Phanerozoic>	<http://resource.geosciml.org/ontology/timescale/rank/Eon>	541	0	Phanerozoic Eon	65.
<http://resource.geosciml.org/classifier/ics/ischart/Danian>	<http://resource.geosciml.org/ontology/timescale/rank/Age>	66	61.6	Danian Age	65.
<http://resource.geosciml.org/classifier/ics/ischart/Paleocene>	<http://resource.geosciml.org/ontology/timescale/rank/Epoch>	66	56	Paleocene Epoch	65.
<http://resource.geosciml.org/classifier/ics/ischart/Paleogene>	<http://resource.geosciml.org/ontology/timescale/rank/Period>	66	23.03	Paleogene Period	65.

and 66.

prefix gts: <http://resource.geosciml.org/ontology/timescale/gts#> 
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX time: <http://www.w3.org/2006/time#>
SELECT *
WHERE {
               ?era gts:rank ?rank .
               ?era time:hasBeginning/time:inTemporalPosition/time:numericPosition ?begin .
               ?era time:hasEnd/time:inTemporalPosition/time:numericPosition ?end .
               ?era rdfs:label ?name .
               BIND ( "66."^^xsd:decimal AS ?targetAge )
               FILTER ( ?targetAge > xsd:decimal(?end) )
               FILTER ( ?targetAge < xsd:decimal(?begin) )
  
}

results in

era	rank	begin	end	name	targetAge
<http://resource.geosciml.org/classifier/ics/ischart/Phanerozoic>	<http://resource.geosciml.org/ontology/timescale/rank/Eon>	541	0	Phanerozoic Eon	66.
  1. also results in 5 results which I think you said was correct.

Thanks Simon!

from geologictimescale.

dr-shorthair avatar dr-shorthair commented on July 23, 2024

In the dataset all numeric values are encoded as xsd:decimal.

In OWL-Time proposal is to remove time:Number and replace all uses with xsd:decimal

from geologictimescale.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.