I know you can get a list of all of the attributes and a list of all people via the simple query:
select distinct ?property where {
?instance a <http://dbpedia.org/ontology/Person> .
?instance ?property ?obj . }
but how do I get all information of a person available without having to enter in each of those quantities? Select * doesn't extract all variables as it would in SQL.
SELECT * WHERE
{ ?p a <http://dbpedia.org/ontology/Person> .
?p <http://dbpedia.org/ontology/knownFor> ?knownFor . }
LIMIT 10
This only gives me the person and the knownfor attribute. I thought select * gives all quantities? In any case, I want not just the person or their knownfor attribute, but all values possible for each person.
You cant't get the attributes as columns, but still it's possible to get al properties/values as rows.
This query gets all properties for all the resources of type Person:
SELECT ?person ?prop ?value WHERE
{
?person a <http://dbpedia.org/ontology/Person> .
?person ?prop ?value .
FILTER ( langMatches(lang(?value), "en") )
}
LIMIT 100
Hope it helps!
@conca already gave you a simple SELECT query that returns the data you want.
As an alternative, you could look at a CONSTRUCT or DESCRIBE query, the result of which will not be a table-like structure, but an actual RDF graph. For broad "tell me everything you know about a particular topic"-type queries, these are often easier to work with:
CONSTRUCT
WHERE { ?person a <http://dbpedia.org/ontology/Person> ;
?prop ?value .
}
LIMIT 100
or
DESCRIBE
WHERE { ?person a <http://dbpedia.org/ontology/Person> }
LIMIT 100
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With