“xsd:duration” supported in snap -SPARQL ?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

“xsd:duration” supported in snap -SPARQL ?

Dipali
Hello,
 
I was trying to use  “xsd:duration” command in the query  get new dates around a specific date with specific duration.
 
For example in my query I used “?date” and added 2 days  to  it to know  what is the date .
 
As values command is not  supported in snap SPARQL, I added directly  2 days into ?date using BIND command.
But can see the result as blank.
 
As the ?date does not have time zone, I tried to use this with ?nowTime which contains the time zone ,but its not working.
 
I want to know if duration format is supported with snap SPARQL ?
 
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX eg:<http://www.semanticweb.org/dt73315/ontologies/2017/1/untitled-ontology-86#>
 
SELECT  ?eventid  ?date ?measurement ?Value ?measurementTime   ?newdate ?end
WHERE{ ?eventid  eg:hasFaultCode  ?dtccode;
                               eg:date ?date;
                     eg:belongsTo ?machineid.
        ?machineid  eg:hasCategory ?machinecategory;
                              eg:hasMeasurement  ?measurement;
                         eg:hasNativePin  ?Pin.
                         ?measurement eg:hasValue ?Value;
                                                   eg:hasMeasurementTime ?measurementTime.
                 ?dtccode eg:hasFaultCategory <http://www.semanticweb.org/dt73315/ontologies/2017/1/untitled-ontology-86#HydraulicOilTemperature>.           
 
 
  #values ?duration { "P2DT0H0M0.000S"^^xsd:duration }
 
  BIND((NOW()) AS ?nowTime)
  BIND( (?nowTime + "P2DT0H0M0.000S")  AS ?newdate)
 
  BIND( (?date + "P2DT0H0M0.000S")  AS ?end)                             
                                              
                    }  
 ORDER BY ?measurement




Thanks,
Dipali
 

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: “xsd:duration” supported in snap -SPARQL ?

Matthew Horridge-2
Administrator
Hi Dipali,

No, it’s not supported as it’s not one of the OWL 2 datatypes.  Please see my previous email to your other question, which fixes your empty values.

Cheers,

Matthew


On 6 Nov 2017, at 04:23, Dipali <[hidden email]> wrote:

Hello,
 
I was trying to use  “xsd:duration” command in the query  get new dates around a specific date with specific duration.
 
For example in my query I used “?date” and added 2 days  to  it to know  what is the date .
 
As values command is not  supported in snap SPARQL, I added directly  2 days into ?date using BIND command.
But can see the result as blank.
 
As the ?date does not have time zone, I tried to use this with ?nowTime which contains the time zone ,but its not working.
 
I want to know if duration format is supported with snap SPARQL ?
 
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX eg:<http://www.semanticweb.org/dt73315/ontologies/2017/1/untitled-ontology-86#>
 
SELECT  ?eventid  ?date ?measurement ?Value ?measurementTime   ?newdate ?end
WHERE{ ?eventid  eg:hasFaultCode  ?dtccode;
                               eg:date ?date;
                     eg:belongsTo ?machineid.
        ?machineid  eg:hasCategory ?machinecategory;
                              eg:hasMeasurement  ?measurement;
                         eg:hasNativePin  ?Pin.
                         ?measurement eg:hasValue ?Value;
                                                   eg:hasMeasurementTime ?measurementTime.
                 ?dtccode eg:hasFaultCategory <http://www.semanticweb.org/dt73315/ontologies/2017/1/untitled-ontology-86#HydraulicOilTemperature>.           
 
 
  #values ?duration { "P2DT0H0M0.000S"^^xsd:duration }
 
  BIND((NOW()) AS ?nowTime)
  BIND( (?nowTime + "P2DT0H0M0.000S")  AS ?newdate)
 
  BIND( (?date + "P2DT0H0M0.000S")  AS ?end)                             
                                              
                    }  
 ORDER BY ?measurement

<e785b.1509971007.64.web.rediffmail.com.png>



Thanks,
Dipali
 
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user


_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: “xsd:duration” supported in snap -SPARQL ?

Dipali
Thanks Matthew for updates.

Thanks,
Dipali

From: Matthew Horridge <[hidden email]>
Sent: Mon, 06 Nov 2017 22:59:00
To: User support for WebProtege and Protege Desktop <[hidden email]>
Cc: protege-user <[hidden email]>
Subject: Re: [protege-user] “xsd:duration” supported in snap -SPARQL ?

Hi Dipali,
 
No, it’s not supported as it’s not one of the OWL 2 datatypes.  Please see my previous email to your other question, which fixes your empty values.
 
Cheers,
 
Matthew
 
 
On 6 Nov 2017, at 04:23, Dipali <[hidden email]> wrote:
 
Hello,
 
I was trying to use  “xsd:duration” command in the query  get new dates around a specific date with specific duration.
 
For example in my query I used “?date” and added 2 days  to  it to know  what is the date .
 
As values command is not  supported in snap SPARQL, I added directly  2 days into ?date using BIND command.
But can see the result as blank.
 
As the ?date does not have time zone, I tried to use this with ?nowTime which contains the time zone ,but its not working.
 
I want to know if duration format is supported with snap SPARQL ?
 
PREFIX owl: <<a href="http://www.w3.org/2002/07/owl# A2dcbVFsBiEBOlBvUDE=" rel="external" target="_blank">http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX eg:<<a href="http://www.semanticweb.org/dt73315/ontologies/2017/1/untitled-ontology-86# BGAGN1VoBCMLMFVqUzI=" rel="external" target="_blank">http://www.semanticweb.org/dt73315/ontologies/2017/1/untitled-ontology-86#>
 
SELECT  ?eventid  ?date ?measurement ?Value ?measurementTime   ?newdate ?end
WHERE{ ?eventid  eg:hasFaultCode  ?dtccode;
                               eg:date ?date;
                     eg:belongsTo ?machineid.
        ?machineid  eg:hasCategory ?machinecategory;
                              eg:hasMeasurement  ?measurement;
                         eg:hasNativePin  ?Pin.
                         ?measurement eg:hasValue ?Value;
                                                   eg:hasMeasurementTime ?measurementTime.
                 ?dtccode eg:hasFaultCategory <http://www.semanticweb.org/dt73315/ontologies/2017/1/untitled-ontology-86#HydraulicOilTemperature>.           
 
 
  #values ?duration { "P2DT0H0M0.000S"^^xsd:duration }
 
  BIND((NOW()) AS ?nowTime)
  BIND( (?nowTime + "P2DT0H0M0.000S")  AS ?newdate)
 
  BIND( (?date + "P2DT0H0M0.000S")  AS ?end)                             
                                              
                    }  
 ORDER BY ?measurement

[hidden email]"><e785b.1509971007.64.web.rediffmail.com.png>



Thanks,
Dipali
 
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user