Issue769

Title cc.license._lib.functions:current_version() extremely slow
Priority bug Status unread
Project License Engine Milestone
Superseder Nosy List cwebber, jedoig, nyergler
Assigned To Keywords

Created on 2011-01-18.22:33:27 by cwebber, last changed 2013-10-28.15:01:54 by testedunderdog2.

Messages
msg2711 (view) Author: cwebber Date: 2011-01-18.22:33:27
current_version in cc.license is very slow and not the best constructed.

John Doig and Nathan Yergler have made some headway on SPARQL queries for a
replacement call, however these are also slow, as we've seen oddly enough with
other queries which include multiple conditions in the WHERE clause.

  <JED3>  query_string = """
  <JED3>         PREFIX cc: <http://creativecommons.org/ns#>
  <JED3>         PREFIX dc: <http://purl.org/dc/elements/1.1/>
  <JED3>         SELECT ?license
  <JED3>         WHERE
  <JED3>          {
  <JED3>             ?license dc:identifier '%(code)s' .
  <JED3>             ?license cc:jurisdiction <%(jurisdiction)s> .   
  <JED3>          }
  <JED3>         ORDER BY DESC(?license)
  <JED3> there we go 
  <JED3> nyergler: ^^ this sparql will get the current version, but is painfully
         slow at doing so, any idea why?  [17:36]
  <nyergler> JED3: no idea, i arrived at a similar state --  [17:38]
  <nyergler>         PREFIX cc: <http://creativecommons.org/ns#>
  <nyergler>         PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
  <nyergler>         PREFIX dcq: <http://purl.org/dc/terms/>
  <nyergler>         PREFIX dc: <http://purl.org/dc/elements/1.1/>
  <nyergler>         SELECT ?license, ?maxversion
  <nyergler>         WHERE
  <nyergler>          {
  <nyergler>             ?license rdf:type cc:License ;
  <nyergler>             dcq:hasVersion ?maxversion ;
  <nyergler>             dc:identifier "%s" .            
  <nyergler>             OPTIONAL { 
  <nyergler>                 ?license dcq:hasVersion ?otherversion .
  <nyergler>                 FILTER (?otherversion > ?maxversion) .  [17:39]
  <nyergler>             }.
  <nyergler>             FILTER ( !bound(?otherversion) ) .
  <nyergler>          }
  <nyergler>                 
  <nyergler> (although slightly different SPARQL
  <nyergler> i seem to recall we had this issue before where binding to the
             jurisdiction (or identifier in my case)
  <nyergler> made things really really slow
History
Date User Action Args
2013-10-28 15:01:54testedunderdog2setfiles: - ul37.html
2013-10-27 16:10:28testedunderdog2setfiles: + ul37.html
2011-01-18 22:33:27cwebbercreate