Skip to content

Instantly share code, notes, and snippets.

@e-maud
Last active September 24, 2015 12:25
Show Gist options
  • Save e-maud/a34a8d026b0c089f6d98 to your computer and use it in GitHub Desktop.
Save e-maud/a34a8d026b0c089f6d98 to your computer and use it in GitHub Desktop.

Garzoni various

Extract data for disamb
SELECT (strafter(str(?contract), "-data/") AS ?contract) str(?appStartDate) AS ?startApp  str(?contractDuration) AS ?durationInMonths
(str(?identifiedPerson) AS ?identifiedPerson) 
(strafter(str(?personEntity), "-data/") AS ?personEntity)
(str(?wfFirstname) AS ?firstname) 
(str(?wfSurname)  AS ?surname) 
(str(?wfPatronimic1) AS ?patronimic1) 
(strafter(str(?personRole), "#") AS ?role) 
(str(?gender) AS ?gender) (str(?ageInt) AS ?age)  
(str(?coord) AS ?originGeoCoord) 
str(?originGeoWF)  AS ?originGeoWrittenForm
str(?originGeoSF) AS ?originGeoStandardForm
?workshopParish ?workshopSestriere ?workshopLocDescription str(?ins) AS ?insigna
(str(?pmProf) AS ?personProfStandard) 
(str(?mProf) AS?masterProfStandard)

WHERE
{
?contract  a grz-owl:Contract ; grz-owl:reports ?app .
?app sem:eventType grz-owl:apprenticeShip .
?app sem:hasTime/sem:hasBeginTimeStamp ?date .
BIND (year(?date) AS ?appStartDate).
OPTIONAL { ?contract grz-owl:duration ?contractDuration . }
OPTIONAL 
{ ?contract grz-owl:introduces ?wm . 
  ?wm a grz-owl:WorkshopMention .
  OPTIONAL 
  {?wm grz-owl:location ?locWorkShop .
    OPTIONAL {?locWorkShop grz-owl:in_parish/rdfs:label ?workshopParish }
    OPTIONAL {?locWorkShop grz-owl:in_sestriere/rdfs:label ?workshopSestriere}
    OPTIONAL {?locWorkShop grz-owl:writtenForm ?workshopLocDescription .}
  }
  OPTIONAL {?wm grz-owl:insigna ?in . }
}

?contract grz-owl:introduces ?personMention .
?personMention grz-owl:role/grz-owl:roleType  ?personRole .
OPTIONAL { ?personMention grz-owl:gender ?gender . }
OPTIONAL { ?personMention grz-owl:age ?ageInt . }
OPTIONAL { ?personMention grz-owl:profession/grz-owl:standardForm ?pmProf . }
OPTIONAL 
{ ?personMention grz-owl:geographicOrigin ?placeMention .
  OPTIONAL {?placeMention geo:geometry ?coord .}
  OPTIONAL {?placeMention grz-owl:writtenForm ?originGeoWF .}
  OPTIONAL {?placeMention grz-owl:standardForm ?originGeoSF .}
}
OPTIONAL { ?personMention grz-owl:identifiedPerson ?identifiedPerson . }
OPTIONAL { ?personMention grz-owl:hasEntityLink/grz-owl:refers_to ?personEntity . ?personEntity a grz-owl:Person . }

?personMention grz-owl:name ?appellation .
OPTIONAL { ?appellation grz-owl:hasNameComponent ?firstname . ?firstname a grz-owl:Firstname; grz-owl:writtenForm ?wfFirstname . }
OPTIONAL {?appellation grz-owl:hasNameComponent ?surname . ?surname a grz-owl:Surname; grz-owl:writtenForm ?wfSurname .}
OPTIONAL {?appellation grz-owl:hasNameComponent ?patronimic1 . ?patronimic1 a grz-owl:Patronimic1; grz-owl:writtenForm ?wfPatronimic1 .}

OPTIONAL { ?contract grz-owl:introduces ?masterMention .
?masterMention grz-owl:role/grz-owl:roleType  grz-owl:master .
?masterMention grz-owl:profession/grz-owl:standardForm ?mProf . }

FILTER (year(?date) > 1586 AND year(?date) < 1600)
}
Extract data for disamb stampa only
SELECT (strafter(str(?contract), "-data/") AS ?contract) str(?appStartDate) AS ?startApp  str(?contractDuration) AS ?durationInMonths
(str(?identifiedPerson) AS ?identifiedPerson) 
(strafter(str(?personEntity), "-data/") AS ?personEntity)
(str(?wfFirstname) AS ?firstname) 
(str(?wfSurname)  AS ?surname) 
(str(?wfPatronimic1) AS ?patronimic1) 
(strafter(str(?personRole), "#") AS ?role) 
(str(?gender) AS ?gender) (str(?ageInt) AS ?age)  
(str(?coord) AS ?originGeoCoord) 
str(?originGeoWF)  AS ?originGeoWrittenForm
str(?originGeoSF) AS ?originGeoStandardForm
?workshopParish ?workshopSestriere ?workshopLocDescription str(?ins) AS ?insigna
(str(?pmProf) AS ?personProfStandard) 
(str(?mProf) AS?masterProfStandard)

