This HTML5 document contains 31 embedded RDF statements represented using HTML+Microdata notation.

The embedded RDF content will be recognized by any processor of HTML5 Microdata.

PrefixNamespace IRI
dctermshttp://purl.org/dc/terms/
atomhttp://atomowl.org/ontologies/atomrdf#
foafhttp://xmlns.com/foaf/0.1/
n14http://vos.openlinksw.com/dataspace/services/wiki/
oplhttp://www.openlinksw.com/schema/attribution#
n2http://vos.openlinksw.com/dataspace/owiki/wiki/VOS/
dchttp://purl.org/dc/elements/1.1/
n10http://vos.openlinksw.com/dataspace/dav#
rdfshttp://www.w3.org/2000/01/rdf-schema#
n15http://rdfs.org/sioc/services#
siocthttp://rdfs.org/sioc/types#
n4http://vos.openlinksw.com/dataspace/person/dav#
n6http://vos.openlinksw.com/dataspace/owiki/wiki/
rdfhttp://www.w3.org/1999/02/22-rdf-syntax-ns#
n13http://vos.openlinksw.com/dataspace/owiki#
xsdhhttp://www.w3.org/2001/XMLSchema#
n12http://vos.openlinksw.com/dataspace/owiki/wiki/VOS/VirtSPARQLOptGuideEx1/sioc.
n18http://vos.openlinksw.com/dataspace/person/owiki#
siochttp://rdfs.org/sioc/ns#
Subject Item
n4:this
foaf:made
n2:VirtSPARQLOptGuideEx1
Subject Item
n10:this
sioc:creator_of
n2:VirtSPARQLOptGuideEx1
Subject Item
n14:item
n15:services_of
n2:VirtSPARQLOptGuideEx1
Subject Item
n13:this
sioc:creator_of
n2:VirtSPARQLOptGuideEx1
Subject Item
n6:VOS
sioc:container_of
n2:VirtSPARQLOptGuideEx1
atom:entry
n2:VirtSPARQLOptGuideEx1
atom:contains
n2:VirtSPARQLOptGuideEx1
Subject Item
n2:VirtSPARQLOptGuideEx1
rdf:type
atom:Entry sioct:Comment
dcterms:created
2017-06-13T05:47:08.584975
dcterms:modified
2017-06-13T05:47:08.584975
rdfs:label
VirtSPARQLOptGuideEx1
foaf:maker
n4:this n18:this
dc:title
VirtSPARQLOptGuideEx1
opl:isDescribedUsing
n12:rdf
sioc:has_creator
n10:this n13:this
sioc:content
%META:TOPICPARENT{name="VirtTipsAndTricksGuide"}% ---+Optimizing query performance using bif functions Example The following example describes how to optimize query performance using bif functions. 1 Suppose there is the following query, which performs very well on Virtuoso db with default indexes:: <verbatim> SELECT DISTINCT ?r (bif:concat(bif:search_excerpt(bif:vector('lego'), ?v2))) as ?_n_f_t_m_ex_ WHERE { { ?r ?v1 ?v2 . ?v2 bif:contains 'lego' . } UNION { ?r ?v1 ?v3 . ?v3 ?v4 ?v2 . ?v4 rdfs:subPropertyOf rdfs:label . ?v2 bif:contains 'lego' . } . } LIMIT 10 </verbatim> 1. Suppose also there should be hidden certain types from the user. For the purposes of this, to the end of the query is added <b>nao:userVisible</b> property: <verbatim> SELECT DISTINCT ?r (bif:concat(bif:search_excerpt(bif:vector('lego'), ?v2))) as ?_n_f_t_m_ex_ WHERE { { ?r ?v1 ?v2 . ?v2 bif:contains 'lego' . } UNION { ?r ?v1 ?v3 . ?v3 ?v4 ?v2 . ?v4 rdfs:subPropertyOf rdfs:label . ?v2 bif:contains 'lego' . } . ?r nao:userVisible "1"^^xsd:int . } LIMIT 10 </verbatim> 1. <b>The optimization:</b> 1. Replacing <b> "?r nao:userVisible 1"</b> with a <b>bif:exists</b> filter makes the query performance significant fast. 1. Add <b>Limit</b> to each UNION, because in this case no one side of union will needlessly generate data that does not fit LIMIT 10. 1. Some triples should reside in one graph, if this is applicable to the task in question. E.g. if both <b>?r ?v1 ?v2 .</b> and <b>?r nao:userVisible "1"^^xsd:int .</b> are supposed to be in same graph, then: <verbatim> ?r ?v1 ?v2 . ?v2 bif:contains 'lego' . -- can be replaced with: graph ?g { ?r ?v1 ?v2 . ?r nao:userVisible "1"^^xsd:int . ?v2 bif:contains 'lego' . } </verbatim> 1 Finally, here is the optimized query: <verbatim> PREFIX nao: <http://www.semanticdesktop.org/ontologies/2007/08/15/nao#> SELECT DISTINCT ?r (bif:concat(bif:search_excerpt(bif:vector('lego'), ?v2))) as ?_n_f_t_m_ex_ WHERE { { { SELECT DISTINCT ?r ?v2 WHERE { ?r ?v1 ?v2 . ?v2 bif:contains 'lego' . ?r nao:userVisible "1"^^xsd:int . } LIMIT 10 } } UNION { { SELECT DISTINCT ?r ?v2 WHERE { ?r ?v1 ?v3 . ?v3 ?v4 ?v2 . ?v4 rdfs:subPropertyOf rdfs:label . ?v2 bif:contains 'lego' . ?r nao:userVisible "1"^^xsd:int . } LIMIT 10 } } } LIMIT 10 </verbatim> ---++Related * [[VirtSPARQLOptGuide][Virtuoso SPARQL Optimization Guide]]
sioc:id
ebe61304d876f009587e8fff4a027603
sioc:link
n2:VirtSPARQLOptGuideEx1
sioc:has_container
n6:VOS
n15:has_services
n14:item
atom:title
VirtSPARQLOptGuideEx1
sioc:links_to
n2:VirtSPARQLOptGuide
atom:source
n6:VOS
atom:author
n4:this
atom:published
2017-06-13T05:47:08Z
atom:updated
2017-06-13T05:47:08Z
sioc:topic
n6:VOS
Subject Item
n2:VirtTipsAndTricksQueryOptimizerASSUME
sioc:links_to
n2:VirtSPARQLOptGuideEx1