Skip to content

Record manager creates detached questions after save #32

Description

@blcham

Such questions can be retrieved by:

# illegal-parent-question-relationship
PREFIX rm: <http://onto.fel.cvut.cz/ontologies/record-manager/>
PREFIX doc: <http://onto.fel.cvut.cz/ontologies/documentation/>
PREFIX form: <http://onto.fel.cvut.cz/ontologies/form/>

CONSTRUCT  {
  ?qIllegalParent doc:has_related_question ?q .
}
WHERE {
 {
  SELECT ?q (COUNT(?qParent) as ?qParentCount)
  WHERE {
    ?qParent doc:has_related_question ?q .
  }
  GROUP BY ?q
  }
  FILTER(?qParentCount != 1)
  ?qIllegalParent doc:has_related_question ?q .
  FILTER NOT EXISTS {
    ?pr rm:has-question ?qIllegalParent .
  }
}

And by:

# illegal-questions
PREFIX rm: <http://onto.fel.cvut.cz/ontologies/record-manager/>
PREFIX doc: <http://onto.fel.cvut.cz/ontologies/documentation/>
PREFIX form: <http://onto.fel.cvut.cz/ontologies/form/>

CONSTRUCT {
  ?q rdf:type doc:question .
  ?q form:has-question-origin ?qOrigin .
  ?q doc:has_related_question ?qRelated .
 
  ?a rdf:type doc:answer .
  ?a doc:has_object_value ?ov .
  ?a doc:has_data_value ?dv .
} 
WHERE { 
        ?q2 a doc:question .
        FILTER NOT EXISTS {
            ?q1 rm:has-question ?q2 .
        }
        FILTER NOT EXISTS {
            ?q1 doc:has_related_question ?q2 .
        }
        ?q2 doc:has_related_question* ?q .

    OPTIONAL {
        ?q form:has-question-origin ?qOrigin .
    }
    OPTIONAL {
        ?q doc:has_related_question ?qRelated .
    }

    OPTIONAL {
        ?q doc:has_answer ?a .
        OPTIONAL {
            ?a doc:has_data_value ?dv .
        }
         OPTIONAL {
            ?a doc:has_object_value ?ov .
        }
    }
}

Relevant info:
freeplane:/%20/home/blcha/projects/23ava/23ava.mm#ID_7707568

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions