Closed zednis closed 8 years ago
could someone please specify what kinds of "variations" would be included? e.g.: Cics Nc Cics / Nc
CICS-NC CICS / NC CICS/NC Cooperative Institute for Climate and Satellites — NC Cooperative Institute for Climate and Satellites—NC Cooperative Institute for Climate and Satellites-North Carolina State University Cooperative Institute for Climate and Satellites - North Carolina State University NOAA NCDC / CICS-NC
I think that's it.
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX gcis: <http://data.globalchange.gov/gcis.owl#>
PREFIX cito: <http://purl.org/spar/cito/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX dbpprop: <http://dbpedia.org/property/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dcterms: <http://purl.org/dc/terms/>
SELECT
?title
?figure as ?FigureURL
COUNT (DISTINCT ?figure) as ?Frequency
FROM <http://data.globalchange.gov>
WHERE {
<http://data.globalchange.gov/report/nca3> gcis:hasFigure ?figure .
?figure dcterms:title ?title .
?figure gcis:hasCaption ?caption .
FILTER regex(?caption, "NC")
OPTIONAL{ ?figure gcis:hasCaption ?caption .
FILTER regex(?caption, "Cooperative Institute for Climate and Satellites")
}
} order by ?title
Please correct me in case something is wrong. Thanks!
Thanks, @lic10 . I'm not getting any results when trying it in the API though.
@justgo129 the query works for me when I used http://data.globalchange.gov/sparql
Interesting. The hyperlink in the e-mail doesn't work, but the one here (identical to that in the e-mail of course) does. I wonder what's going on. @bduggan what are your thoughts?
I don't know what you mean by "the hyperlink in the email". The SPARQL works for me.
Sure. Within the email that is automatically generated with each update of a github issue, I clicked on the URL for the SPARQL query (i.e. the multi-line URL which executes the query). That returns the following syntax error:
\Virtuoso 37000 Error SP030: SPARQL compiler, line 20: syntax error at 'e' before 'dcterm'
SPARQL query: define sql:big-data-const 0
define sql:signal-void-variables 1 PREFIX rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# PREFIX rdfs: http://www.w3.org/2000/01/rdf-schema# PREFIX gcis: http://data.globalchange.gov/gcis.owl# PREFIX cito: http://purl.org/spar/cito/ PREFIX xsd: http://www.w3.org/2001/XMLSchema# PREFIX dbpprop: http://dbpedia.org/property/ PREFIX prov: http://www.w3.org/ns/prov# PREFIX foaf: http://xmlns.com/foaf/0.1/ PREFIX dcterms: http://purl.org/dc/terms/
SELECT ?title ?figure as ?FigureURL COUNT (DISTINCT ?figure) FROM http://data.globalchange.gov WHERE { http://data.globalchange.gov/report/nca3 gcis:hasFigure ?figure . ?figur e dcterm s:title ?title . ?figure gcis:hasCaption ?caption . FILTER regex(?caption, "NC") OPTIONAL{ ?figure gcis:hasCaption ?caption . FILTER regex(?caption, "Cooperative Institute for Climate and Satellites") } } order by ?title
However, clicking on the same hyperlink within the Github UI produces a successful query.
On Tue, Aug 11, 2015 at 5:49 PM, Brian Duggan notifications@github.com wrote:
I don't know what you mean by "the hyperlink in the email". The SPARQL works for me.
— Reply to this email directly or view it on GitHub https://github.com/USGCRP/gcis-ontology/issues/115#issuecomment-130088763 .
Justin Goldstein, Ph.D. Advance Science Climate Data and Observing Systems Coordinator US Global Change Research Program 1717 Pennsylvania Ave NW, Suite #250 Washington, DC 20006
O: (202) 419-3496 M: (202) 285-3005
e-mail: jgoldstein AT usgcrp Dot gov http://www.globalchange.gov
On Tuesday, August 11, justgo129 wrote:
Sure. Within the email that is automatically generated with each update of a github issue, I clicked on the URL for the SPARQL query (i.e. the multi-line URL which executes the query).
Multi-line URLs are error prone, just copy and paste the SPARQL.
Excellent advice, Brian. I am happy with the SPARQL query. Should we revise the column titles for the purpose of aesthetics? I think it's good to go into a test suite. @budggan if you think so , please feel free to close this ticket after adding it if you feel it's ready to go. I'm satisfied with the resolution.
comes up as one of the outputs from the SPARQL query. Although an NCDC / CICS product, the description does not explicitly stated "source...CICS" or a variation thereof. From the description, someone not familiar with the figure-making process for the NCA3 may not be sure whether CICS actually designed this figure.
Anyone want to take a shot at adding this to the test suite?
I've put instructions on how to do this into the README :
https://github.com/USGCRP/gcis-ontology/blob/master/README.md
Brian
@lic10 @zednis @xgmachina is there a way to address my comment above (the one beginning with "interesting")? After that, please feel free to add this to the test suite, after which I will close this ticket. Thanks so very much.
I have added this query to the test suite in gcis-sparql.
Thanks, @lic10. Could you please inform as to the purpose of the "frequency" column?
@zednis @xgmachina could you be of assistance with the question in the previous comment (Sep 1.)? Thanks.
@justgo129 As you can see in the query, Frequency is a count of the occurrences of the figure (by URL). I am not sure why @lic10 added it to the query, but my guess would be he added it since there are multiple figures in the report with the same title (though it appears each occurrence has a unique URL).
My guess is that frequency can be safely removed from the query.
@zednis do you feel that this needs to go into a test suite? If not, since it's been added to gcis-sparql, I am happy to close #115.
I do not think it is necessary in the gcis-ontology tests.
@justgo129 please feel free to close.
Closed #115.
"Calculate how many of the graphics in the NCA3 have source "CICS / NC" or a variation."