Closed tobybatch closed 11 years ago
This is because there are multiple authors etc. so anytime there is one field different, we've got a different distinct solution.
In these cases Construct queries will return a graph that deals with this duplication:
construct {
?article a <http://purl.org/ontology/bibo/Article> .
?article <http://www.w3.org/2000/01/rdf-schema#seeAlso> ?also .
?article <http://purl.org/dc/terms/identifier> ?dcidentifier .
?article <http://purl.org/dc/terms/type> ?dctype .
?article <http://purl.org/dc/terms/title> ?dctitle .
?article <http://purl.org/dc/terms/date> ?dcdate .
?article <http://purl.org/dc/terms/abstract> ?dcabstract .
?article <http://purl.org/dc/terms/creator> ?dccreator .
?article <http://purl.org/dc/terms/coverage> ?dccoverage .
?article <http://purl.org/dc/terms/publisher> ?dcpublisher .
?article <http://purl.org/dc/terms/language> ?dclanguage .
?article <http://purl.org/dc/terms/subject> ?theme .
} where {
?article a <http://purl.org/ontology/bibo/Article> .
?article <http://www.w3.org/2000/01/rdf-schema#seeAlso> ?also .
?article <http://purl.org/dc/terms/identifier> ?dcidentifier .
?article <http://purl.org/dc/terms/type> ?dctype .
?article <http://purl.org/dc/terms/title> ?dctitle .
?article <http://purl.org/dc/terms/date> ?dcdate .
?article <http://purl.org/dc/terms/abstract> ?dcabstract .
?article <http://purl.org/dc/terms/creator> ?dccreator .
?article <http://purl.org/dc/terms/coverage> ?dccoverage .
?article <http://purl.org/dc/terms/publisher> ?dcpublisher .
?article <http://purl.org/dc/terms/language> ?dclanguage .
?article <http://purl.org/dc/terms/subject> ?theme .
} limit 10
Note that the limit here might mean us missing authors, and so limit does not get us 10 articles, but 10 sets of facts about articles.
ToDo: Need to find the right way to page through results from this sort of query...
It seems a nested query, replacing the first line of the WHERE clause above with
{ SELECT ?article {
?article a <http://purl.org/ontology/bibo/Article> .
}
LIMIT 10
}
sort of works. Although:
So -
But -
FILTER(?article = <http://linked-development.org/eldis/output/A63724/> || ?article = <http://linked-development.org/eldis/output/A63619/>)
This select, then construct approach is the one taken by the Puelia linked data API in place at http://education.data.gov.uk/doc/school (see the queries at the bottom of the screen for how that is fetching a list of items and then querying for the details of them.
The nested query approach does seem to be the best to take. I'm not seeing the same performance issues on Virtuoso 6.1.6 for this.
Not sure if this is @practicalparticipation or @neil-dabson
This:
Which equals this:
Produces a lot of duplicates