Git Product home page Git Product logo

sparqlperformancetests's People

Watchers

 avatar  avatar

sparqlperformancetests's Issues

testing with less data

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.