timrdf / DataFAQs

LINKED DATA QUALITY REPORTS
41 stars 7 forks source link

query for previous inputs for currently-selected core service #9

Open timrdf opened 12 years ago

timrdf commented 12 years ago

On page http://aquarius.tw.rpi.edu/datafaqs/DataFAQs-lodspeakr/special/configure-epoch, "previous" history 1, 2, 3, 4, 5 needs to be fleshed in.

Implementation for page is at https://github.com/timrdf/DataFAQs-lodspeakr/blob/master/models/special.service-history.model.html

Example

given faqt service http://sparql.tw.rpi.edu/services/datafaqs/core/select-faqts/via-sparql-query

find out that

https://raw.github.com/timrdf/DataFAQs/master/services/sadi/core/select-faqts/via-sparql-query-materials/sample-inputs/from-official-sadi-registry.ttl

has been input to the service for the configuration of, say, 134 epochs.

Resources

lodspeakr documentation for nested queries is at: https://github.com/alangrafu/lodspeakr/wiki/Models

timrdf commented 12 years ago

query such as the following should work soon.

[]
   a prov:Activity;
   prov:wasAttributedTo
      <http://sparql.tw.rpi.edu/services/datafaqs/core/select-faqts/via-sparql-query>;
   prov:used
      ?input;
   prov:generated [
       ?p [ a datafaqs:Epoch ]
   ];
.
timrdf commented 12 years ago

special.service-history's

deployed at aquarius demonstrates the query that will return the inputs that have previously been given to a FAqTSelector service.

timrdf commented 12 years ago

(reassigning issue to Alvaro so he can debug the lodspeakr part of this -- or its documentation)

https://github.com/timrdf/DataFAQs-lodspeakr/blob/master/models/special.configure-epoch.model.html/biordf/local/inputHistory is not filling the value (see debug print from [1] below)

prefix prov:   <http://www.w3.org/ns/prov-o/>
prefix select: <http://sparql.tw.rpi.edu/services/datafaqs/core/select-faqts/>

select distinct ?input
where {
   []
      prov:wasAttributedTo <>;
      prov:used ?input;
   .
}

The view [2] is trying to access the result as:

            <select>
               {%for i in r.biordf.DatasetCollection%}
                  <option value='{{i.service.value}}'>{{i.service.value}}</option>
               {%endfor%}
            </select>

[1] http://aquarius.tw.rpi.edu/datafaqs/DataFAQs-lodspeakr/special/configure-epoch [2] https://github.com/timrdf/DataFAQs-lodspeakr/blob/master/views/special.configure-epoch.view.html

Discussion

The page http://aquarius.tw.rpi.edu/datafaqs/DataFAQs-lodspeakr/special/configure-epoch demonstrates that the previous ("upstream"?) query is returning results:

models/special.configure-epoch.model.html/biordf/FAqTServiceCollection is returning values in

views/special.configure-epoch.view.html , which is accessing them as:

{%for i in r.biordf.FAqTServiceCollection%}
   <tr>
      <td property=''><a rel='' href='{{i.service.value}}'>{{i.service.value}}</a></td>
      <td property=''><a rel='' href='{{i.input.value}}'>{{i.input.value}}</a></td>
   </tr>
{%endfor%}

produces the table:

http://sparql.tw.rpi.edu/services/datafaqs/core/select-faqts/via-sparql-query   http://purl.org/twc/vocab/datafaqs#QueryToApply
http://sparql.tw.rpi.edu/services/datafaqs/core/select-faqts/identity   http://purl.org/twc/vocab/datafaqs#FAqTService
timrdf commented 12 years ago

See the source code for the statement:

"This gets the first service in r.biordf.FAqTServiceCollection, but the identical code in the nested query results in an empty expansion prov:wasAttributedTo <>. "

at http://aquarius.tw.rpi.edu/datafaqs/DataFAQs-lodspeakr/special/configure-epoch

alangrafu commented 12 years ago

Can I have write permissions on your installation?

alangrafu commented 12 years ago

There was a bug while handling special pages. I pushed changes in lodspeakr/master so you can merge from there. If it works fine, close the ticket

timrdf commented 12 years ago
prefix prov:   <http://www.w3.org/ns/prov-o/>
prefix select: <http://sparql.tw.rpi.edu/services/datafaqs/core/select-faqts/>

select distinct ?input
where {
   []
      prov:wasAttributedTo <{%for row in r.biordf.FAqTServiceCollection%}{%if forloop.first%}{{row.service.value}}{%endif%}{%endfor%}>;
      prov:wasAttributedTo <{{first.biordf.FAqTServiceCollection.service.value}}>;
      prov:used ?input;
   .
}

expands to the folowing, which is missing the "first" abbreviation.

prefix prov:   <http://www.w3.org/ns/prov-o/>
prefix select: <http://sparql.tw.rpi.edu/services/datafaqs/core/select-faqts/>

select distinct ?input
where {
   []
      prov:wasAttributedTo <http://sparql.tw.rpi.edu/services/datafaqs/core/select-faqts/via-sparql-query>;
      prov:wasAttributedTo <>;
      prov:used ?input;
   .
}

I can get by with the long for loop version.