2
Help us understand the problem. What are the problem?

More than 1 year has passed since last update.

posted at

updated at

dbpediaの研究 その17

概要

dbpediaが難解なので、手出してみる。
動くsparqlを、集めてみた。

結果

select distinct *
where {
    ?s  prop-ja:色 ?o .
}
limit 10
select distinct ?o
where {
    ?s rdf:type ?o.
}
LIMIT 10
select *
where {
    ?s ?p dbpedia-ja:凶器 .
}
select *
where {
    ?s ?p ?o .
}
LIMIT 10
SELECT ?director, COUNT(?director) AS ?count
WHERE {
    ?film dbpedia-owl:director ?director
}
GROUP BY ?director
ORDER BY DESC (?count)   
SELECT ?author, ?masterpiece
WHERE {
    dbpedia-ja:ドラえもん prop-ja:作者 ?author.
    ?author prop-ja:代表作 ?masterpiece.
}

SELECT DISTINCT ?label ?depiction 
WHERE {
    ?s prop-ja:genre <http://ja.dbpedia.org/resource/ロック_(音楽)> ;
    rdfs:label ?label .
    OPTIONAL { 
        ?s foaf:depiction ?depiction .
    }
}
SELECT ?birth_date
WHERE {
    dbpedia-ja:ビートたけし dbpedia-owl:birthDate ?birth_date.
}
SELECT DISTINCT *
WHERE {
    dbpedia-ja:軽自動車 dbpedia-owl:abstract ?abstract .
}
SELECT DISTINCT *
WHERE {
    dbpedia-ja:赤湯 ?p ?o .
}
SELECT DISTINCT *
WHERE {
  <http://ja.dbpedia.org/resource/フクジュソウ> ?p ?o .
}
SELECT distinct ?name ?abstract ?url ?lat ?lon 
WHERE {
    ?s rdfs:label ?name ;
    dbpedia-owl:abstract ?abstract ;
    foaf:isPrimaryTopicOf ?url ;
    geo:lat ?lat ;
    geo:long ?lon .
}
LIMIT 10
select * 
where {
    ?link a dbpedia-owl:Station; 
    rdfs:label ?title;
    geo:lat ?lat;
    geo:long ?long.
}
limit 10
select ?movieName ?directorName ?runningTime
where {
    ?movie rdf:type dbpedia-owl:Film;
    prop-ja:上映時間 ?runningTime;
    rdfs:label ?movieName;
    dbpedia-owl:director ?director.
    ?director rdfs:label ?directorName.
    filter(?runningTime < 80)
}
order by desc(?runningTime) ?director
limit 5
SELECT DISTINCT ?person count(?war) AS ?c
WHERE {
    {
        ?war dbpedia-owl:wikiPageWikiLink category-ja:日本の戦国時代の戦い
    }
    UNION {
        ?war dbpedia-owl:wikiPageWikiLink category-ja:安土桃山時代の戦い
    }
    ?war dbpedia-owl:opponents ?person .
}
GROUP BY ?person
ORDER BY DESC(?c)
select *
where {
    ?uri dbpedia-owl:wikiPageWikiLink category-ja:日本百名山.
    ?uri rdf:type schema:Mountain.
    ?uri foaf:name ?name.
    ?uri foaf:depiction ?image.
    ?uri prop-ja:標高 ?altitude.
}
order by ?altitude
select distinct ?pref (count(?s) AS ?c)
where {
    ?pref rdf:type dbpedia-owl:Place.
    ?pref dbpedia-owl:wikiPageWikiLink category-ja:日本の都道府県.
    ?s rdf:type dbpedia-owl:Person;
    dbpedia-owl:wikiPageWikiLink category-ja:日本のアイドル;
    dbpedia-owl:birthPlace ?pref.
}
GROUP BY ?pref
ORDER BY ?c
SELECT AVG(?countOfWorks) AS ?avgOfWorks
WHERE {
    SELECT ?author, (COUNT(?works) AS ?countOfWorks)
    WHERE {
        ?author dbpedia-owl:notableWork ?works
    }
    GROUP BY ?author
}
SELECT ?director, COUNT(?director) AS ?count
WHERE {
    ?film dbpedia-owl:director ?director
}
GROUP BY ?director
ORDER BY DESC(?count)
SELECT ?wikiLink
WHERE {
    dbpedia-ja:アメリカ合衆国 dbpedia-owl:wikiPageWikiLink ?wikiLink.
}
LIMIT 10 OFFSET 10
SELECT ?author, ?masterpiece
WHERE {
    dbpedia-ja:ドラえもん prop-ja:作者 ?author.
    ?author prop-ja:代表作 ?masterpiece.
}
SELECT ?o
WHERE {
    dbpedia-ja:日本 prop-ja:国歌 ?o.
}

以上。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Sign upLogin
2
Help us understand the problem. What are the problem?