Open martinnec opened 3 years ago
částka by neměla mít maximální plat
SPARQL for inwards relations : ?rangeDefinition -> ?domainDefinition:
DEFINE sql:signal-void-variables 0
PREFIX z: <https://slovník.gov.cz/základní/pojem/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
SELECT DISTINCT ?inwardsRelation ?domainElement WHERE {
?inwardsRelation a z:typ-vztahu ;
skos:prefLabel ?inwardsRelationLabel ;
skos:inScheme ?inwardsRelationGlossary .
{
?inwardsRelation rdfs:subClassOf ?rangeDefinition .
?rangeDefinition owl:allValuesFrom <https://slovník.gov.cz/generický/částky/pojem/částka> ;
owl:onProperty z:má-vztažený-prvek-2 .
} UNION {
?ancestorInwardsRelation rdfs:subClassOf [
owl:allValuesFrom <https://slovník.gov.cz/generický/částky/pojem/částka> ;
owl:onProperty z:má-vztažený-prvek-2
] .
?inwardsRelation rdfs:subClassOf+ ?ancestorInwardsRelation .
}
{
?inwardsRelation rdfs:subClassOf ?domainDefinition .
?domainDefinition owl:allValuesFrom ?domainElement ;
owl:onProperty z:má-vztažený-prvek-1 .
} UNION {
?inwardsRelation rdfs:subClassOf/rdfs:subClassOf ?domainDefinition .
?domainDefinition owl:allValuesFrom ?domainElement ;
owl:onProperty z:má-vztažený-prvek-1 .
FILTER NOT EXISTS {
?inwardsRelation rdfs:subClassOf/owl:onProperty z:má-vztažený-prvek-1 .
}
} UNION {
?inwardsRelation rdfs:subClassOf+/rdfs:subClassOf ?domainDefinition .
?domainDefinition owl:allValuesFrom ?domainElement ;
owl:onProperty z:má-vztažený-prvek-1 .
FILTER NOT EXISTS {
?inwardsRelation rdfs:subClassOf+ ?specificInwardsRelation .
?specificInwardsRelation rdfs:subClassOf+ ?domainDefinition ;
rdfs:subClassOf ?domainDefinition1 .
?domainDefinition1 owl:onProperty z:má-vztažený-prvek-1 .
}
}
OPTIONAL { ?inwardsRelation skos:definition ?inwardsRelationDefinition }
?domainElement skos:prefLabel ?domainLabel ;
skos:inScheme ?domainGlossary .
OPTIONAL { ?domainElement skos:definition ?domainDefinition }
OPTIONAL {
?inwardsRelation rdfs:subClassOf ?parentRelation .
?parentRelation a z:typ-vztahu .
FILTER (?parentRelation != <https://slovník.gov.cz/základní/pojem/vztah>)
}
}
A pak něco nefunguje u Provozovatele - nemůžu na něm nic přidat - zřejmě problém s modelováním dědičnosti ve tvaru W
I have fixed a problem with "maximální plat" (see hidden comments) ✔️ and the problem which was addressed here in the first comment. I am just not entirely sure whether the FILTER NOT EXISTS section should be copied somewhere else also, @martinnec.
sstenchlak/model-driven-data@fd370db
SPARQL queries shall return attributes/associations which inherit from attributes/associations associated with a class. However only when these inheriting attributes/associations do not have their own domain/range.
E.g. it is necessary to add the following condition to the SPARQL query which returns attributes of a class: