buda-base / lds-queries

A repository for BUDA Linked Data Server
Apache License 2.0
0 stars 1 forks source link

Find scan requests for an image group #70

Closed jimk-bdrc closed 3 years ago

jimk-bdrc commented 3 years ago

An Audit Tool enhancement request, Fail if Volume has no images could use the old eXist XMLDOC query to determine if an image group has scan request files, but AO would like to use BUDA for this information (better access, easier to parse, more future support). The AO issue has the XMLDOC details.

Note that BUDA only has to know if scan requests are in the system: if BUDA detects that there are scan request images, but no others, that is fine. Because audit tool is looking at a local disk, not at the BUDA file repository or the archive.

Audit Tool will use the query to detect the number of scan request images BUDA is expecting. If BUDA says there are, say, two images, Audit Tool will then look at its test subject for files named ..._0001.... and ..._0002.... If it finds only them, it will flag the image group has having no files.

(Note that the mere presence of files ..._0001.... and ..._0002.... themselves is not an issue.

eroux commented 3 years ago

here you go: http://purl.bdrc.io/query/table/AO_iginfo?R_RES=bdr:I0886 (the page has a link to the JSON). The JSON is not particularly easy but if you look at the "results" field you'll get something in the format of SPARQL JSON results. (the csv is much simpler)

jimk-bdrc commented 3 years ago

It's true it's complicated, but I've already had to write Python code to dig it out already, for imageGroupsForInstance, so it should be straightforward to write the Java JSON equivalent.

Thanks!

jimk-bdrc commented 3 years ago

I just realized, looking around at a different thing, I could have done the same thing with an existing query: https://purl.bdrc.io/resource/I1NLM411_001.jsonld

{
  "id" : "bdr:I1NLM411_001",
  "type" : "ImageGroup",
  "volumeNumber" : 1,
  "volumeOf" : "bdr:W1NLM411",
  "volumePagesTbrcIntro" : 0,
  "volumePagesTotal" : 314,
  "@context" : "http://purl.bdrc.io/context.jsonld"
}
eroux commented 3 years ago

Indeed !