Skip to content

Instantly share code, notes, and snippets.

## Memo - impresso SOLR queries
### OCR quality assessment
- range facet over ocrqa
```
https://dhlabsrv18.epfl.ch/solr/impresso_sandbox/select?
facet.field=ocrqa_f&
facet.query=ocrqa_f:[* TO 0.2]&
prefixes = "PREFIX grz-owl: <http://localhost:8080/garzoni/ontology#>"
q = prefixes + \
            "SELECT ?wf " \
            "WHERE { " \
            "?p a grz-owl:Person . " \
            "?p rdfs:label '" +  name + "' ." \
            " ?p grz-owl:profession/grz-owl:value/lemon:form/lemon:writtenRepresentation ?wf . }"

localhost has to be changed

<rdf:RDF
    xmlns:grz="http://localhost:8080/garzoni-data/"
    xmlns:grz-owl="http://localhost:8080/garzoni/ontology#"
    xmlns:oa="http://www.w3.org/ns/oa#"
    xmlns:sem="http://semanticweb.cs.vu.nl/2009/11/sem/"
    xmlns:crm-dig="http://www.ics.forth.gr/isl/rdfs/3D-COFORM_CRMdig.rdfs#"
    xmlns:virtrdf="http://www.openlinksw.com/schemas/virtrdf#"

1. Given a person (uri of person), get its mentions in various documents/images

SELECT ?mention ?contract STR(?boxNumber)AS ?box STR(?regNumber) AS ?reg ?pageNumber ?pageSide ?iiif ?viewer
WHERE
{
  <http://localhost:8080/garzoni-data/Zuan_Antonio_Bertan_30435> ^grz-owl:refers_to/grz-owl:is_entityLink_of ?mention .
  ?mention grz-owl:introduced_in ?contract.
  ?contract grz-owl:appears_on ?page .
  ?page grz-owl:number ?pageNumber.
  ?page grz-owl:pageSide ?pageSide .

Garzoni: var feature usage

Appellation component usage
select ?tnc count (?nc)
where
{
?a grz-owl:hasNameComponent ?nc .
?nc a ?tnc .
}

Garzoni economy: about charges

Which kind of charges and to which frequency (ok)
SELECT COUNT (?c) str(?wf)
WHERE 
{
  ?c a grz-owl:ChargeMention .
  ?c grz-owl:writtenForm ?wf .
}

Garzoni economy: about wage policy

Salary progressive vs. non-progressive, and in which professions (ok)
SELECT COUNT (distinct ?salNonProg) AS ?NonProgressive COUNT (distinct ?salProg) as ?Progressive
WHERE 
{
  ?salProg a grz-owl:Salary .
  ?salProg grz-owl:progressive 1 .
  ?salNonProg a grz-owl:Salary .

Garzoni economy: about professions

How many distinct professions:
SELECT COUNT (distinct ?profSF) AS ?nbDistinctProfMentions
WHERE 
{
  ?prof a grz-owl:ProfessionMention .
  ?prof grz-owl:standardForm ?profSF .