loicjaouen / sparqlperformancetests Goto Github PK
View Code? Open in Web Editor NEWcompared with requests and repo size
compared with requests and repo size
starting with the usual request that times-out at 20s:
https://dasch.atlassian.net/servicedesk/customer/portal/1/DSQ-56
as the triple store config mentions:
tdb2:unionDefaultGraph true ;
it potentially adds a scaling issue.
Trying to put the project theatre-societe on a server of it own: 0117-test-server.dasch.swiss (borrowed from abother project)
where our prod now load http://theatresdesociete.unil.ch/year/1750 in 10s (downloading the app javascript code takes 9s) the query take 800ms.
the gravsearch query is:
PREFIX knora-api: <http://api.knora.org/ontology/knora-api/v2#>
PREFIX theatre-societe: <http://knora.unil.ch/ontology/0103/theatre-societe/v2#>
CONSTRUCT {
?representation knora-api:isMainResource true .
?representation theatre-societe:representationIsBasedOn ?work .
?work theatre-societe:workHasTitle ?playTitle .
?representation theatre-societe:representationHasPlace ?place .
?place theatre-societe:placeHasName ?placeName .
?representation theatre-societe:representationHasDate ?date .
} WHERE {
?representation a knora-api:Resource .
?representation a theatre-societe:Representation .
?representation theatre-societe:representationIsBasedOn ?work .
?work theatre-societe:workHasTitle ?playTitle .
?representation theatre-societe:representationHasPlace ?place .
?place theatre-societe:placeHasName ?placeName .
?representation theatre-societe:representationHasDate ?date .
FILTER(knora-api:toSimpleDate(?date) = 'GREGORIAN:1750-1-1:1750-12-31'^^<http://api.knora.org/ontology/knora-api/simple/v2#Date>)
}
ORDER BY ?date
OFFSET 0
the generated sparql query is:
SELECT
DISTINCT ?representation
(GROUP_CONCAT(DISTINCT(IF(BOUND(?place), STR(?place), "")); SEPARATOR='') AS ?place__Concat)
(GROUP_CONCAT(DISTINCT(IF(BOUND(?work), STR(?work), "")); SEPARATOR='') AS ?work__Concat)
(GROUP_CONCAT(DISTINCT(IF(BOUND(?representation__httpwwwknoraorgontology0103theatresocieterepresentationIsBasedOn__work__LinkValue), STR(?representation__httpwwwknoraorgontology0103theatresocieterepresentationIsBasedOn__work__LinkValue), "")); SEPARATOR='') AS ?representation__httpwwwknoraorgontology0103theatresocieterepresentationIsBasedOn__work__LinkValue__Concat)
(GROUP_CONCAT(DISTINCT(IF(BOUND(?date), STR(?date), "")); SEPARATOR='') AS ?date__Concat)
(GROUP_CONCAT(DISTINCT(IF(BOUND(?representation__httpwwwknoraorgontology0103theatresocieterepresentationHasPlace__place__LinkValue), STR(?representation__httpwwwknoraorgontology0103theatresocieterepresentationHasPlace__place__LinkValue), "")); SEPARATOR='') AS ?representation__httpwwwknoraorgontology0103theatresocieterepresentationHasPlace__place__LinkValue__Concat)
(GROUP_CONCAT(DISTINCT(IF(BOUND(?placeName), STR(?placeName), "")); SEPARATOR='') AS ?placeName__Concat)
(GROUP_CONCAT(DISTINCT(IF(BOUND(?playTitle), STR(?playTitle), "")); SEPARATOR='') AS ?playTitle__Concat)
WHERE {
?httpwwwknoraorgontology0103theatresocieteworkHasTitle__subPropertyOf <http://www.w3.org/2000/01/rdf-schema#subPropertyOf>* <http://www.knora.org/ontology/0103/theatre-societe#workHasTitle> .
?work ?httpwwwknoraorgontology0103theatresocieteworkHasTitle__subPropertyOf ?playTitle .
?httpwwwknoraorgontology0103theatresocieteplaceHasName__subPropertyOf <http://www.w3.org/2000/01/rdf-schema#subPropertyOf>* <http://www.knora.org/ontology/0103/theatre-societe#placeHasName> .
?place ?httpwwwknoraorgontology0103theatresocieteplaceHasName__subPropertyOf ?placeName .
?httpwwwknoraorgontology0103theatresocieterepresentationIsBasedOn__subPropertyOf <http://www.w3.org/2000/01/rdf-schema#subPropertyOf>* <http://www.knora.org/ontology/0103/theatre-societe#representationIsBasedOn> .
?representation ?httpwwwknoraorgontology0103theatresocieterepresentationIsBasedOn__subPropertyOf ?work .
?httpwwwknoraorgontology0103theatresocieterepresentationIsBasedOnValue__subPropertyOf <http://www.w3.org/2000/01/rdf-schema#subPropertyOf>* <http://www.knora.org/ontology/0103/theatre-societe#representationIsBasedOnValue> .
?representation ?httpwwwknoraorgontology0103theatresocieterepresentationIsBasedOnValue__subPropertyOf ?representation__httpwwwknoraorgontology0103theatresocieterepresentationIsBasedOn__work__LinkValue .
?representation__httpwwwknoraorgontology0103theatresocieterepresentationIsBasedOn__work__LinkValue <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.knora.org/ontology/knora-base#LinkValue> .
?representation__httpwwwknoraorgontology0103theatresocieterepresentationIsBasedOn__work__LinkValue <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> ?work .
?httpwwwknoraorgontology0103theatresocieterepresentationHasPlace__subPropertyOf <http://www.w3.org/2000/01/rdf-schema#subPropertyOf>* <http://www.knora.org/ontology/0103/theatre-societe#representationHasPlace> .
?representation ?httpwwwknoraorgontology0103theatresocieterepresentationHasPlace__subPropertyOf ?place . ?httpwwwknoraorgontology0103theatresocieterepresentationHasPlaceValue__subPropertyOf <http://www.w3.org/2000/01/rdf-schema#subPropertyOf>* <http://www.knora.org/ontology/0103/theatre-societe#representationHasPlaceValue> .
?representation ?httpwwwknoraorgontology0103theatresocieterepresentationHasPlaceValue__subPropertyOf ?representation__httpwwwknoraorgontology0103theatresocieterepresentationHasPlace__place__LinkValue . ?representation__httpwwwknoraorgontology0103theatresocieterepresentationHasPlace__place__LinkValue <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.knora.org/ontology/knora-base#LinkValue> .
?representation__httpwwwknoraorgontology0103theatresocieterepresentationHasPlace__place__LinkValue <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> ?place . ?httpwwwknoraorgontology0103theatresocieterepresentationHasDate__subPropertyOf <http://www.w3.org/2000/01/rdf-schema#subPropertyOf>* <http://www.knora.org/ontology/0103/theatre-societe#representationHasDate> .
?representation ?httpwwwknoraorgontology0103theatresocieterepresentationHasDate__subPropertyOf ?date . ?date <http://www.knora.org/ontology/knora-base#valueHasStartJDN> ?date__valueHasStartJDN .
?date <http://www.knora.org/ontology/knora-base#valueHasEndJDN> ?date__valueHasEndJDN .
FILTER((("2360235"^^<http://www.w3.org/2001/XMLSchema#integer> <= ?date__valueHasEndJDN) && ("2360599"^^<http://www.w3.org/2001/XMLSchema#integer> >= ?date__valueHasStartJDN)))
FILTER NOT EXISTS { ?work <http://www.knora.org/ontology/knora-base#isDeleted> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> . }
FILTER NOT EXISTS { ?playTitle <http://www.knora.org/ontology/knora-base#isDeleted> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> . }
FILTER NOT EXISTS { ?place <http://www.knora.org/ontology/knora-base#isDeleted> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> . }
FILTER NOT EXISTS { ?placeName <http://www.knora.org/ontology/knora-base#isDeleted> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> . }
FILTER NOT EXISTS { ?representation <http://www.knora.org/ontology/knora-base#isDeleted> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> . }
FILTER NOT EXISTS { ?representation__httpwwwknoraorgontology0103theatresocieterepresentationIsBasedOn__work__LinkValue <http://www.knora.org/ontology/knora-base#isDeleted> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> . }
FILTER NOT EXISTS { ?representation__httpwwwknoraorgontology0103theatresocieterepresentationHasPlace__place__LinkValue <http://www.knora.org/ontology/knora-base#isDeleted> "true" ^^<http://www.w3.org/2001/XMLSchema#boolean> . }
FILTER NOT EXISTS { ?date <http://www.knora.org/ontology/knora-base#isDeleted> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> . }
}
GROUP BY ?representation ?date__valueHasStartJDN
ORDER BY ASC(?date__valueHasStartJDN) ASC(?representation)
LIMIT 25
which can be reformatted as:
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX tds: <http://www.knora.org/ontology/0103/theatre-societe#>
PREFIX kb: <http://www.knora.org/ontology/knora-base#>
PREFIX xmls: <http://www.w3.org/2001/XMLSchema#>
PREFIX ns: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT
DISTINCT ?representation
(GROUP_CONCAT(DISTINCT(IF(BOUND(?place), STR(?place), "")); SEPARATOR='') AS ?place__Concat)
(GROUP_CONCAT(DISTINCT(IF(BOUND(?work), STR(?work), "")); SEPARATOR='') AS ?work__Concat)
(GROUP_CONCAT(DISTINCT(IF(BOUND(?workLinkValue), STR(?workLinkValue), "")); SEPARATOR='') AS ?workLinkValue__Concat)
(GROUP_CONCAT(DISTINCT(IF(BOUND(?date), STR(?date), "")); SEPARATOR='') AS ?date__Concat)
(GROUP_CONCAT(DISTINCT(IF(BOUND(?laceLinkValue), STR(?laceLinkValue), "")); SEPARATOR='') AS ?laceLinkValue__Concat)
(GROUP_CONCAT(DISTINCT(IF(BOUND(?placeName), STR(?placeName), "")); SEPARATOR='') AS ?placeName__Concat)
(GROUP_CONCAT(DISTINCT(IF(BOUND(?playTitle), STR(?playTitle), "")); SEPARATOR='') AS ?playTitle__Concat)
WHERE {
?workHasTitle rdfs:subPropertyOf* tds:workHasTitle .
?work ?workHasTitle ?playTitle .
?placeHasName rdfs:subPropertyOf* tds:placeHasName .
?place ?placeHasName ?placeName .
?isBasedOn rdfs:subPropertyOf* tds:representationIsBasedOn .
?representation ?isBasedOn ?work .
?isBasedOnValue rdfs:subPropertyOf* tds:representationIsBasedOnValue .
?representation ?isBasedOnValue ?workLinkValue .
?workLinkValue ns:type kb:LinkValue .
?workLinkValue ns:object ?work .
?hasPlace rdfs:subPropertyOf* tds:representationHasPlace .
?representation ?hasPlace ?place .
?hasPlaceValue rdfs:subPropertyOf* tds:representationHasPlaceValue .
?representation ?hasPlaceValue ?laceLinkValue .
?laceLinkValue ns:type kb:LinkValue .
?laceLinkValue ns:object ?place .
?hasDate rdfs:subPropertyOf* tds:representationHasDate .
?representation ?hasDate ?date .
?date kb:valueHasStartJDN ?startDate .
?date kb:valueHasEndJDN ?endDate .
FILTER((("2360235"^^xmls:integer <= ?endDate) && ("2360599"^^xmls:integer >= ?startDate)))
FILTER NOT EXISTS { ?work kb:isDeleted "true"^^xmls:boolean . }
FILTER NOT EXISTS { ?playTitle kb:isDeleted "true"^^xmls:boolean . }
FILTER NOT EXISTS { ?place kb:isDeleted "true"^^xmls:boolean . }
FILTER NOT EXISTS { ?placeName kb:isDeleted "true"^^xmls:boolean . }
FILTER NOT EXISTS { ?representation kb:isDeleted "true"^^xmls:boolean . }
FILTER NOT EXISTS { ?workLinkValue kb:isDeleted "true"^^xmls:boolean . }
FILTER NOT EXISTS { ?laceLinkValue kb:isDeleted "true" ^^xmls:boolean . }
FILTER NOT EXISTS { ?date kb:isDeleted "true"^^xmls:boolean . }
}
GROUP BY ?representation ?startDate
ORDER BY ASC(?startDate) ASC(?representation)
LIMIT 25
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.