Hi,
I don’t know if this is a bug or if I just don’t properly understand how to use CONSTRUCT queries. I have a database that includes these triples (among many others)
<http://stjohns.edu/fullclinicaltrial/NCT01661400> <http://stjohns.edu/fullclinicaltrial/hasNCT> "NCT01661400" .
<http://stjohns.edu/fullclinicaltrial/NCT01661400> <http://stjohns.edu/fullclinicaltrial/hasPrimaryOutcome> <http://stjohns.edu/fullclinicaltrial/NCT01661400PrimaryOutcome1> .
<http://stjohns.edu/fullclinicaltrial/NCT01661400> <http://stjohns.edu/fullclinicaltrial/hasPrimaryOutcome> <http://stjohns.edu/fullclinicaltrial/NCT01661400PrimaryOutcome2> .
<http://stjohns.edu/fullclinicaltrial/NCT01661400> <http://stjohns.edu/fullclinicaltrial/hasSecondaryOutcome> <http://stjohns.edu/fullclinicaltrial/NCT01661400SecondaryOutcome1> .
<http://stjohns.edu/fullclinicaltrial/NCT01661400> <http://stjohns.edu/fullclinicaltrial/hasSecondaryOutcome> <http://stjohns.edu/fullclinicaltrial/NCT01661400SecondaryOutcome2> .
When I run this query
construct where {
?t fct:hasNCT "NCT01661400".
?t fct:hasPrimaryOutcome ?pout.
?t fct:hasSecondaryOutcome ?sout.
}
I get this odd result
<http://stjohns.edu/fullclinicaltrial/NCT01661400> <http://stjohns.edu/fullclinicaltrial/hasNCT> "NCT01661400" .
<http://stjohns.edu/fullclinicaltrial/NCT01661400> <http://stjohns.edu/fullclinicaltrial/hasPrimaryOutcome> <http://stjohns.edu/fullclinicaltrial/NCT01661400PrimaryOutcome1> .
<http://stjohns.edu/fullclinicaltrial/NCT01661400> <http://stjohns.edu/fullclinicaltrial/hasSecondaryOutcome> <http://stjohns.edu/fullclinicaltrial/NCT01661400SecondaryOutcome1> .
<http://stjohns.edu/fullclinicaltrial/NCT01661400> <http://stjohns.edu/fullclinicaltrial/hasPrimaryOutcome> <http://stjohns.edu/fullclinicaltrial/NCT01661400PrimaryOutcome2> .
<http://stjohns.edu/fullclinicaltrial/NCT01661400> <http://stjohns.edu/fullclinicaltrial/hasPrimaryOutcome> <http://stjohns.edu/fullclinicaltrial/NCT01661400PrimaryOutcome1> .
<http://stjohns.edu/fullclinicaltrial/NCT01661400> <http://stjohns.edu/fullclinicaltrial/hasSecondaryOutcome> <http://stjohns.edu/fullclinicaltrial/NCT01661400SecondaryOutcome2> .
<http://stjohns.edu/fullclinicaltrial/NCT01661400> <http://stjohns.edu/fullclinicaltrial/hasPrimaryOutcome> <http://stjohns.edu/fullclinicaltrial/NCT01661400PrimaryOutcome2> .
PrimaryOutcome1 and 2 are listed twice.
If I run this query
construct {
?t fct:hasPrimaryOutcome ?pout.
?t fct:hasSecondaryOutcome ?sout.}
where {
?t fct:hasNCT "NCT01661400".
?t fct:hasPrimaryOutcome ?pout.
?t fct:hasSecondaryOutcome ?sout.
}
then I get
<http://stjohns.edu/fullclinicaltrial/NCT01661400> <http://stjohns.edu/fullclinicaltrial/hasSecondaryOutcome> <http://stjohns.edu/fullclinicaltrial/NCT01661400SecondaryOutcome1> .
<http://stjohns.edu/fullclinicaltrial/NCT01661400> <http://stjohns.edu/fullclinicaltrial/hasPrimaryOutcome> <http://stjohns.edu/fullclinicaltrial/NCT01661400PrimaryOutcome2> .
<http://stjohns.edu/fullclinicaltrial/NCT01661400> <http://stjohns.edu/fullclinicaltrial/hasSecondaryOutcome> <http://stjohns.edu/fullclinicaltrial/NCT01661400SecondaryOutcome2> .
with no repetition, which is what I expect given the data.
What am I doing wrong?