Sparql Querty to DBpedia endpoint - sparql

I am new to SPARQL, and I need to write Sparql query to retrieve all the entities and links that DBpedia use from the Ordnance Survey ontologies.
In words, I need to find out, how DBpedia is linked to Ordnance ontologies and how DBpedia incorporates with it in terms of Geospatial data ?. Also, what kind of data dose the DBpedia use from ordnance survey ?

Related

How to find all related entities of another entity in Wikidata by SPARQL?

I want to find all entities related to another entity in wikidata, say matthew effect.
How to query by SPARQL?

Does SPARQL works for Inferred statements also?

I am using SPARQL plugin in protege to query my ontology, and I found out that it only works for asserted statements and not inferred ones. How can I change this?
SPARQL is defined by several standards. SPARQL 1.1 Query, the main standard, only shallowly relies on RDF semantics. A typical SPARQL query engine is not inferring anything from the RDF/RDFS terms like rdfs:subClassOf, rdfs:range, etc. However, the SPARQL standards also define SPARQL 1.1 Entailment Regimes, which defines how SPARQL engines should answer queries when they do implement inference, which is optional. In order to know whether a SPARQL query engine implements an entailment regime (such as RDFS or OWL DL), you may have to look at the documentation of the engine, or there may be a SPARQL service description available in RDF. SPARQL 1.1 Service Description is yet another SPARQL standard that provides an RDF vocabulary, and a standard way to interpret it, for knowing what features a SPARQL engine is implementing.

Web scraping wikipedia data table, but from dbpedia, and examples/very basic, elementary tutorial resources to build queries

I wanted to ask about the Semantic Web part, in particular using DBpedia. In general, what DBpedia can and can’t do? I roughly understand the subject-verb-object model for something like DBpedia. Practically and concretely speaking, I want to web scrape the technical data (mass, thrust, etc.) found in the Wikipedia page of the Long March rocket family
Now, as of right now (i.e., as far as I know), to find what DBpedia has (i.e., how I’m using DBpedia to find data) is that I find what I’m interested in Wikipedia, copying the last part of the URL, and copy that into DBpedia (is there any method more sophisticated than that?), resulting in this page.
Looking at that page, I only see links to related articles, links, and the abstract.
Other than my smaller questions above, my main question is this: so does DBpedia not have the data table that I want?
Next, could someone help me give me some tips or pointers for building a SPARQL or query string for DBpedia? It seems to me that one wouldn't know how to build one as there's no "directory" for what could or couldn't be asked. Thanks.
DBpedia is an active project, and DBpedia extractors are continuing to evolve. Contributions that might help you would include adding infoboxes to Wikipedia pages, and data extractors to DBpedia. Check the DBpedia website for info, or write to dbpedia-discussion to get started.
As for finding DBpedia content, there are several interfaces you can work with --
Faceted Browse and Search
direct SPARQL query interface
iSPARQL, a drag-and-drop SPARQL query builder
SNORQL, another SPARQL query interface
so does dbpedia not have the data table that I want?
No, it doesn't. Usually, DBpedia gets its data from infoboxes. Your article doesn't have one, so DBpedia can't get much information out of it.

Why is some information from the Wikipedia infobox missing on DBpedia?

Why is some information from the Wikipedia infobox missing on DBpedia?
For example, star Alpha Librae has property distance-from-earth in the infobox, but it isn't a property of the Alpha Librae dbpedia resource. On the other hand, star Betelgeuse has this piece of information on DBpedia). And many other stars have this distance information in the infobox, but there isn't any matching property in the DBpedia resource.
Is there a way to extract thise missing information from DBpedia using SPARQL or is the only way web scraping of the wiki page?
The DBpedia pages present all the data DBpedia has -- no SPARQL nor other query can get data that isn't there.
DBpedia is updated periodically. It may not reflect the latest changes on Wikipedia.
Also, extractors are a living project, and may not grab every property in which you're interested.
Looking at Betelgeuse on Wikipedia, I see one distance in the infobox. Looking at Alpha_Librae, I see two distances. Which should DBpedia have? Perhaps you have the niche knowledge which can ensure that the extractors do the right thing...
As #JoshuaTaylor suggests, you will probably get more satisfactory answers from the DBpedia discussion list and/or the DBpedia development list.
Look at en.wikipedia.org/wiki/Volkswagen_Golf_Mk3:
In the infobox you have:
height = 1991-95 & Cabrio: {{convert|1422|mm|in|1|abbr=on}}1996-99: {{convert|1428|mm|in|1|abbr=on}}
In dbpedia you get height=1991-95
instead of
height=1442
height=1428
This happens because there is no standard how to define properties in a conditional way. For this reason, dbpedia properties are sometimes wrong/missing

What SPARQL term can I use to reference a Wikipedia category

I'm trying to extract a list of articles from a specific category in Wikipedia. I'm trying to accomplish this via DBpedia. However, I can't actually find the specific 'term' or 'field' to reference a 'category'. Where is this documented?
The section 4.2. Classifications following section from the DBpedia documentation has a link to the DCMI vocabulary, but I do not see any relevant 'field' or 'term' for category.
Use dcterms:subject
When working with DBpedia, it's almost always easier to browse some data first and then figure out how to the write the query. For instance, in this case, you can take a look at dbpedia:Mount_Monadnock. You'll see that it's related by the dcterms:subject property to four categories:
category:Landforms_of_Cheshire_County,_New_Hampshire
category:Monadnocks
category:Mountains_of_New_Hampshire
category:National_Natural_Landmarks_in_New_Hampshire
If you look at the links that those point to, you'll see the right URIs, e.g.,
http://dbpedia.org/resource/Category:Mountains_of_New_Hampshire
Now, if you're looking at the DBpedia SPARQL Endpoint web interface, you'll see a Namespace Prefixes link in the top right, which will show you the predefined (when you're working with the web interface) prefix:
category: http://dbpedia.org/resource/Category:
Thus, you could use a query like this to get a list of articles in the Mountains of New Hampshire category:
select ?article {
?article dcterms:subject category:Mountains_of_New_Hampshire
}
SPARQL results
What the DBpedia documentation says
The link to the documentation in the question points to
4.2. Classifications
… Wikipedia Categories are represented using the SKOS vocabulary and DCMI terms.
As we've seen, the dcterms:subject property is used to link articles to their categories. The SKOS vocabulary is used to connect categories. E.g., skos:broader is used to connect subcategories and supercategories. I agree that the documentation does not give quite as much information as one might expect, but this might be forgivable since the data is easy enough to browse (and the properties are described in the documentation on those vocabularies).
Related
It's a bit more specific, and would have been hard to search for if I didn't already know what to look for, but this question and answer helps:
Getting a list of American physicists from DBpedia using SPARQL
This is also helpful:
SPARQL- Retrieving a DBPedia resource by category string