Advertisement
asanchez75

sparql/concat/bind/replace/str

Feb 3rd, 2016
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. SELECT count( distinct concat(?s, "|", ?o) as ?row) {GRAPH <http://yago3> {
  2. ?s rdfs:subClassOf ?o.
  3. FILTER (REGEX(str(?o), 'http://yago-knowledge.org/resource/wikicat') || REGEX(str(?o), 'http://yago-knowledge.org/resource/wordnet') || ?o = <http://www.w3.org/2002/07/owl#Thing>)
  4. }}
  5. =============================================================================================
  6. SELECT CONCAT(?s, "|", ?o) as ?row {GRAPH <http://yago3> {
  7. ?s owl:sameAs ?o.
  8. FILTER(REGEX(?s, "http://yago-knowledge.org/resource") && REGEX(?o, "http://dbpedia.org/resource"))
  9. }}
  10. LIMIT 10
  11. =============================================================================================
  12. SELECT ?s {GRAPH <http://dbpedia.org> {
  13. ?s <http://xmlns.com/foaf/0.1/isPrimaryTopicOf> ?o.
  14. {
  15. SELECT IRI(?bind) as ?o {GRAPH <http://wikidata.org> {
  16. ?o <http://schema.org/about> <http://www.wikidata.org/entity/Q76>.
  17. BIND(REPLACE(STR(?o), "https", "http") as ?bind)
  18. FILTER(REGEX(?o, 'https://en.wikipedia.org/wiki'))
  19. }}
  20. }}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement