You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
07. What is the distribution of apprentices per age (based on mentions), with time window? (api:05_app_07_distrib_app_ages_withTW)
#+ tags:#+ - apprentices#+ params: ?_date_start ?_date_endSELECT?age (COUNT (distinct ?app) AS?NbApp)
WHERE
{
?appa common:PersonMention ; core:isMentionedIn ?contract .
?app grz-owl:hasRole grz-owl:Apprentice .
?app foaf:age ?age .
?contract sem:hasTimeStamp ?date .
BIND(IF(?date = "0"^^<http://www.w3.org/2001/XMLSchema#gYear>,"NO DATE", xsd:dateTime(?date) ) AS ?myDate)
BIND(IF(?myDate != "NO DATE", year(?myDate), "NODATE") AS ?year).
FILTER (?year > ?_date_start)
FILTER (?year < ?_date_end)
}
GROUP BY ?age
ORDER BY ASC (?age)
08. What is the distribution of apprentices per age (based on mentions), with a certain profession category? (api:05_app_08_distrib_app_ages_with_profX)
#+ tags:#+ - apprentices#+ params: ?_prof_cat# N.B: not all professions have a category. This is therefore a partial view.SELECT?age (COUNT (distinct ?app) AS?NbApp)
WHERE
{
?appa common:PersonMention ; core:isMentionedIn ?contract .
#?_profCategory is a string: "specchiaio, cappellaio, etc."?app grz-owl:hasRole grz-owl:Apprentice ; grz-owl:hasProfession ?prof. ?prof grz-owl:professionCategory ?_profCategory .
?app foaf:age ?age .
}
GROUPBY?ageORDERBYASC (?age)
09. What is the distribution of apprentices per age (based on mentions), within a time window and with a certain profession category? (api:05_app_09_distrib_app_ages_with_profX_withTW)
#+ tags:#+ - apprentices#+ params: ?_prof_cat ?_date_start ?_date_endSELECT?age (COUNT (distinct ?app) AS?NbApp)
WHERE
{
?appa common:PersonMention .
#?_profCategory is a string: "specchiaio, cappellaio, etc."?app grz-owl:hasRole grz-owl:Apprentice ; grz-owl:hasProfession/grz-owl:professionCategory 'specchiaio' .
?app foaf:age ?age .
?app core:isMentionedIn ?contract .
?contract sem:hasTimeStamp ?date .
BIND(IF(?date = "0"^^<http://www.w3.org/2001/XMLSchema#gYear>,"NO DATE", xsd:dateTime(?date) ) AS ?myDate)
BIND(IF(?myDate != "NO DATE", year(?myDate), "NODATE") AS ?year)
FILTER (?year > ?_date_start)
FILTER (?year < ?_date_end)
}
GROUP BY ?age
ORDER BY ASC (?age)
10. What is the average age of apprentices (all, for ages indicated in integers)? (api:05_app_10_avg_app_age)
15. Give me the possible apprentice combinations of roles with their frequency (currently not working, to be revised) (api:05_15_app_role_combinations)
#+ tags:#+ - apprenticesSELECT (COUNT (distinct ?appMention) AS?nbMentions) ?rolesWHERE
{
?appa common:Person ; grz-owl:hasRole ?role . ?role rdf:value ?role1, ?role2 .
?app core:referredBy ?appMention .
FILTER (?role1 != ?role2)
BIND(CONCAT(STRAFTER(STR(?role1),"#"), STRAFTER(STR(?role2), "#")) AS ?roles)
}
GROUP BY ?app ?roles
HAVING(?nbMentions > 1)
ORDER BY DESC (?nbMentions)
16. Give me the list of apprentices who fled, with relative information
SELECT ?DHCLink ?contractDate ?appUuid ?appLabel ?appAge ?appAgeText ?appGeoOriginsTranscript ?appProfession ?masterLabel ?masterProfession ?denunciationDate ?fleeStartDate ?fleeEndDate ?SalaryInGoodOrMoney ?SalaryType ?SalaryPaidBy ?SalaryPeriodization ?SalaryPartialAmount ?SalaryTotalAmount ?SalaryCurrency
WHERE
{
#about contract?contracta grz-owl:Contract ; sem:hasTimeStamp ?date ; grz-owl:hasCondition ?finCond ; core:hasMention ?app , ?master, ?flee .
?contract ^edm:realizes ?page .
?pagea meta:Page; meta:isImagedBy ?x . ?x iiif:service ?DHCLink .
BIND(IF(?date = "0"^^<http://www.w3.org/2001/XMLSchema#gYear>,"NO DATE", xsd:dateTime(?date) ) AS ?myDate)
BIND(IF(?myDate != "NO DATE", STR(?myDate), "NODATE") AS ?contractDate)
#about flee
?flee a common:EventMention ; sem:eventType grz-owl:Flee .
OPTIONAL {?flee grz-owl:denunciationDate ?denunDate .
BIND (STR(?denunDate) AS ?denunciationDate)}
OPTIONAL {?flee sem:hasBeginTimeStamp ?start.
BIND (STR(?start) AS ?fleeStartDate)}
OPTIONAL {?flee sem:hasEndTimeStamp ?end.
BIND (STR(?end) AS ?fleeEndDate)}
#about apprentice
?app a common:PersonMention ; dhc:uuid ?appUuid ; grz-owl:hasRole grz-owl:Apprentice ; grz-owl:hasName/rdfs:label ?appLabel ; core:isMentionedIn ?contract .
OPTIONAL {?app grz-owl:hasGeographicalOrigin/common:transcript ?GeoOriginsTranscript .}
OPTIONAL {?app grz-owl:hasProfession/common:transcript ?appProf }
OPTIONAL {?app foaf:age ?appAge }
OPTIONAL {?app grz-owl:ageText ?at }
# about master
?master a common:PersonMention ; grz-owl:hasRole grz-owl:Master ; grz-owl:hasName/rdfs:label ?masterLabel .
OPTIONAL {?master grz-owl:hasProfession/common:transcript ?masterProf }
# about financial conditions
?finCond a grz-owl:FinancialCondition ; grz-owl:conditionType ?findConType .
OPTIONAL{?finCond grz-owl:paidBy ?PaidBy ; grz-owl:paidInGoods ?GoodOrMoney ; grz-owl:partialAmount ?PartialAmount ; grz-owl:totalAmount ?TotalAmount ; grz-owl:currencyUnit ?Currency ; grz-owl:periodization ?Periodization}
# bindings
BIND(STRAFTER(STR(?findConType), "garzoni#") AS ?SalaryType)
BIND(STR(?GoodOrMoney) AS ?SalaryInGoodOrMoney)
BIND(STR(?TotalAmount) AS ?SalaryTotalAmount)
BIND(STR(?PartialAmount) AS ?SalaryPartialAmount)
BIND(STRAFTER(STR(?Currency), "garzoni#") AS ?SalaryCurrency)
BIND(STRAFTER(STR(?Periodization), "garzoni#") AS ?SalaryPeriodization)
BIND(STRAFTER(STR(?PaidBy), "garzoni#") AS ?SalaryPaidBy)
BIND(STR(?GeoOriginsTranscript) AS ?appGeoOriginsTranscript)
BIND(STR(?masterProf) AS ?masterProfession)
BIND(STR(?appProf) AS ?appProfession)
BIND(STR(?at) AS ?appAgeText)
}