Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT COUNT(DISTINCT ?instance2) FROM <http://dbpedia.org> {
- ?instance2 rdf:type/rdfs:subClassOf* ?class2.
- FILTER (?class2 = <http://dbpedia.org/ontology/Place>)
- }
- ============================================================================================================
- SELECT COUNT(DISTINCT ?instance2) FROM <http://dbpedia.org> {
- ?subclass rdfs:subClassOf* ?class2.
- ?instance2 rdf:type ?subclass.
- FILTER (?class2 = <http://dbpedia.org/ontology/Place>)
- }
- ============================================================================================================
- SELECT ?classuri (COUNT(DISTINCT ?instance) AS ?total) WHERE
- { GRAPH <http://xlore.org> {
- ?subclass owl:SubClassOf ?classuri OPTION (TRANSITIVE, T_DISTINCT,T_NO_CYCLES, T_MIN(0)).
- ?instance owl:InstanceOf ?subclass.
- FILTER (?classuri = <http://xlore.org/concept/375>)
- }}
- LIMIT 10
- SELECT ?s {
- ?s rdfs:subClassOf ?o OPTION (TRANSITIVE, T_IN(?s), T_OUT(?o), T_DISTINCT,T_NO_CYCLES, T_MIN(0)).
- FILTER(?o = <http://dbpedia.org/ontology/MotorsportRacer>)
- }
- ========================================================================================================================
- Results: DBpedia interlinking, Query improvement, Wikidata
- https://github.com/nicolas-fricke/semmul2014/wiki/Results:-DBpedia-interlinking,-Query-improvement,-Wikidata
- ========================================================================================================================
- ARQ - Property Paths¶
- https://jena.apache.org/documentation/query/property_paths.html
- Some forms of limited inference are possible as well. For example: all types and supertypes of a resource:
- { <http://example/> rdf:type/rdfs:subClassOf* ?type }
- ========================================================================================================================
- Combine multiple sets of rows in SPARQL
- http://stackoverflow.com/questions/11026790/combine-multiple-sets-of-rows-in-sparql
- SELECT (COUNT(?s) AS ?distinct)
- ?propset
- (group_concat(?count; separator = \"\\t\") AS ?counts)
- {
- SELECT ?s
- (group_concat(?p; separator = \" \") AS ?propset)
- (group_concat(?c; separator = \" \") AS ?count
- {
- ?s ?p ?c
- } GROUP BY ?s ORDER BY ?s
- } GROUP BY ?propset ORDER BY ?propset
- ========================================================================================================================
- How to eleminate redundancy from My Sparql Query against DBPedia End Point ?
- http://answers.semanticweb.com/questions/11804/how-to-eleminate-redundancy-from-my-sparql-query-against-dbpedia-end-point
- PREFIX db: <http://dbpedia.org/ontology/>
- PREFIX property: <http://dbpedia.org/property/>
- PREFIX position:<http://www.w3.org/2003/01/geo/wgs84_pos#>
- SELECT ?CompanyName (sql:SAMPLE(?Company_Name) AS ?Name) (sql:SAMPLE(?Foundation_URI) AS ?Foundation_URI)
- (sql:SAMPLE(?Website) AS ?Website) (sql:SAMPLE(?LocationCity) AS ?Location)
- (sql:SAMPLE(?Foundation_Name) AS ?Foundation_Name) (sql:SAMPLE(?Latitude) AS ?Latitude)
- (sql:SAMPLE(?Longitude) AS ?Longitude) (sql:SAMPLE(?Population) AS ?Population)
- WHERE
- {
- ?CompanyName a db:Company .
- ?CompanyName property:name ?Company_Name .
- ?CompanyName db:foundationPlace ?Foundation_URI .
- ?CompanyName db:wikiPageExternalLink ?Website .
- ?CompanyName db:locationCity ?LocationCity .
- ?Foundation_URI property:name ?Foundation_Name .
- ?Foundation_URI position:lat ?Latitude .
- ?Foundation_URI position:long ?Longitude .
- OPTIONAL{ ?Foundation_URI property:populationCensus ?Population. }
- }
- GROUP BY ?CompanyName
- ========================================================================================================================
- How to get unique results from SPARQL query
- http://answers.semanticweb.com/questions/11859/how-to-get-unique-results-from-sparql-query
- ========================================================================================================================
- Filter partial URI with SPARQL (STRSTARTS)
- http://answers.semanticweb.com/questions/10207/filter-partial-uri-with-sparql
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement