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/
n11http://vos.openlinksw.com/dataspace/owiki/wiki/VOS/VirtTipsAndTricksGuideRandomSampleAllTriples/sioc.
atomhttp://atomowl.org/ontologies/atomrdf#
foafhttp://xmlns.com/foaf/0.1/
n16http://lod.openlinksw.com/sparql?default-graph-uri=&query=SELECT+*+WHERE+%7B%3Fs+%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Felements%2F1.1%2Fdescription%3E+%3Fo%0D%0A++FILTER+%28+1+%3E+%3CSHORT_OR_LONG%3A%3Abif%3Arnd%3E++%2810%2C+%3Fs%2C++%3Fo%29%29++%7D%0D%0Alimit+100%0D%0A%0D%0A&should-sponge=&format=text%2Fhtml&CXML_redir_for_subjs=121&CXML_redir_for_hrefs=&timeout=15000&debug=
n5http://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/
n9http://vos.openlinksw.com/dataspace/dav#
rdfshttp://www.w3.org/2000/01/rdf-schema#
n4http://rdfs.org/sioc/services#
n12http://vos.openlinksw.com/dataspace/person/dav#
siocthttp://rdfs.org/sioc/types#
n8http://vos.openlinksw.com/dataspace/owiki/wiki/
rdfhttp://www.w3.org/1999/02/22-rdf-syntax-ns#
n20http://vos.openlinksw.com/dataspace/owiki#
n15http://lod.openlinksw.
xsdhhttp://www.w3.org/2001/XMLSchema#
n18http://vos.openlinksw.com/dataspace/person/owiki#
siochttp://rdfs.org/sioc/ns#
Subject Item
n12:this
foaf:made
n2:VirtTipsAndTricksGuideRandomSampleAllTriples
Subject Item
n9:this
sioc:creator_of
n2:VirtTipsAndTricksGuideRandomSampleAllTriples
Subject Item
n5:item
n4:services_of
n2:VirtTipsAndTricksGuideRandomSampleAllTriples
Subject Item
n20:this
sioc:creator_of
n2:VirtTipsAndTricksGuideRandomSampleAllTriples
Subject Item
n8:VOS
sioc:container_of
n2:VirtTipsAndTricksGuideRandomSampleAllTriples
atom:entry
n2:VirtTipsAndTricksGuideRandomSampleAllTriples
atom:contains
n2:VirtTipsAndTricksGuideRandomSampleAllTriples
Subject Item
n2:VirtTipsAndTricksGuideRandomSampleAllTriples
rdf:type
sioct:Comment atom:Entry
dcterms:created
2017-06-13T05:43:41.007753
dcterms:modified
2017-06-13T05:43:41.007753
rdfs:label
VirtTipsAndTricksGuideRandomSampleAllTriples
foaf:maker
n18:this n12:this
dc:title
VirtTipsAndTricksGuideRandomSampleAllTriples
opl:isDescribedUsing
n11:rdf
sioc:has_creator
n9:this n20:this
sioc:content
%META:TOPICPARENT{name="VirtTipsAndTricksGuide"}% ---+ What is the best method to get a random sample of all triples for a subset of all the resources of a SPARQL endpoint? The best method to get a random sample of all triples for a subset of all the resources of a SPARQL endpoint, is decimation in its original style: <verbatim> SELECT ?s ?p ?o FROM <some-graph> WHERE { ?s ?p ?o . FILTER ( 1 > <bif:rnd> (10, ?s, ?p, ?o) ) } </verbatim> By tweaking the first argument of <code>bif:rnd()</code> and the left side of the inequality, you can tweak the decimation ratio from 1/10 to any desired value. It is important to know that the SQL optimizer has a right to execute <code>bif:rnd (10)</code> only once at the beginning of the query, so we pass three additional arguments that can be known only when a table row is fetched. Thus, <code>bif:rnd (10, ?s, ?p, ?o)</code> is calculated for each and every row, and any given row is either returned or ignored independently from others. However, <code>bif:rnd (10, ?s, ?p, ?o)</code> contains a subtle inefficiency. In the RDF store, graph nodes are stored as numeric IRI IDs, and literal objects may be stored in a separate table. A SQL function call needs arguments of traditional SQL datatypes, so the query processor will extract the text of the IRI for each node and the full value for each literal object. That is a significant waste of time. The workaround is to tell the SPARQL front-end to omit redundant conversions of values, by use of the <code><nowiki>SHORT_OR_LONG</nowiki></code> tag, as shown here -- <verbatim> SELECT ?s ?p ?o FROM <some-graph> WHERE { ?s ?p ?o . FILTER ( 1 > <SHORT_OR_LONG::bif:rnd> (10, ?s, ?p, ?o)) } </verbatim> ---++ Live Example The following SPARQL Query shows random occurrences of <code>dc:description</code> on the [[http://lod.openlinksw.com][LOD Cloud Cache]] instance: <verbatim> SELECT * WHERE { ?s <http://purl.org/dc/elements/1.1/description> ?o FILTER ( 1 > <SHORT_OR_LONG::bif:rnd> (10, ?s, ?o)) } limit 100 </verbatim> View the results of the query execution [[http://lod.openlinksw.com/sparql?default-graph-uri=&query=SELECT+*+WHERE+%7B%3Fs+%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Felements%2F1.1%2Fdescription%3E+%3Fo%0D%0A++FILTER+%28+1+%3E+%3CSHORT_OR_LONG%3A%3Abif%3Arnd%3E++%2810%2C+%3Fs%2C++%3Fo%29%29++%7D%0D%0Alimit+100%0D%0A%0D%0A&should-sponge=&format=text%2Fhtml&CXML_redir_for_subjs=121&CXML_redir_for_hrefs=&timeout=15000&debug=on][here]]. ---++ Related * [[VirtTipsAndTricksGuide][Virtuoso Tips and Tricks Collection]]
sioc:id
21514efa8a77ba434ecf565a4284b970
sioc:link
n2:VirtTipsAndTricksGuideRandomSampleAllTriples
sioc:has_container
n8:VOS
n4:has_services
n5:item
atom:title
VirtTipsAndTricksGuideRandomSampleAllTriples
sioc:links_to
n15:com n16:on
atom:source
n8:VOS
atom:author
n12:this
atom:published
2017-06-13T05:43:41Z
atom:updated
2017-06-13T05:43:41Z
sioc:topic
n8:VOS