MoreQueries

From symbolicdata
Jump to: navigation, search

More SPARQL Queries

On this page we give more examples of SPARQL queries.

Please post all questions about using SymbolicData Tools and Data on the SymbolicData Mailing List

See QuickStart for a more detailed explanation of SPARQL Queries or any of the SPARQL tutorials or references at

Examples from TestSets Metadata (Normaliz Project)

List

  • label
  • rank
  • number of columns
  • number of rows
  • number of extreme rays
  • number of Hilbert Basis elements
  • external link to the Normaliz Database
  • link to the SD OtherResources TestSets collection

for the "graph examples" from the Normaliz test suite.

 PREFIX sd: <http://symbolicdata.org/Data/Model#>
 select 
 distinct ?l ?r ?nc ?nr ?ner ?nhbe ?npb ?nsb
 from <http://symbolicdata.org/Data/TestSets/>
 where {
 ?p a sd:TestSet ; rdfs:label ?l . 
 optional { ?p sd:hasRank ?r . }	
 optional { ?p sd:numberOfColumns ?nc . }		
 optional { ?p sd:numberOfRows ?nr . }	
 optional { ?p sd:hasNumberOfExtremeRays ?ner . }		
 optional { ?p sd:hasNumberOfHilbertBasisElements ?nhbe . }		
 optional { ?p sd:hasNormalizPrimaryBase ?npb . }
 optional { ?p sd:hasNormalizSDBase ?nsb . }
 filter regex(?p, "graph")
 }
 order by ?l
 
 Run this query

Examples from Polytopes Metadata

List for all Fano Polytopes

with lattice volume < 100 and at most 7 facets.

  PREFIX sd: <http://symbolicdata.org/Data/Model#> 
  select ?a ?v ?cd ?nfc ?fn
  from <http://symbolicdata.org/Data/FanoPolytopes/>
  where {
  ?a a sd:FanoPolytope ;
  sd:cone_dim ?cd ; sd:n_facets ?nfc ; sd:hasFileName ?fn ; 
  sd:lattice_volume ?v . 
  filter ((xsd:integer(?v)<100) and (xsd:integer(?nfc)<7))
  }
  
 Run this query

List

  • number of nodes
  • number of vertices
  • external link to polymake file

for all Birkhoff Polytopes with 4 nodes and at most 20 vertices ordered by descending number of vertices.

  PREFIX sd: <http://symbolicdata.org/Data/Model#> 
  select ?n ?v ?fn
  from <http://symbolicdata.org/Data/BirkhoffPolytopes/>
  where {
  ?a a sd:BirkhoffPolytope ;
  sd:hasNodes ?n ; sd:hasVertices ?v; sd:hasPolymakeFile ?fn . 
  filter ((xsd:integer(?n)=4) and (xsd:integer(?v)<=20))
  }
  order by desc(xsd:integer(?v))
  
 Run this query

Examples from Transitive Groups Metadata

List

  • name in the Group database
  • order
  • external link to the entry in the Group database

for all nilpotent transitive groups of order 32.

  PREFIX sd: <http://symbolicdata.org/Data/Model#> 
  select ?n ?o ?url
  from <http://symbolicdata.org/Data/TransitiveGroups/>
  where {
  ?a a sd:TransitiveGroup ; 
  sd:hasProperty sd:nilpotent; sd:hasName ?n ; sd:hasOrder ?o ;
  sd:hasURL ?url .  
  filter (xsd:integer(?o)=32)
  }

 Run this query

Number of nilpotent transitive groups (order, count) in the database of given order.

  PREFIX sd: <http://symbolicdata.org/Data/Model#> 
  select ?o as ?order count(?a) as ?count
  from <http://symbolicdata.org/Data/TransitiveGroups/>
  where {
  ?a a sd:TransitiveGroup ; 
  sd:hasProperty sd:nilpotent; sd:hasOrder ?o .  
  }

 Run this query

Inspect the special examples (uri, external link to the Group Database) of a nilpotent group of order 162.

  PREFIX sd: <http://symbolicdata.org/Data/Model#> 
  select ?a ?url
  from <http://symbolicdata.org/Data/TransitiveGroups/>
  where {
  ?a a sd:TransitiveGroup ; sd:hasURL ?url; 
  sd:hasProperty sd:nilpotent; sd:hasOrder 162 .  
  }

 Run this query