WHERE
{
?contract  a grz-owl:Contract ; grz-owl:reports ?app .
?app sem:eventType grz-owl:apprenticeShip .
?app sem:hasTime/sem:hasBeginTimeStamp ?date .
BIND (year(?date) AS ?appStartDate).
OPTIONAL { ?contract grz-owl:duration ?contractDuration . }
OPTIONAL 
{ ?contract grz-owl:introduces ?wm . 
  ?wm a grz-owl:WorkshopMention .
  OPTIONAL 
  {?wm grz-owl:location ?locWorkShop .
    OPTIONAL {?locWorkShop grz-owl:in_parish/rdfs:label ?workshopParish }
    OPTIONAL {?locWorkShop grz-owl:in_sestriere/rdfs:label ?workshopSestriere}
    OPTIONAL {?locWorkShop grz-owl:writtenForm ?workshopLocDescription .}
  }
  OPTIONAL {?wm grz-owl:insigna ?ins . }
}

?contract grz-owl:introduces ?personMention .
?personMention grz-owl:role/grz-owl:roleType  ?personRole .
OPTIONAL { ?personMention grz-owl:gender ?gender . }
OPTIONAL { ?personMention grz-owl:age ?ageInt . }
?personMention grz-owl:profession ?profMention .
?profMention grz-owl:standardForm ?pmProf . 
?profMention grz-owl:professionCategory "stampa" .
OPTIONAL 
{ ?personMention grz-owl:geographicOrigin ?placeMention .
  OPTIONAL {?placeMention geo:geometry ?coord .}
  OPTIONAL {?placeMention grz-owl:writtenForm ?originGeoWF .}
  OPTIONAL {?placeMention grz-owl:standardForm ?originGeoSF .}
}
OPTIONAL { ?personMention grz-owl:identifiedPerson ?identifiedPerson . }
OPTIONAL { ?personMention grz-owl:hasEntityLink/grz-owl:refers_to ?personEntity . ?personEntity a grz-owl:Person . }

?personMention grz-owl:name ?appellation .
OPTIONAL { ?appellation grz-owl:hasNameComponent ?firstname . ?firstname a grz-owl:Firstname; grz-owl:writtenForm ?wfFirstname . }
OPTIONAL {?appellation grz-owl:hasNameComponent ?surname . ?surname a grz-owl:Surname; grz-owl:writtenForm ?wfSurname .}
OPTIONAL {?appellation grz-owl:hasNameComponent ?patronimic1 . ?patronimic1 a grz-owl:Patronimic1; grz-owl:writtenForm ?wfPatronimic1 .}

OPTIONAL { ?contract grz-owl:introduces ?masterMention .
?masterMention grz-owl:role/grz-owl:roleType  grz-owl:master .
?masterMention grz-owl:profession/grz-owl:standardForm ?mProf . }

FILTER (year(?date) > 1586 AND year(?date) < 1600)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment