Not logged in : Login

About: VirtTipsAndTricksGuideSPARQLBIIF     Goto   Sponge   NotDistinct   Permalink

An Entity of Type : atom:Entry, within Data Space : ods.openlinksw.com associated with source document(s)

AttributesValues
type
Date Created
Date Modified
label
  • VirtTipsAndTricksGuideSPARQLBIIF
maker
Title
  • VirtTipsAndTricksGuideSPARQLBIIF
isDescribedUsing
has creator
attachment
  • http://vos.openlinksw.com/wiki/main/VOS/VirtTipsAndTricksGuideSPARQLBIIF/db.png
content
  • %META:TOPICPARENT{name="VirtTipsAndTricksGuide"}% ---+ Does Virtuoso support an equivalent to the SPARQL 1.1 "<code>IF</code>" operator? As of this writing, Virtuoso does not yet support SPARQL 1.1, nor its "<code>IF</code>" operator. However, Virtuoso does currently support [[VOSArticleBISPARQL2][SPARQL-BI]], an extension of SPARQL 1.0 which was created before SPARQL 1.1 was ratified. This includes <code>[[http://docs.openlinksw.com/virtuoso/fn_either.html][bif:either]]</code>, an equivalent built-in function ("bif") which should enable the desired results to be obtained. ---++ Using <code>bif:either</code> For this example, a SPARQL query will be executed against the [[http://dbpedia.org/sparql][Virtuoso DBpedia SPARQL endpoint]] to retrieve the decimal longitude of the "NJ Devils' hometown" with cardinal direction (that is, East or West). The <code>bif:either</code> function is used to set the numeric result to positive (East) or negative (West). <verbatim> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX dbo: <http://dbpedia.org/ontology/> PREFIX dbp: <http://dbpedia.org/property/> SELECT ?team ( ( bif:either ( ?ew = 'W', -1, 1 ) ) * (?d + ( ( ( ?m * 60 ) + ?s ) / 3600.0 ) ) as ?v ) { ?team a dbo:HockeyTeam . ?team rdfs:label 'New Jersey Devils'@en . ?team dbp:city ?cityname . ?city rdfs:label ?cityname . ?city dbp:longd ?d ; dbp:longm ?m ; dbp:longs ?s ; dbp:longew ?ew . } </verbatim> [[http://lod.openlinksw.com/sparql?default-graph-uri=&query=%0D%0APREFIX++rdfs%3A++%3Chttp%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23%3E%0D%0APREFIX+++dbo%3A++%3Chttp%3A%2F%2Fdbpedia.org%2Fontology%2F%3E%0D%0APREFIX+++dbp%3A++%3Chttp%3A%2F%2Fdbpedia.org%2Fproperty%2F%3E%0D%0ASELECT++%3Fteam+%0D%0A++++++++%28+%0D%0A++++++++++%28+bif%3Aeither+%28+%3Few+%3D+%27W%27%2C+-1%2C+1+%29+%29+*+%28%3Fd+%2B+%28+%28+%28+%3Fm+*+60+%29+%2B+%3Fs+%29+%2F+3600.0+%29+%29+%0D%0A++++++++++as+%3Fv%0D%0A++++++++%29%0D%0A++%7B+%0D%0A++++%3Fteam++a+++++++++++dbo%3AHockeyTeam++++++++++.+%0D%0A++++%3Fteam++rdfs%3Alabel++%27New+Jersey+Devils%27%40en++.+%0D%0A++++%3Fteam++dbp%3Acity++++%3Fcityname+++++++++++++++.%0D%0A++++%3Fcity++rdfs%3Alabel++%3Fcityname+++++++++++++++.+%0D%0A++++%3Fcity++dbp%3Alongd+++%3Fd++++++++++++++++++++++%3B+%0D%0A+++++++++++dbp%3Alongm+++%3Fm++++++++++++++++++++++%3B+%0D%0A+++++++++++dbp%3Alongs+++%3Fs++++++++++++++++++++++%3B%0D%0A+++++++++++dbp%3Alongew++%3Few+++++++++++++++++++++.+%0D%0A++%7D++%0D%0A&should-sponge=&format=text%2Fhtml&CXML_redir_for_subjs=121&CXML_redir_for_hrefs=&timeout=15000&debug=on][View the results]] of the query execution on the [[http://lod.openlinksw.com][LOD]] instance. ---+++Related * [[VirtTipsAndTricksGuide][Virtuoso Tips and Tricks Collection]] * [[http://docs.openlinksw.com/virtuoso/rdfsparql.html#rdfsparqlimplementatioptragmas][Supported SPARQL-BI "define" pragmas]] * [[VOSArticleBISPARQL2][SPARQL-BI]]
id
  • dff30a614b1e228594ef9351751bcf22
link
has container
http://rdfs.org/si...ices#has_services
atom:title
  • VirtTipsAndTricksGuideSPARQLBIIF
links to
atom:source
atom:author
atom:published
  • 2017-06-13T05:42:49Z
atom:updated
  • 2017-06-13T05:42:49Z
topic
is made of
is container of of
is link of
is http://rdfs.org/si...vices#services_of of
is creator of of
is atom:entry of
is atom:contains of
Faceted Search & Find service v1.17_git132 as of May 12 2023


Alternative Linked Data Documents: iSPARQL | ODE     Content Formats:   [cxml] [csv]     RDF   [text] [turtle] [ld+json] [rdf+json] [rdf+xml]     ODATA   [atom+xml] [odata+json]     Microdata   [microdata+json] [html]    About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 07.20.3238 as of May 23 2023, on Linux (x86_64-generic-linux-glibc25), Single-Server Edition (15 GB total memory, 3 GB memory in use)
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2024 OpenLink Software