Questions SPARQL Queries

Example of Competency Questions

For the evaluation of the competency questions, we have considered a sample knowledge graph, shown in Figure 2, for blocksworld from IPC-2000 domain created using planning ontology shown in Figure 1.

Example Competency Question Description
(Q1). What are the different types of planners used in automated planning? Identifies and lists the various types of planners utilized in the field of automated planning.
(Q2). What is the relevance of a planner in a given problem domain? Explores the importance and applicability of different planners within a specific problem domain.
(Q3). What are the available actions for a given domain? Provides a list of actions that can be performed within a specified domain.
(Q4). What problems in a domain satisfy a given condition? Identifies problems within a domain that meet certain specified conditions.
(Q5). What are all requirements a given domain has? Enumerates all the prerequisites or conditions necessary within a particular domain.
(Q6). What is the cost associated with generating a plan for a given problem? Determines the cost involved in creating a plan to solve a specified problem.
(Q7). How many parameters does a specific action have? Counts the number of parameters required for a particular action within a domain.
(Q8). What planning type a specific planner belongs to? Classifies a given planner into its respective planning type.
(Q9). What requirements does a given planner support? Lists the requirements that a specific planner is capable of addressing.
(Q10). What are the different parameter types present in a domain? Identifies and lists the various types of parameters present within a specified domain.
Figure 2. Knowledge graph representation for blocksworld domain from IPC-2000.

SPARQL Queries

  1. What are the different types of planners used in automated planning?
    PREFIX plan-ontology: <https://purl.org/ai4s/ontology/planning#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    
    SELECT DISTINCT ?planner
    WHERE {
    ?planner a plan-ontology:planner.
    }
        
  2. What is the relevance of a planner in a given problem domain?
    PREFIX plan-ontology: <https://purl.org/ai4s/ontology/planning#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    
    SELECT DISTINCT ?domain ?relevance ?planner
    WHERE {
        ?domain a plan-ontology:domain;
                rdfs:label "caldera".
        ?planner a plan-ontology:planner.
        ?domain ?relevance ?planner.
    }
        
  3. What are the available actions for a given domain?
    PREFIX plan-ontology: <https://purl.org/ai4s/ontology/planning#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    
    SELECT DISTINCT ?domain ?action
    WHERE {
        ?domain a plan-ontology:domain;
                rdfs:label "caldera".
        ?domain plan-ontology:hasMove ?action.
    }
        
  4. What problems in a domain satisfy a given condition?
    PREFIX plan-ontology: <https://purl.org/ai4s/ontology/planning#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    
    SELECT DISTINCT ?problem
    WHERE {
        ?domain a plan-ontology:domain;
                rdfs:label "caldera".
        ?problem a plan-ontology:problem.
        ?domain plan-ontology:hasProblem ?problem.
        ?problem plan-ontology:hasGoalState ?condition.
        FILTER(?condition = "specified_condition")
    }
        
  5. What are all requirements a given domain has?
    PREFIX plan-ontology: <https://purl.org/ai4s/ontology/planning#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    
    SELECT DISTINCT ?domain ?requirement
    WHERE {
        ?domain a plan-ontology:domain;
                rdfs:label "caldera".
        ?domain plan-ontology:hasRequirement ?requirement.
    }
        
  6. What is the cost associated with generating a plan for a given problem?
    PREFIX plan-ontology: <https://purl.org/ai4s/ontology/planning#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    
    SELECT DISTINCT ?plan ?cost
    WHERE {
        ?problem a plan-ontology:problem;
                rdfs:label "problem-01".
        ?problem plan-ontology:hasPlan ?plan.
        ?plan plan-ontology:hasCost ?cost. 
    }
        
  7. How many parameters does a specific action have?
    PREFIX plan-ontology: <https://purl.org/ai4s/ontology/planning#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    
    SELECT (COUNT(?parameter) AS ?parameterCount)
    WHERE {
      ?action a plan-ontology:action;
              rdfs:label "get_domain". # action of domain caldera
      ?action plan-ontology:hasParameter ?parameter.
    }
        
  8. What planning type a specific planner belongs to?
    PREFIX plan-ontology: <https://purl.org/ai4s/ontology/planning#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    
    SELECT DISTINCT ?planner ?planningType
    WHERE {
      ?planner a plan-ontology:planner;
              rdfs:label "Delfi1".
      ?planner plan-ontology:ofPlannerType ?planningType.
    }
        
  9. What requirements does a given planner support?
    PREFIX plan-ontology: <https://purl.org/ai4s/ontology/planning#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    
    SELECT DISTINCT ?planner ?requirement
    WHERE {
      ?planner a plan-ontology:planner;
              rdfs:label "Delfi1".
      ?planner plan-ontology:solvesRequirement ?requirement.
    }
        
  10. What are the different parameter types present in a domain?
    PREFIX plan-ontology: <https://purl.org/ai4s/ontology/planning#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    
    SELECT DISTINCT ?domain ?parameterType
    WHERE {
        ?domain a plan-ontology:domain;
                rdfs:label "caldera".
        ?domain plan-ontology:hasParameterType ?parameterType.
    }