Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Record manager creates detached questions after save #32

Open
blcham opened this issue Dec 10, 2023 · 0 comments
Open

Record manager creates detached questions after save #32

blcham opened this issue Dec 10, 2023 · 0 comments
Assignees

Comments

@blcham
Copy link

blcham commented Dec 10, 2023

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

@blcham blcham self-assigned this Dec 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant