Reputation: 1106
I am trying to collect Albums and the list of songs per Album. For example for the Album
River_of_Tuoni, the dbpprop:title property provides the list of the songs but only two of them are in DBpedia.
so when i do the following query , I only get two, (My_Only_car,River_of_Tuoni_(song)).
SELECT ?songs
WHERE {
:River_of_Tuoni dbpprop:title ?songs. ?songs a dbpedia-owl:Song .
}
How can i get all the songs (Lullaby, Sunrise,...)?
Upvotes: 1
Views: 141
Reputation: 85823
dbpprop:title property provides the list of the songs but only two of them are in DBpedia.
The dbprop:title property doesn't provide any list; there just happen to be a number of triples with that property. All the data is in DBpedia; the values you've shown in the screenshot indicate that two of the values happen to be URIs, while other values happen to be strings. In general, the data with the dbpprop: properties is "dirtier" than the dbpedia-owl: properties, so getting two different types of values is not very surprising.
The simple query
select ?title where {
dbpedia:River_of_Tuoni dbpprop:title ?title
}
returns all the titles. However, because the dbpedia-owl: properties have cleaner data, I'd usually suggest that you consider using one of those instead of dbpprop:title, but in this case it doesn't look like there's an alternative. You might consider this alternate query to get just strings, though:
select ?title where {
dbpedia:River_of_Tuoni (dbpprop:title/rdfs:label)|dbpprop:title ?title
filter isLiteral(?title)
}
For the cases where the value is another resource, taking the rdfs:label of the resource provides a string. (I think that this should also be achievable with dbprop:title/(rdfs:label?)
, but that doesn't work with the DBpedia endpoint.)
Upvotes: 2