SELECT ?rootQuestion WHERE { ?rootQuestion a doc:question . # TODO temporal fix remove !!! OPTIONAL { ?rootQuestion form:has-template ?rootQT . } FILTER( (?rootQT = e-a-3.4.0.2:e-24-qt) || (!bound(?rootQT))) FILTER NOT EXISTS { ?superQuestion doc:has_related_question ?rootQuestion . ?superQuestion a doc:question } }
###################### ###### NOT WORKING ##### ###################### ### " BMS140 letící DCT PITOK se EC EPWW nepodařilo přeladit na kmitočet sektoru M. "@en http://onto.fel.cvut.cz/ontologies/documentation/report-i/246BAFD49E19E611B897002655546824.e5x/246BAFD49E19E611B897002655546824.xml ### PIC po DEP ohlasil střet s ptákem v bodě rotace. http://onto.fel.cvut.cz/ontologies/documentation/report-i/36E482143035E611B897002655546824.e5x/36E482143035E611B897002655546824.xml ##################### ###### DEPRECATED ##### ##################### ### RCOM LKPR - Rušení FREQ 132,890 http://onto.fel.cvut.cz/ontologies/report-2FA6D6D1AE15E611B897002655546824.xml
CONSTRUCT { ?q form:is-relevant-if "saved-questions" . } WHERE { ?q a doc:question . }
# there is a question that is both clone and cloned ASK WHERE { ?q form:is-clone-of-question ?clonedQ . ?cloneQ form:is-clone-of-question ?q . }
there is a question that is both clone and cloned
# there is a question that is clone of multiple questions ASK WHERE { ?q form:is-clone-of-question ?clonedQ1 ; form:is-clone-of-question ?clonedQ2 . FILTER(?clonedQ1 != ?clonedQ2) }
there is a question that is clone of multiple questions
# there is a question clone without answer value ASK WHERE { ?q a doc:question ; form:is-clone-of-question ?clonedQ . FILTER NOT EXISTS { ?q doc:has_answer ?a . ?a doc:has_data_value ?qPath . } }
there is a question clone without answer value
CONSTRUCT { ?q doc:has_answer ?boundA . ?boundA a doc:answer ; doc:has_data_value ?qPath . } WHERE { ?q form:is-clone-of-question ?clonedQ . ?clonedQ form-ecc-gen-0.2:has-question-path ?clonedQPath . OPTIONAL { ?q doc:has_answer ?a . } BIND(concat("links to ", ?clonedQPath, "") as ?qPath) BIND(form-ecc-lib:create-a(?q) as ?newA) BIND(COALESCE(?a, ?newA) as ?boundA) }
# each section defines subset of attributes of exactly one entity ASK WHERE { # SERVICE ?operationalFullServiceUri { # ?topic e-mv:entityid ?ent . # ?topic e-mv:has_child ?section . # ?section e-mv:allattributes ?attr . # ?section rdfs:label ?sectionLabel . # } }
each section defines subset of attributes of exactly one entity
# there is a question template relation that does not have its reification constructed ASK WHERE { ?parent_qt form:has-subtemplate ?child_qt . FILTER NOT EXISTS { ?r_qt_relation rdf:subject ?parent_qt ; rdf:predicate form:has-subtemplate ; rdf:object ?child_qt . } }
there is a question template relation that does not have its reification constructed
# there is a section with sub-template relation that does not have its reification ASK WHERE { ?section_qt form:has-subtemplate ?child_qt ; form:has-origin-type e-mv:section . FILTER NOT EXISTS { ?r_qt_relation rdf:subject ?section_qt ; rdf:predicate form:has-subtemplate ; rdf:object ?child_qt . } }
there is a section with sub-template relation that does not have its reification
# constuct eccairs views CONSTRUCT { # TODO -- not very readable .. should have been constructed incrementaly using construct-recursion ?ent_qt form:has-subtemplate ?section_qt . ?section_qt a form:question-template ; form:has-subtemplate ?attr_qt ; rdfs:label ?sectionLabelFixed ; form:has-template-origin ?section ; form:has-origin-type e-mv:section . ?r_sec_attr_qt_relation rdf:subject ?section_qt ; rdf:predicate form:has-subtemplate ; rdf:object ?attr_qt ; form:is-relevant-if ?isLinkFlag . ?r_ent_sec_qt_relation rdf:subject ?ent_qt ; rdf:predicate form:has-subtemplate ; rdf:object ?section_qt . # filtering rule ?r_qt_relation rdf:subject ?ent_qt ; rdf:predicate form:has-subtemplate ; rdf:object ?attr_qt ; form:is-relevant-if "eccairs-data-schema" . } WHERE { # match question template entity -> attribute ?ent_qt form:has-subtemplate ?attr_qt . ?ent_qt form:has-template-origin ?ent . ?attr_qt form:has-template-origin ?attr . ?ent a e-m:entity . ?attr a e-m:attribute . # match softlinks ?r_qt_relation rdf:subject ?ent_qt ; rdf:predicate form:has-subtemplate ; rdf:object ?attr_qt . OPTIONAL { ?r_qt_relation form:is-relevant-if ?isLinkFlag . } SERVICE ?operationalFullServiceUri { ?topic e-mv:entityid ?ent . ?topic e-mv:has_child ?section . ?section e-mv:allattributes ?attr . ?section rdfs:label ?sectionLabel . } # bind new reification of entity -> section relation BIND(md5(concat(str(?r_qt_relation), "-", str(?section))) as ?r_new_qt_relation_id) BIND(iri(concat(str(?ent), "-", ?r_new_qt_relation_id, "-qts-relation")) as ?r_ent_sec_qt_relation) # bind new reification of section -> attribute relation BIND(iri(concat(str(?section), "-", ?r_new_qt_relation_id, "-qts-relation")) as ?r_sec_attr_qt_relation) BIND(form-ecc-lib:create-qt(?section) as ?section_qt) # BIND(spif:titleCase(fn:lower-case(replace(?sectionLabel, "_", " "))) as ?sectionLabelFixed) BIND(fn:lower-case(replace(?sectionLabel, "_", " ")) as ?sectionLabelFixed) }
# 1 - annotate uniset attributes CONSTRUCT { ?qt form:is-relevant-if "uniset-event-enhancement" . } WHERE { SERVICE ?eccairsMappingServiceUri { ?situation a e-m-map:organization-to-attribute-mapping ; e-m-map:has-if-present-organization-type ?organizationType ; # e-m-map:has-if-present-attribute-value ?eccRelAttributeValue . e-m-map:has-related-attribute-value ?eccAttributeValue . } ?qt form:has-template-origin ?eccAttributeValue . }
# 0 - annotate event-type specific attributes CONSTRUCT { ?qt form:is-relevant-if ?eccEventType . ?eccEventType a e-m:value . } WHERE { SERVICE ?eccairsMappingServiceUri { ?situation a e-m-map:event-type-to-attribute-mapping ; e-m-map:has-event-type-value ?eccEventType ; e-m-map:has-if-present-organization-type ?organizationType ; # e-m-map:has-if-present-attribute-value ?eccRelAttributeValue . e-m-map:has-related-attribute-value ?eccAttributeValue . } ?qt form:has-template-origin ?eccAttributeValue . }
0 - annotate event-type specific attributes
Attach attribute-based event-type filter to templates
# there exists question that relates to link but is not clone of any other question ASK WHERE { FILTER(true = false) }
there exists question that relates to link but is not clone of any other question
# construct links between event-type questions CONSTRUCT { ?q1 form:is-clone-of-question ?q2 ; form:is-relevant-if "is-question-clone" . } WHERE { # bind question 1 ?parentQ1 doc:has_related_question ?q1 ; form:has-template ?parentQT1 . ?q1 a doc:question ; form:has-template ?qt ; ### constructed by event-enhancement form:is-relevant-if "event-enhancement" . ?q1QTSRelation rdf:subject ?parentQT1 ; rdf:object ?qt. # bind question 2 ?parentQ2 doc:has_related_question ?q2 ; form:has-template ?parentQT2 . ?q2 a doc:question ; form:has-template ?qt ; ### constructed by event-enhancement form:is-relevant-if "event-enhancement" . ?q2QTSRelation rdf:subject ?parentQT2 ; rdf:object ?qt. # check link template ?q1QTSRelation form:is-link-template-of ?q2QTSRelation . FILTER(?q1 != ?q2) }
construct links between event-type questions
CONSTRUCT { ?a a doc:answer . ?q doc:has_answer ?a . } WHERE { ?q a doc:question . BIND(form-ecc-lib:create-a(?q) as ?a) }
# construct links between imported questions CONSTRUCT { ?q1 form:is-clone-of-question ?q2 ; form:is-relevant-if "is-question-clone" . } WHERE { ?q1 a doc:question ; form:has-question-origin ?q1Origin . ?q1Origin form-ecc-gen-0.2:is-origin-of-question-templates-reification ?q1QTSRelation ; rdf:object ?qObject . ?q2 a doc:question ; form:has-question-origin ?q2Origin . ?q2Origin form-ecc-gen-0.2:is-origin-of-question-templates-reification ?q2QTSRelation ; rdf:object ?qObject . ?q1QTSRelation form:is-link-template-of ?q2QTSRelation . FILTER(?q1 != ?q2) }
construct links between imported questions
# there is a question template without label ASK WHERE { ?qt a form:question-template . FILTER NOT EXISTS { ?qt rdfs:label ?label . } . }
there is a question template without label
# 0 - there is a question without specified question template ASK WHERE { ?question a doc:question . FILTER NOT EXISTS { ?question form:has-template ?questionTemplate . } . }
0 - there is a question without specified question template
# 1 - there is a question without specified question origin ASK WHERE { ?question a doc:question . FILTER NOT EXISTS { ?question form:has-question-origin ?origin . } . }
1 - there is a question without specified question origin
# 3 - question for a question origin does not exist ASK WHERE { FILTER(! bound(?savedQAExists)) ?questionOrigin a form:question-origin . FILTER NOT EXISTS { ?q form:has-question-origin ?questionOrigin . } }
3 - question for a question origin does not exist
# 4 - there is a question with two parent questions w.r.t. has_related_question relation ASK WHERE { ?parentQ1 doc:has_related_question ?childQ . ?parentQ2 doc:has_related_question ?childQ . FILTER(?parentQ1 != ?parentQ2) }
4 - there is a question with two parent questions w.r.t. has_related_question relation
# 0 - construct simple imported questions (without section) CONSTRUCT { ?parentQ doc:has_related_question ?childQ . ?childQ a doc:question ; form:has-question-origin ?childOrigin ; form:has-template ?childQT ; form:is-relevant-if "imported-question" . # for debugging only ?childQ skos:altLabel ?childLabel . } WHERE { # precondition -- questions where not saved yet FILTER(! bound(?savedQAExists)) # bind parent Q ?parentQ a doc:question ; form:has-question-origin ?parentOrigin ; form:has-template ?parentQT . # parent must not be created from softlink ?parentOrigin form-ecc-gen-0.2:is-origin-of-question-templates-reification ?parentQTRelation . FILTER NOT EXISTS { ?parentQTRelation form:is-relevant-if "is-link" . } # bind childOrigin, childQT; bound(?childOrigin) => not a section ?childOrigin a form:question-origin ; form-ecc-gen-0.2:is-origin-of-question-template ?childQT ; rdf:subject ?parentObject . ?parentOrigin rdf:object ?parentObject . # retrive from QT schema ?parentQT form:has-subtemplate ?childQT . # childQT is entity => childOrigin is one per question BIND(form-ecc-lib:create-q(concat(str(?childOrigin), "-", ?executionId)) AS ?childQ) # for debugging only ?childQT rdfs:label ?childLabel . }
0 - construct simple imported questions (without section)
# 1 - construct imported questions within section CONSTRUCT { ?entQ doc:has_related_question ?secQ . ?secQ a doc:question ; form:has-question-origin ?secOrigin ; form:has-template ?secQT ; form:is-relevant-if "imported-question" ; form:is-relevant-if "section-question" ; doc:has_related_question ?attrQ . ?attrQ a doc:question ; form:has-question-origin ?attrOrigin ; form:has-template ?attrQT ; form:is-relevant-if "imported-question" ; form:is-relevant-if "part-of-view-question" ; form:is-relevant-if ?isLinkFlag . # for debugging only ?secQ skos:altLabel ?secLabel . ?attrQ skos:altLabel ?attrLabel . } WHERE { # precondition -- questions where not saved yet FILTER(! bound(?savedQAExists)) # bind entQ ?entQ a doc:question ; form:has-question-origin ?entOrigin ; form:has-template ?entQT . # entQ must not be created from softlink ?entOrigin form-ecc-gen-0.2:is-origin-of-question-templates-reification ?entQTRelation . FILTER NOT EXISTS { ?entQTRelation form:is-relevant-if "is-link" . } # bind attrOrigin, attrQT ?attrOrigin form-ecc-gen-0.2:is-origin-of-question-template ?attrQT ; rdf:subject ?entObject . ?entOrigin rdf:object ?entObject . # bind entQT -> secQT -> attrQT ?entQT form:has-subtemplate ?secQT . ?secQT form:has-subtemplate ?attrQT . # ensure secQT is section ?secQT form:has-template-origin ?section . ?secQT form:has-origin-type e-mv:section . # bind section metadata BIND(md5(concat(str(?entOrigin), str(?section), ?executionId)) as ?secId) BIND(form-ecc-lib:create-qo(?secQT) AS ?secOrigin) BIND(form-ecc-lib:create-q(concat(str(?section),"-",?secId)) AS ?secQ) # bind attr metadata BIND(md5(concat(str(?section), str(?attrOrigin), ?executionId)) as ?attrId) BIND(form-ecc-lib:create-q(concat(str(?attrOrigin),"-",?attrId)) AS ?attrQ) # for debugging only ?secQT rdfs:label ?secLabel . ?attrQT rdfs:label ?attrLabel . }
1 - construct imported questions within section
There is no need to pay special attention to hard-links as each question origin of imported data represents exactly 1 hard-link.
CONSTRUCT { ?rootQ form-ecc-gen-0.2:has-question-path "" . } WHERE { ?rootQT form:has-template-origin ?rootEntity . ?rootQ form:has-template ?rootQT . }
# there is a question without question path assigned ASK WHERE { ?q a doc:question . FILTER NOT EXISTS { ?q form-ecc-gen-0.2:has-question-path ?path . } }
there is a question without question path assigned
CONSTRUCT { ?childQ form-ecc-gen-0.2:has-question-path ?childPath . } WHERE { ?parentQ form-ecc-gen-0.2:has-question-path ?parentPath . ?parentQ doc:has_related_question ?childQ . ?childQ rdfs:label ?childLabel . BIND(concat(?parentPath, "/", ?childLabel) as ?childPath) }
# TODO nemalo by byt potreba to viazat na eccairs schema URI CONSTRUCT { ?question form:has-possible-values-query ?downloadString . # TODO layout sem nepatri !!!! ?question form-lt:has-layout-class "type-ahead" . } WHERE { # get all attributes with predefined value type SERVICE ?eccairsSchemaServiceUri { ?eccAttribute a e-m:attribute . ?eccAttribute e-m:has-value-type "PredefinedValueList" . } ?question a doc:question . ?question form:has-template ?questionTemplate . ?questionTemplate form:has-template-origin ?eccAttribute . BIND(CONCAT(str(?eccairsSchemaServiceUri), "&query=") as ?dowloadPrefix) BIND(replace(?attributePossibleValuesQueryTemplate, "XXXXX", str(?eccAttribute)) as ?downloadSuffixRaw) BIND(ENCODE_FOR_URI(?downloadSuffixRaw) as ?downloadSuffix) BIND(concat(?dowloadPrefix, ?downloadSuffix) as ?downloadString) }
TODO nemalo by byt potreba to viazat na eccairs schema URI
# there is a template without label ASK WHERE { ?qt a form:question-template . OPTIONAL { ?qt rdfs:label ?qtLabel . } FILTER(! bound(?qtLabel)) }
# there is a subtemplate relation without label ASK WHERE { ?qtsRelation rdf:predicate form:has-subtemplate . OPTIONAL { ?qtsRelation rdfs:label ?qtsRelationLabel . } FILTER(! bound(?qtsRelationLabel)) }
there is a subtemplate relation without label
CONSTRUCT { ?qtsRelation rdfs:label ?qtsRelationLabel . } WHERE { ?qtsRelation rdf:predicate form:has-subtemplate ; rdf:object ?objQT . ?objQT rdfs:label ?objQTLabel . OPTIONAL { ?qtsRelation rdf:subject ?subjQT . ?subjQT rdfs:label ?subjQTLabel . } BIND(COALESCE(?subjQTLabel, "") as ?subjQTBoundLabel) BIND(concat(?subjQTBoundLabel, " -> ", ?objQTLabel) as ?qtsRelationLabel) }
# 1 - propagates is-relevant-if uniset-flag from attributes to entities CONSTRUCT { ?parentQT form:is-relevant-if "uniset-event-enhancement" . } WHERE { ?parentQT form:has-subtemplate ?childQT . ?childQT form:is-relevant-if "uniset-event-enhancement" . }
1 - propagates is-relevant-if uniset-flag from attributes to entities
# 0 - propagates is-relevant-if event from attributes to entities CONSTRUCT { ?parentQT form:is-relevant-if ?eccEventType . } WHERE { ?parentQT form:has-subtemplate ?childQT . ?childQT form:is-relevant-if ?eccEventType . ?eccEventType a e-m:value . }
0 - propagates is-relevant-if event from attributes to entities
Attach entity-based event-type filter to templates
prefix e-m: <http://onto.fel.cvut.cz/ontologies/eccairs/model/> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> CONSTRUCT { ?value rdfs:label ?label . ?value rdfs:comment ?explanation . } WHERE { ?eccAttribute a e-m:attribute . ?eccAttribute e-m:has-child+ ?value . ?value rdfs:label ?label . ?value e-m:has-explanation ?explanation . } VALUES (?eccAttribute) { (<XXXXX>) }
# event type matcher not bound ASK WHERE { FILTER(! bound(?eventTypeMatcher)) }
# bind matcher for event type enhancement SELECT ?eventTypeMatcher WHERE { # BIND(COALESCE(iri(?eventType), "uniset-event-enhancement") as ?eventTypeMatcher) BIND(iri(?eventType) as ?eventTypeIri) OPTIONAL { ?qt form:is-relevant-if ?eventTypeIri . } BIND((bound(?qt) && bound(?eventType)) as ?hasSpecificEventMapping) BIND(IF(?hasSpecificEventMapping, ?eventTypeIri, "uniset-event-enhancement") as ?eventTypeMatcher) } LIMIT 1
# input parameter "isIdempotent" is invalid ({?isIdempotent}) ASK { FILTER ( bound(?isIdempotent) && (str(?isIdempotent) != "true") && (str(?isIdempotent) != "false") ) }
input parameter "isIdempotent" is invalid ({?isIdempotent})
# input parameter reportKey is not bound ASK { FILTER ( ! bound(?reportKey) ) }
# input parameter executionId is not bound ASK { FILTER ( ! bound(?executionId) ) }
input parameter executionId is not bound
SELECT ?executionId { # default value BIND(str(COALESCE(?isIdempotent, true)) as ?isIdempotentStr) # bind event BIND(COALESCE(str(?event), "") as ?eventStr) BIND(IF( ?isIdempotentStr = "false", STRUUID(), md5(concat(str(?reportKey), ?eventStr))) as ?executionId) }
SELECT ?importedReportExists WHERE { ?q a e-m:instance . BIND("true"^^xsd:boolean as ?importedReportExists) } LIMIT 1
SELECT ?savedQAExists WHERE { ?q a doc:question . BIND("true"^^xsd:boolean as ?savedQAExists) } LIMIT 1
SELECT ?reportKey WHERE { ?report a doc:report . ?report doc:has_key ?reportKey . }
CONSTRUCT { ?valueObject a form:answer-origin . } WHERE { # precondition -- questions where not saved yet FILTER(! bound(?savedQAExists)) ?qOrigin a form:question-origin . # find concrete data ?qOrigin rdf:object ?i . # retrieve answer value ?i a e-m:instance . ?i e-m:has-value ?valueObject . }
# there is an answer origin not connected to any question ASK WHERE { ?ao a form:answer-origin . FILTER NOT EXISTS { ?q doc:has_answer ?a . ?a form:has-answer-origin ?ao . } }
there is an answer origin not connected to any question
# there is an answer to a question that has two data value ASK WHERE { ?a a doc:answer . ?a doc:has_data_value ?dataValue1 . ?a doc:has_data_value ?dataValue2 . FILTER(?dataValue1 != ?dataValue2) }
there is an answer to a question that has two data value
# there is an answer to a question that has two data value ASK WHERE { ?a a doc:answer . ?a doc:has_object_value ?objectValue1 . ?a doc:has_object_value ?objectValue2 . FILTER(?objectValue1 != ?objectValue2) }
# 0 - populate code value answers CONSTRUCT { ?a doc:has_object_value ?codeValue . ?a form:has-answer-origin ?codeObject . } WHERE { # precondition -- questions where not saved yet FILTER(! bound(?savedQAExists)) # match question, answer instance ?a a doc:answer . ?q doc:has_answer ?a ; form:has-question-origin ?qOrigin . # find concrete data ?qOrigin rdf:object ?i . # retrieve answer value ?i a e-m:instance . ?i e-m:has-value ?codeObject . ?codeObject e-m:has-code-value ?codeValue . # attach metadata # TODO maybe elsewhere SERVICE ?eccairsSchemaServiceUri { ?codeValue rdfs:label ?codeLabel . OPTIONAL { ?codeValue e-m:has-explanation ?codeComment . } } }
# 1 - populate text value answers CONSTRUCT { ?a doc:has_data_value ?textValue . ?a form:has-answer-origin ?textObject . } WHERE { # precondition -- questions where not saved yet FILTER(! bound(?savedQAExists)) # match question, answer instance ?a a doc:answer . ?q doc:has_answer ?a ; form:has-question-origin ?qOrigin . # find concrete data ?qOrigin rdf:object ?i . # retrieve answer value ?i a e-m:instance . ?i e-m:has-value ?textObject . ?textObject e-m:has-text-value ?textValue . }
CONSTRUCT { ?q a doc:question ; form:has-question-origin ?qOrigin ; form:is-relevant-if "imported-questions" . } WHERE { # apply only if there are no saved questions FILTER(?savedQAExists = false) ?qOrigin a form:question-origin . BIND(form-ecc-lib:create-q(concat(str(?qOrigin), "-", ?executionId)) as ?q) # TODO ---- execution ID ? }
# 0 - ?rootEntity is not bound ASK WHERE { FILTER(! bound(?rootEntity)) }
# 1 - there is no root e-m:instance of type ?rootEntity ASK WHERE { ?i a e-m:instance . FILTER NOT EXISTS { ?root_i a e-m:instance . ?root_i a ?rootEntity . } }
1 - there is no root e-m:instance of type ?rootEntity
# 2 - there is more than one root e-m:instance of type ?rootEntity ASK WHERE { ?root_i1 a ?rootEntity ; a e-m:instance . ?root_i1 a ?rootEntity ; a e-m:instance . FILTER(?root_i1 != ?root_i2) }
2 - there is more than one root e-m:instance of type ?rootEntity
# 0 - there is some eccairs attribute or entity not associated with question origin ASK WHERE { ?o e-m:has-child-instance|^e-m:has-child-instance ?connectedObject . FILTER NOT EXISTS { ?questionOrigin a form:question-origin ; rdf:object ?o . } }
0 - there is some eccairs attribute or entity not associated with question origin
# 1 - there is a question origin refering to multiple subjects of a relation ASK WHERE { ?questionOrigin a form:question-origin ; rdf:subject ?s1 ; rdf:subject ?s2 . FILTER(?s1 != ?s2) }
1 - there is a question origin refering to multiple subjects of a relation
#2 - there is a question origin refering to multiple objects of a relation ASK WHERE { ?questionOrigin a form:question-origin ; rdf:object ?o1 ; rdf:object ?o2 . FILTER(?o1 != ?o2) }
2 - there is a question origin refering to multiple objects of a relation
# 0 - create imported question origins CONSTRUCT { ?r_so a form:question-origin ; a rdf:Statement ; rdf:subject ?s ; rdf:predicate e-m:has-child-instance ; rdf:object ?o . ?o a ?o_type . } WHERE { # origins are accessible from form root ?rootO a ?rootEntity ; e-m:has-child-instance* ?o . ?o a e-m:instance . OPTIONAL { ?s e-m:has-child-instance ?o . } # add type ?o a ?o_type . FILTER(?o_type != e-m:instance) BIND(COALESCE(concat("-", md5(str(?s))),"") as ?subjectHash) BIND(form-ecc-lib:create-qo(concat(str(?o), ?subjectHash)) as ?r_so) . # label for debugging BIND(?s as ?boundS) OPTIONAL { ?boundS rdfs:label ?sLabel . } }
# ?rootEntity is not bound ASK WHERE { FILTER(! bound(?rootEntity)) }
# there is a question without specified question origin ASK WHERE { ?question a doc:question . FILTER NOT EXISTS { ?question form:has-question-origin ?origin . } . }
there is a question without specified question origin
# there is a question without specified question template ASK WHERE { ?question a doc:question . FILTER NOT EXISTS { ?question form:has-template ?questionTemplate . } . }
there is a question without specified question template
# 0 - construct ROOT question if not present CONSTRUCT { ?rootQ a doc:question ; form:has-origin-type ?rootEntity ; form:has-question-origin ?rootOrigin ; form:has-template ?rootQT . } WHERE { ?rootQT form:has-template-origin ?rootEntity . # do nothing if having root question FILTER NOT EXISTS { ?rootQNotBound form:has-template ?rootQT . } # assign new root question based on imported data OPTIONAL { ?importedOrigin form-ecc-gen-0.2:is-origin-of-question-template ?rootQT . } BIND(form-ecc-lib:create-q(concat(str(?importedOrigin))) as ?importedRootQ) #assign new root question based on root template BIND(form-ecc-lib:create-q(concat(str(?rootQT),"-", ?executionId)) as ?newRootQ) # bind new variables BIND(COALESCE(?importedRootQ, ?newRootQ) as ?rootQ) BIND(COALESCE(?importedOrigin, ?rootQT) as ?rootOrigin) }
0 - construct ROOT question if not present
# there exists eccairs entity that does not have reification of its has-child relationship ASK WHERE { SERVICE ?eccairsSchemaServiceUri { ?s a e-m:entity . ?s e-m:has-child ?o . OPTIONAL { ?reification rdf:subject ?s ; rdf:predicate e-m:has-child ; rdf:object ?o . } FILTER(!bound(?reification)) } }
there exists eccairs entity that does not have reification of its has-child relationship
# 0 - create root question templates CONSTRUCT { ?r_qt_relation rdf:predicate form:has-subtemplate ; rdf:object ?o_qt ; } WHERE { SERVICE ?eccairsSchemaServiceUri { ?o a e-m:entity . FILTER NOT EXISTS { ?notBoundParent e-m:has-child ?o . } } BIND(iri(concat(str(?o), "-qts-relation")) as ?r_qt_relation) BIND(form-ecc-lib:create-qt(?o) as ?o_qt) }
# 1 - create structure of question templates CONSTRUCT { ?s_qt form:has-subtemplate ?o_qt . ?r_qt_relation rdf:subject ?s_qt ; rdf:predicate form:has-subtemplate ; rdf:object ?o_qt ; form:is-relevant-if ?isLinkStr . } WHERE { SERVICE ?eccairsSchemaServiceUri { ?s a e-m:entity . ?s e-m:has-child ?o . ?reification rdf:subject ?s ; rdf:predicate e-m:has-child ; rdf:object ?o . OPTIONAL { ?reification e-m:is-link ?isLinkFlag . } } BIND(IF(?isLinkFlag = "1", "is-link", ?notBoundVariable) as ?isLinkStr) BIND(iri(concat(str(?reification), "-qts-relation")) as ?r_qt_relation) BIND(form-ecc-lib:create-qt(?s) as ?s_qt) BIND(form-ecc-lib:create-qt(?o) as ?o_qt) }
1 - create structure of question templates
# 2 - attach info to each question template CONSTRUCT { ?s a ?type . ?s_qt form:has-template-origin ?s . ?s_qt form:has-origin-type ?type . ?s_qt a form:question-template . ?s_qt rdfs:label ?sLabel . ?s_qt rdfs:comment ?sDescription . } WHERE { SERVICE ?eccairsSchemaServiceUri { ?s a ?type . ?s rdfs:label ?sLabel . ?s e-m:has-explanation ?sDescription . FILTER(?type in (e-m:entity, e-m:attribute)) } BIND(form-ecc-lib:create-qt(?s) as ?s_qt) }
2 - attach info to each question template
# question for a question template matched by eventTypeMatcher not found ASK WHERE { ?childQT form:is-relevant-if ?eventTypeMatcher . FILTER NOT EXISTS { ?q form:has-template ?childQT . } }
question for a question template matched by eventTypeMatcher not found
# there is a question with two parent questions w.r.t. has_related_question relation ASK WHERE { ?parentQ1 doc:has_related_question ?childQ . ?parentQ2 doc:has_related_question ?childQ . FILTER(?parentQ1 != ?parentQ2) }
there is a question with two parent questions w.r.t. has_related_question relation
# 0 - construct next level of questions based on event type CONSTRUCT { # TODO (management issues) -- caching should be rather automatic and thus input must be "filter irrelevant questions" instead ?childQ a doc:question ; form:has-origin-type ?childEntity ; form:has-question-origin ?childOrigin ; form:has-template ?childQT ; form:is-relevant-if "event-enhancement" ; form:is-relevant-if ?eventTypeMatcher . ?parentQ doc:has_related_question ?childQ . # only for debugging ?childQ skos:altLabel ?childLabel . } WHERE { # bind templates that are relevant to eventType ?childQT form:is-relevant-if ?eventTypeMatcher . # find parent question to attach to ?parentQ a doc:question ; form:has-template ?parentQT . ?parentQT form:has-subtemplate ?childQT . ?childQT form:has-template-origin ?childEntity . # attach only if parentQ is not link ?parentQTRelation rdf:object ?parentQT . { ?grantParentQ doc:has_related_question ?parentQ ; form:has-template ?grandParentQT . ?parentQTRelation rdf:subject ?grandParentQT . FILTER NOT EXISTS { ?parentQTRelation form:is-relevant-if "is-link" . } } UNION { FILTER NOT EXISTS { ?grantParentQ doc:has_related_question ?parentQ . } } # bind new question BIND(md5(concat(str(?parentQ), str(?childQT), ?executionId)) as ?childId) BIND(form-ecc-lib:create-q(concat(str(?childQT),"-", ?childId)) as ?childQ) # bind child origin BIND(form-ecc-lib:create-qo(?childQT) as ?childOrigin) # create only if question does not exist already FILTER NOT EXISTS { ?parentQ doc:has_related_question ?childQNotBound . ?childQNotBound form:has-template ?childQT . } # only for debugging ?childQT rdfs:label ?childLabel . }
0 - construct next level of questions based on event type
Attach event-type questions from templates
# 0 - there is a question-template without a label ASK WHERE { ?qt a form:question-template . OPTIONAL { ?qt rdfs:label ?label . } FILTER( !bound(?label)) }
0 - there is a question-template without a label
# there are multiple levels of sections (NOT IMPLEMENTED) ASK WHERE { ?parent_section_qt form:has-subtemplate ?section_qt ; form:has-origin-type e-mv:section . ?section_qt form:has-subtemplate ?child_qt ; form:has-origin-type e-mv:section . }
there are multiple levels of sections (NOT IMPLEMENTED)
# 0 - there are two sections sharing same attribute but are not implementing symlinks ASK # TODO -- make it not eccairs specific, make it more generic w.r.t. multiple levels of sections WHERE { ?root_qt form:has-subtemplate ?section1_qt ; form:has-subtemplate ?section2_qt . FILTER(?section1_qt != ?section2_qt) ?section1_qt form:has-subtemplate ?child_qt ; form:has-origin-type e-mv:section . ?section2_qt form:has-subtemplate ?child_qt ; form:has-origin-type e-mv:section . ?r_1_qt_relation rdf:subject ?section1_qt ; rdf:predicate form:has-subtemplate ; rdf:object ?child_qt . ?r_2_qt_relation rdf:subject ?section1_qt ; rdf:predicate form:has-subtemplate ; rdf:object ?child_qt . OPTIONAL { ?r_1_qt_relation form:is-relevant-if ?isLink1 . } OPTIONAL { ?r_2_qt_relation form:is-relevant-if ?isLink2 . } FILTER(! ((?isLink1 = "is-link") || (?isLink2 = "is-link")) ) }
0 - there are two sections sharing same attribute but are not implementing symlinks
# 1 - there is symlink that does not have hardlink associated ASK WHERE { ?parent_qt form:has-subtemplate ?child_qt . ?r_symlink_qt_relation rdf:subject ?parent_qt ; rdf:predicate form:has-subtemplate ; rdf:object ?child_qt ; form:is-relevant-if "is-link" . FILTER NOT EXISTS { ?r_symlink_qt_relation form:is-link-template-of ?r_hardlink_qt_relation . } }
1 - there is symlink that does not have hardlink associated
# 2 - there is more than one hardlink for some eccairs template question relation (eccairs specific constraint) ASK WHERE { ?r_symlink_qt_relation form:is-link-template-of ?r_hardlink_qt_relation1 ; form:is-link-template-of ?r_hardlink_qt_relation2 . FILTER(?r_hardlink_qt_relation1 != ?r_hardlink_qt_relation2) }
2 - there is more than one hardlink for some eccairs template question relation (eccairs specific constraint)
# 3 - there is a question tempate relation that act as hardlink and symlink at the same time ASK WHERE { ?r_symlink_qt_relation form:is-link-template-of ?r_bad_qt_relation . ?r_bad_qt_relation form:is-link-template-of ?r_hardlink_qt_relation. }
3 - there is a question tempate relation that act as hardlink and symlink at the same time
# 0 - construct symlinks if explicitely stated CONSTRUCT { ?r_symlink_qt_relation form:is-link-template-of ?r_hardlink_qt_relation . } WHERE { ?parent1_qt form:has-subtemplate ?child_qt . ?parent2_qt form:has-subtemplate ?child_qt . ?r_symlink_qt_relation rdf:subject ?parent1_qt ; rdf:predicate form:has-subtemplate ; rdf:object ?child_qt ; form:is-relevant-if "is-link" . ?r_hardlink_qt_relation rdf:subject ?parent2_qt ; rdf:predicate form:has-subtemplate ; rdf:object ?child_qt . FILTER(?r_hardlink_qt_relation != ?r_symlink_qt_relation) FILTER NOT EXISTS { ?r_hardlink_qt_relation form:is-relevant-if "is-link" . } }
0 - construct symlinks if explicitely stated
# 1 - construct symlinks if sections are based on same eccairs entity and its attribute CONSTRUCT { # TODO -- make it not eccairs specific, make it work with more than one level of sections, make it work if more than two sections share same attribute ?r_symlink_qt_relation form:is-link-template-of ?r_hardlink_qt_relation ; form:is-relevant-if "is-link" . } WHERE { # pick relation that is minimal w.r.t. ordering of labels ?parent_qt form:has-subtemplate ?section1_qt . ?section1_qt form:has-subtemplate ?child_qt ; form:has-origin-type e-mv:section ; rdfs:label ?section1_label . ?r_hardlink_qt_relation rdf:subject ?section1_qt ; rdf:predicate form:has-subtemplate ; rdf:object ?child_qt . ## section1_label must be minimal w.r.t. ordering of question template labels FILTER NOT EXISTS { ?parent_qt form:has-subtemplate ?sectionNotBound_qt ; form:has-origin-type e-mv:section ; rdfs:label ?sectionNotBound_label . ?sectionNotBound_qt form:has-subtemplate ?child_qt . FILTER(?sectionNotBound_qt != ?section1_qt) FILTER(?sectionNotBound_label < ?section1_label) } # pick any other relation ?parent_qt form:has-subtemplate ?section2_qt . ?section2_qt form:has-subtemplate ?child_qt ; form:has-origin-type e-mv:section ; rdfs:label ?section2_label . ?r_symlink_qt_relation rdf:subject ?section2_qt ; rdf:predicate form:has-subtemplate ; rdf:object ?child_qt . FILTER(?section1_qt != ?section2_qt) FILTER(str(?section1_label) < str(?section2_label)) }
1 - construct symlinks if sections are based on same eccairs entity and its attribute
Context that contains original data from email importer that contains 2 types of data -- eccairs schema compliant and aviation ontology compliant data. Aviation ontology compliant data might be possibly reduced (moved to default graph of RT).
CONSTRUCT { ?q form-lt:is-disabled true . } WHERE { ?q form:is-clone-of-question ?clonedQ . }
# there is a question with two parents ASK WHERE { ?parentQ1 doc:has_related_question ?q . ?parentQ2 doc:has_related_question ?q . FILTER(?parentQ1 != ?parentQ2) }
CONSTRUCT { ?s ?p ?o . } WHERE { SERVICE ?concreteReportServiceUri { ?s ?p ?o . } }
CONSTRUCT { ?s ?p ?o . } WHERE { SERVICE ?eccairsSchemaServiceUri { ?s ?p ?o . } }
CONSTRUCT { ?s ?p ?o . } WHERE { SERVICE ?sampleReportServiceUri { ?s ?p ?o . } }
CONSTRUCT { ?s ?p ?o . } WHERE { SERVICE ?importedReportServiceUri { ?s ?p ?o . } }
# TODO -- include shape CONSTRUCT { ?s ?p ?o . } WHERE { ?s ?p ?o . }
# filter only necessary data for q&a reconstruction CONSTRUCT { ?s ?p ?o . } WHERE { ?s ?p ?o . }
filter only necessary data for q&a reconstruction
CONSTRUCT { ?s ?p ?o . } WHERE { ?s ?p ?o . FILTER(?p != form:has-subtemplate) FILTER(?p != rdf:object) FILTER(?p != rdf:subject) FILTER(?p != rdf:predicate) FILTER(?p != form:is-relevant-if) }
# there is a template for an attribute that is both in section and outside of it ASK # TODO make it not eccairs specific WHERE { ?entQT form:has-subtemplate ?attrQT ; form:has-subtemplate ?secQT . ?secQT form:has-subtemplate ?attrQT ; form:has-origin-type e-m-v:section . }
there is a template for an attribute that is both in section and outside of it
# TODO put ?disabledContext -> VALUES CONSTRUCT { ?s ?p ?o . } WHERE { ?s ?p ?o . OPTIONAL { ?reification rdf:subject ?s ; rdf:predicate ?p ; rdf:object ?o ; form:is-relevant-if "eccairs-data-schema" . } FILTER(! bound(?reification)) }
# only path to propagate variables CONSTRUCT { } WHERE { }
# filter only answers that should be populated from imported questions CONSTRUCT { ?a a doc:answer . ?q doc:has_answer ?a ; form:has-question-origin ?qOrigin . } WHERE { # precondition -- questions where not saved yet FILTER(! bound(?savedQAExists)) ?a a doc:answer . ?q doc:has_answer ?a ; form:has-question-origin ?qOrigin . # question is leaf node question FILTER NOT EXISTS { ?q doc:has_related_question ?childQ . } # question is not a clone FILTER NOT EXISTS { ?qOrigin form-ecc-gen-0.2:is-origin-of-question-templates-reification ?qTRelation . ?qTRelation form:is-relevant-if "is-link" . } }
filter only answers that should be populated from imported questions
# there are two root questions ASK WHERE { ?root_q1 a doc:question . ?root_q2 a doc:question . FILTER(?root_q1 != ?root_q2) FILTER NOT EXISTS { ?notBoundq1 doc:has_related_question ?root_q1 . } FILTER NOT EXISTS { ?notBoundq2 doc:has_related_question ?root_q2 . } }
# there is a question with two parents ASK WHERE { ?q a doc:question . ?parentQ1 doc:has_related_question ?q . ?parentQ2 doc:has_related_question ?q . FILTER(?parentQ1 != ?parentQ2) }
# return only questions rooted by input eccairs event CONSTRUCT { ?s ?p ?o . } WHERE { ?event doc:has_related_question ?rootQ . ?rootQ (doc:has_related_question*|doc:has_answer*)* ?s . ?s ?p ?o . }
return only questions rooted by input eccairs event
# there exists generated question but only loaded ones should be present ASK WHERE { FILTER NOT EXISTS { ?s a doc:question . FILTER(contains(str(?s), "http://onto.fel.cvut.cz/ontologies/eccairs/model/instance")) } FILTER(bound(?qaExists)) }
there exists generated question but only loaded ones should be present
CONSTRUCT { ?s ?p ?o . } WHERE { ?s ?p ?o . }
Named graph id of imported email parameter
If true, generation of form should be idempotent i.e. 2 runs of the generator on the same data should results in same result.
Generate forms from occurrence category.
# 0 - create form layout question CONSTRUCT { ?rootQuestion form-lt:has-layout-class "form" . } WHERE { }
# 1 - create section layout classes CONSTRUCT { ?sectionQuestion form-lt:has-layout-class "section" . } WHERE { ?sectionQuestion doc:has_related_question ?subQuestion . FILTER(?rootQuestion != ?sectionQuestion) }
# 2 - create wizard step layout for top level sections CONSTRUCT { ?topSectionQuestion form-lt:has-layout-class "wizard-step" . # TODO !!! remove asi ?? ?topSectionQuestion form-lt:has-layout-class "section" . } WHERE { ?rootQuestion doc:has_related_question ?topSectionQuestion . }
2 - create wizard step layout for top level sections
# root question does not have any subquestions ASK WHERE { ?rootQuestion form-lt:has-layout-class "form" . FILTER NOT EXISTS { ?rootQuestion doc:has_related_question ?subQuestion . } }
root question does not have any subquestions
# there is a question with more than one answer ASK WHERE { ?q a doc:question ; doc:has_answer ?a1 ; doc:has_answer ?a2 . FILTER(?a1 != ?a2) }
there is a question with more than one answer
# there is a question without a label ASK WHERE { ?question a doc:question . FILTER NOT EXISTS { ?question rdfs:label ?label . } }
# there is a question without specified question origin ASK WHERE { ?question a doc:question . FILTER NOT EXISTS { ?question form:has-question-origin ?origin . } }
# there is an empty section within the form ASK WHERE { ?sectionQ form-lt:has-layout-class "section" . FILTER NOT EXISTS { ?sectionQ doc:has_related_question ?subQ . } }
there is an empty section within the form
# there is no "form" element ASK WHERE { FILTER NOT EXISTS { ?s form-lt:has-layout-class "form" . } }
# 1 - construct question info for links CONSTRUCT { ?q rdfs:label ?qLabel . ?q rdfs:comment ?qtComment . ?q form:has-origin-type ?qtOrigin . } WHERE { # bind link questions ?q form:has-template ?qt ; form:is-clone-of-question ?qCloned . ?qt rdfs:label ?qtLabel . ?qt form:has-template-origin ?qtOrigin . # TODO comment should be part of templates as well -> remove optional OPTIONAL { ?qt rdfs:comment ?qtComment . } # TODO !!!!!!! # BIND(concat("Link to '", ?qtLabel, "'") as ?qLabel) BIND(?qtLabel as ?qLabel) }
# 0 - construct question info for normal questions CONSTRUCT { ?q rdfs:label ?qtLabel . ?q rdfs:comment ?qtComment . ?q form:has-origin-type ?qtOrigin . } WHERE { # bind qt template ?q form:has-template ?qt . ?qt rdfs:label ?qtLabel . ?qt form:has-template-origin ?qtOrigin . # TODO comment should be part of templates as well -> remove optional OPTIONAL { ?qt rdfs:comment ?qtComment . } FILTER NOT EXISTS { ?q form:is-clone-of-question ?qCloned . } }
0 - construct question info for normal questions
# TODO attach form generator to it CONSTRUCT { ?question form:has-possible-value ?value . ?value rdfs:label ?label . ?value rdfs:comment ?explanation . } WHERE { ?question a doc:question . ?question form:has-template ?questionTemplate . ?questionTemplate form:has-template-origin ?eccAttribute . SERVICE ?eccairsSchemaServiceUri { ?eccAttribute a e-m:attribute . ?eccAttribute e-m:has-child+ ?value . ?value rdfs:label ?label . ?value e-m:has-explanation ?explanation . # TODO remove !!!!!!!!!!! # FILTER(?eccAttribute = <http://onto.fel.cvut.cz/ontologies/eccairs/aviation-3.4.0.2/a-454>) } }
# 1 - recover templates for questions created from input data CONSTRUCT { ?q form:has-template ?qt . } WHERE { ?q form:has-question-origin ?dataOrigin . ?dataOrigin form-ecc-gen-0.2:is-origin-of-question-template ?qt . }
1 - recover templates for questions created from input data
# 2 - recover templates for questions created from directly templates (not input data) CONSTRUCT { ?q form:has-template ?qt . } WHERE { ?q form:has-question-origin ?templateOrigin . ?qt a form:question-template . # TODO not nice, not effective -- this should be rather pre-computed BIND(form-ecc-lib:create-qo(?qt) as ?qo) FILTER(?templateOrigin = ?qo) }
2 - recover templates for questions created from directly templates (not input data)
# there is a question origin bound to two question template relations ASK WHERE { ?qo a form:question-origin ; form-ecc-gen-0.2:is-origin-of-question-templates-reification ?qtsReification1 ; form-ecc-gen-0.2:is-origin-of-question-templates-reification ?qtsReification2 . FILTER(?qtsReification1 != ?qtsReification2) }
there is a question origin bound to two question template relations
# there is a question origin bound to two question templates ASK WHERE { ?qo a form:question-origin ; form-ecc-gen-0.2:is-origin-of-question-template ?oQT1 ; form-ecc-gen-0.2:is-origin-of-question-template ?oQT2 . FILTER(?oQT1 != ?oQT2) }
there is a question origin bound to two question templates
# there is a question origin that is not bound to question template ASK WHERE { ?qo a form:question-origin . FILTER NOT EXISTS { ?qo form-ecc-gen-0.2:is-origin-of-question-template ?oQT . } }
there is a question origin that is not bound to question template
# there is a question origin that is not bound to question template reification ASK WHERE { ?qo a form:question-origin . FILTER NOT EXISTS { ?qo form-ecc-gen-0.2:is-origin-of-question-templates-reification ?qtsReification . } }
there is a question origin that is not bound to question template reification
# construct question templates and its reifications relevant to origins CONSTRUCT { ?qo form-ecc-gen-0.2:is-origin-of-question-template ?oQT ; form-ecc-gen-0.2:is-origin-of-question-templates-reification ?qtsReification ; rdfs:label ?qoLabel . } WHERE { # bind question origin ?qo a form:question-origin ; rdf:object ?o . ?o a ?o_type . # bind template ?oQT form:has-template-origin ?oTOrigin . ?o a ?oTOrigin . # bind template reification ?qtsReification rdf:object ?oQT . OPTIONAL { ?qo rdf:subject ?s . } OPTIONAL { ?qtsReification rdf:subject ?sQT . ?sQT form:has-template-origin ?sTOrigin . ?s a ?sTOrigin . } FILTER( (bound(?s) && bound(?sQT)) || (!bound(?s) && !bound(?sQT))) # bind label for origin ?qtsReification rdfs:label ?qtsReificationLabel . BIND(concat("Origin of '", ?qtsReificationLabel, "'") as ?qoLabel) }
construct question templates and its reifications relevant to origins
Context with actual state of report that is saved by RT thus including saved Q&A model. Q&A data are empty here in case when report is opened for the first time in RT.
# CACHE -- instead of "filter irrelevant templates" CONSTRUCT { ?s ?p ?o . } WHERE { SERVICE ?questionTemplatesCacheServiceUri { ?s ?p ?o . } }
CACHE -- instead of "filter irrelevant templates"
Retrieve cached generated question templates
#http://dev.inbas.cz/rdf4j-server/repositories/eccairs-aviation-3.4.0.2?query= CONSTRUCT { ?s ?p ?o . } WHERE { GRAPH <http://onto.fel.cvut.cz/ontologies/eccairs/aviation-3.4.0.2> { ?s ?p ?o . } . }
#SELECT ?eccTerm INSERT { graph <http://onto.fel.cvut.cz/ontologies/aviation/eccairs-form-generated> { ?formItem rdfs:label ?label ; rdfs:comment ?comment ; } } WHERE { GRAPH <http://onto.fel.cvut.cz/ontologies/aviation/eccairs-form-generated> { { ?formItem a form:section . ?formItem <http://onto.fel.cvut.cz/ontologies/form/origin> ?eccTerm . } UNION { ?formItem a form:question . ?formItem <http://onto.fel.cvut.cz/ontologies/form/origin> ?eccTerm . } } GRAPH <http://onto.fel.cvut.cz/ontologies/eccairs-3.4.0.2-v-2016-02-23> { ?eccTerm <http://onto.fel.cvut.cz/ontologies/eccairs/model/has-description> ?label. ?eccTerm <http://onto.fel.cvut.cz/ontologies/eccairs/model/has-explanation> ?comment. } }
INSERT { GRAPH <http://onto.fel.cvut.cz/ontologies/aviation/eccairs-form-generated> { ?section form:has-question ?question . ?section a owl:NamedIndividual . ?question a owl:NamedIndividual . ?section a form:section . ?question a form:question . ?question <http://onto.fel.cvut.cz/ontologies/form/origin> ?attribute . ?section <http://onto.fel.cvut.cz/ontologies/form/origin> ?entity . } } WHERE { GRAPH <http://onto.fel.cvut.cz/ontologies/eccairs-3.4.0.2> { ?entity <http://onto.fel.cvut.cz/ontologies/eccairs/model/has-child> ?attribute . BIND("http://onto.fel.cvut.cz/ontologies/aviation/eccairs-form/" AS ?eccairsFormIRI) BIND( afn:localname(?entity) AS ?entityName) BIND(iri(concat(?eccairsFormIRI, ?entityName)) AS ?section) } GRAPH <http://onto.fel.cvut.cz/ontologies/aviation/mapping-ans-eccairs-events-and-attributes> { ?event <http://onto.fel.cvut.cz/ontologies/documentation/has_question> ?attribute . BIND("http://onto.fel.cvut.cz/ontologies/aviation/eccairs-form/" AS ?eccairsFormIRI) BIND( afn:localname(?attribute) AS ?attributeName) BIND(iri(concat(?eccairsFormIRI, ?attributeName)) AS ?question) } }