2 years ago

#42525

test-img

Duccio Borchi

SPARQL query: show result for individuals without some attributes, and sum two of the attributes

I have to make this SPARQL query on protege:

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX sw:<http://www.semanticweb.org/lorep/ontologies/2022/0/untitled-ontology-16#>
SELECT  ?Name ?Surname ?test ?written ?oral ?Course
WHERE { 
      ?Candidates sw:take_parts ?Course;
      sw:Name ?Name;
      sw:Surname ?Surname;
      sw:test ?test;
      sw:written ?written;
      sw:oral ?oral;

}

Now I have some candidates that took only the test without taking written and oral so when I execute the query they does not show. How can I make everyone visible? And then how could i sum the values from written and oral? I tried with BIND(?written+?oral AS ?total) but it doesn't seem to work

sparql

protege

0 Answers

Your Answer

Accepted video resources