How to get all companies from DBPedia?

You’re right that your query isn’t returning all the companies. The pattern is correct, though. Notice that this query which only counts the companies returns 88054: prefix dbpedia-owl: <http://dbpedia.org/ontology/> select (count(distinct ?company) as ?count) where { ?company a dbpedia-owl:Company } SPARQL results I think this is a limit imposed by the DBpedia SPARQL endpoint for … Read more

get latitude and longitude of a place dbpedia

You can use Jena’s ARQ to execute queries against remote SPARQL endpoints. The process is described in ARQ — Querying Remote SPARQL Services. Using ParameterizedSparqlStrings in SELECT queries To do this for different places that you might not know until it is time to execute the query, you can use a ParameterizedSparqlString to hold the query and … Read more

DBpedia Jena Query returning null

that is so embarassing, there is space problem in the query: String service = “http://dbpedia.org/sparql”; String queryString = “”; queryString = “PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?label ” + “WHERE {” + “<http://dbpedia.org/resource/Quatre_Bornes> <http://dbpedia.org/ontology/country> ?y .”+ “?y rdfs:label ?label .”+ “FILTER (LANG(?label) = ‘en’)”+ “}”;

How to extract information from a Wikipedia infobox?

The wrong way: trying to parse HTML Use (cURL/jQuery/file_get_contents/requests/wget/more jQuery) to fetch the HTML article code of the article, then use a DOM parser to extract table.infobox tr[3] td / use a regex. This is actually a really bad idea most of the time. Wikipedia’s HTML code is not particularly parsing-friendly (especially infoboxes which are … Read more