eclipse-rdf4j / rdf4j

Eclipse RDF4J: scalable RDF for Java
https://rdf4j.org/
BSD 3-Clause "New" or "Revised" License
365 stars 163 forks source link

MINUS Clause in SPIN Constructor Fails Depending on Presence of Other FILTER Statement #298

Closed gwcox66 closed 8 years ago

gwcox66 commented 8 years ago

I'm working with RDF4J Workbench, and I'm hoping this is a bug and not "pilot error":


System Information
Application Information
Application Name    RDF4J Workbench
Version 2.0
Runtime Information
Operating System    Windows 8.1 6.3 (amd64)
Java Runtime    Oracle Corporation Java HotSpot(TM) 64-Bit Server VM (1.8.0_91)
Process User    Greg
Memory
Used    127 MB
Maximum 3463 MB

I'm writing SPIN constructors using a custom subproperty sxxicc:activeSxxiPub7ComplianceCheckPolicy(see enclosed ontology RDF file). MinusClauseProblem.zip

image

The sxxicc:Pub7FakeProposal class has two constructors (see TopBraid Composer FE screen capture above) which differ only by a FILTERstatement. Given the 2 SPARQL Update queries I use to instantiate this class, NEITHER should assert their CONSTRUCTbecause of the MINUSclause. The ?dataItem does have the sxxicc:TopSecretPub7DataItem class. However, the first constuctor does assert the CONSTRUCT triple. It seems that the addition of the FILTER statement negated the MINUS clause. How can that be?

First setup SPARQL update query (sets up the DataItem005 individual and invokes parsing constructors):

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX sxxicc: <http://www.disa.mil/dso/a2i/ontologies/PBSM/Interface/SXXIComplianceCheck#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX sp: <http://spinrdf.org/sp#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX smf: <http://topbraid.org/sparqlmotionfunctions#>
PREFIX fn: <http://www.w3.org/2005/xpath-functions#>
PREFIX spl: <http://spinrdf.org/spl#>
PREFIX spin: <http://spinrdf.org/spin#>
PREFIX arg: <http://spinrdf.org/arg#>
PREFIX SXXIComplianceCheckIndividuals: <http://www.disa.mil/dso/a2i/ontologies/PBSM/Interface/SXXIComplianceCheckIndividuals#>
PREFIX sxxicci: <http://www.disa.mil/dso/a2i/ontologies/PBSM/Interface/SXXIComplianceCheckIndividuals#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

INSERT DATA 
{
   sxxicci:testPub7Proposal_DataItem005 a sxxicc:Pub7DataItem005 ;
           sxxicc:pub7DataItemHasRawStringValue "(T) Data Item 005a Value"^^xsd:string . 
}

Second setup SPARQL update query:

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX sxxicc: <http://www.disa.mil/dso/a2i/ontologies/PBSM/Interface/SXXIComplianceCheck#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX sp: <http://spinrdf.org/sp#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX smf: <http://topbraid.org/sparqlmotionfunctions#>
PREFIX fn: <http://www.w3.org/2005/xpath-functions#>
PREFIX spl: <http://spinrdf.org/spl#>
PREFIX spin: <http://spinrdf.org/spin#>
PREFIX arg: <http://spinrdf.org/arg#>
PREFIX SXXIComplianceCheckIndividuals: <http://www.disa.mil/dso/a2i/ontologies/PBSM/Interface/SXXIComplianceCheckIndividuals#>
PREFIX sxxicci: <http://www.disa.mil/dso/a2i/ontologies/PBSM/Interface/SXXIComplianceCheckIndividuals#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

INSERT DATA
{
   sxxicci:TestPub7Proposal a sxxicc:Pub7FakeProposal ;
           sxxicc:pub7ProposalHasDataItem sxxicci:testPub7Proposal_DataItem005 .
}

Resulting sxxicc:Pub7FakeProposal individual (shows that only first compliance check asserted triple when neither should have):

image

Resulting sxxicc:Pub7DataItem005 individual (shows that this is a member of the sxxicc:TopSecretPub7DataItem class and therefore should satisfy the MINUS clause, preventing both constructors from asserting triples)

image

abrokenjester commented 8 years ago

@pulquero are you available to take a look at this?

pulquero commented 8 years ago

I'll see if I can take a look this week, I expect the spin parser may have overwritten the minus with the filter.

On Monday, 29 August 2016, 23:30, Jeen Broekstra <notifications@github.com> wrote:

@pulquero are you available to take a look at this? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

pulquero commented 8 years ago

I believe the same also occurs with OPTIONAL and other like constructs.

gwcox66 commented 8 years ago

Thanks @pulquero! I modified my constructors as follows and performed the same test otherwise:

image

However, both messages were asserted in the resulting sxxicci:TestPub7Proposal individual, seeming to indicate that both OPTIONAL clauses had run:

image

gwcox66 commented 8 years ago

Thank you @jeenbroekstra and @pulquero!