dbpedia

Error while querying DBPedia using Apache Jena

余生颓废 提交于 2019-12-08 09:06:43
问题 import java.sql.ResultSet; import java.sql.SQLException; import com.hp.hpl.jena.query.QueryExecution; import com.hp.hpl.jena.query.QueryExecutionFactory; import com.hp.hpl.jena.query.QueryFactory; import com.hp.hpl.jena.query.QuerySolution; import com.hp.hpl.jena.query.ResultSetFormatter; public class sparq { public static void main (String[] args) throws SQLException { String queryString= "PREFIX dbpedia: <http://dbpedia.org/resource/>"+ "PREFIX category: <http://dbpedia.org/resource

How to build simple SPARQL query in the right way

孤街浪徒 提交于 2019-12-08 07:27:54
问题 I am novice with SPARQL and DBpedia. I would like to get knowledge of building simple SPARQL queries. Could you please help me to build answer for such questions as: Hometown of footballer (any one), List of Artists, List of Oscar winners (any year) 回答1: I think this question is probably too broad, but in case it's useful, it might make sense to describe how to approach this type of problem. For one of the problems, here's what I did. List of Oscar winners (any year) In this case, I started

Retrieving properties of redirected resource

ⅰ亾dé卋堺 提交于 2019-12-08 06:35:19
问题 How can I retrieve all the properties of http://dbpedia.org/resource/Milano? I tried with this query but I have a few results and I don't understand the reason: select ?prop ?c where {<http://dbpedia.org/resource/Milano> ?prop ?c.} SPARQL results 回答1: The question isn't entirely clear, but expect that the problem you're asking about is why you're getting triples about dbpedia:Milano , but not dbpedia:Milan . This query, as you can see in the results, only returns ten rows: select ?prop ?c

SPARQL- Retrieving a DBPedia resource by category string

对着背影说爱祢 提交于 2019-12-08 04:57:30
问题 How can I obtain DBpedia resources based on a Wikipedia category? For example, all Japan's islands that have been flooded. A list of possible categories candidates related to "Flood" include: Category:Floods_in_Malaysia Category:Floods_in_Singapore Category:Floods_in_Japan, and many others… I couldn't navigate using SPARQL queries from categories to certain resources. 回答1: One of the easiest ways to figure out what SPARQL query to write against DBpedia is to find a Wikipedia with some of the

Extracting hierarchy for dbpedia entity using SPARQL

匆匆过客 提交于 2019-12-08 02:53:47
问题 I am trying to extract the hierarchy of Wikipedia category or Yago classification for DBpedia resources using the SPARQL endpoint. For instance, I would like to find out all the possible categories and classes in hierarchical form of entity, say, http://dbpedia.org/resource/Nokia, like Thing → Organization → Company → … → Nokia. 回答1: A simple SPARQL select can retrieve the information that you're interested in, though it won't be arranged hierarchically. You're interested in getting all the

dbpedia SPARQL query to get certain value's for a given city

♀尐吖头ヾ 提交于 2019-12-07 17:53:44
问题 I am sure what I want to do is very easy, yet I cannot seem to get the query right. I have records in dataset which have values such as city name e.g. 'New York' and it's corresponding country code e.g 'US'. I also have access to the full country name and country ISO codes. I would like to get the population and abstract value's for these cities off dbpedia, by using a where clause such as: Get population where name = "New York" and isoCountryCode = "US" I've searched for help on this to no

Optimization of SPARQL query. [ Estimated execution time exceeds the limit of 1500 (sec) ]

余生颓废 提交于 2019-12-07 17:52:19
问题 I am trying to run this query on http://dbpedia.org/sparql but I get an error that my query is too expensive. When I run the query trough http://dbpedia.org/snorql/ I get: The estimated execution time 25012730 (sec) exceeds the limit of 1500 (sec) ... When running the query through my python script using SPARQLWrapper I simply get an HTTP 500. I figure I need to do something to optimize my SPARQL query. I need the data for iterating over educational institutions and importing it in to a local

How to import dbpedia into neo4j? [closed]

怎甘沉沦 提交于 2019-12-07 15:12:28
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 months ago . I need to import dbpedia into neo4j. I download the dbpedia from here: http://wiki.dbpedia.org/Downloads37 Any idea? 回答1: I am currently doing the same thing. I found that the biggest problem for this is the indexing so the best solution is to write a java program that extracts

Getting a list of American physicists from DBpedia using SPARQL

ぃ、小莉子 提交于 2019-12-07 03:50:35
问题 I want to query the American Physicsts and get the list of physicists. How can I do this? 回答1: The SPARQL you need would look like this .... PREFIX category: <http://dbpedia.org/resource/Category:> PREFIX dcterms: <http://purl.org/dc/terms/> SELECT * WHERE { ?s dcterms:subject category:American_physicists . } see results here If you want the list with some extra predicates you need to join more triple patterns using the variable ?s . For instance, to retrieve the birthdate for each physicist

Using SPARQL to query DBPedia Company Information

假如想象 提交于 2019-12-06 11:49:01
I'm trying to query DBPedia using SPARQL only to find company information such as a description, and a logo. I'm rather lost with devising the SPARQL Query to do this. SELECT DISTINCT ?subject ?employees ?homepage WHERE { ?subject rdf:type <http://dbpedia.org/class/yago/Company108058098> . ?subject dbpedia2:numEmployees ?employees FILTER ( xsd:integer(?employees) >= 50000 ) . ?subject foaf:homepage ?homepage . } ORDER BY DESC(xsd:integer(?employees)) LIMIT 20 I have come across the above query, which finds companies with over 50,000 emplayoees, but I don't understand such things as the rdf