I have successfully generated and tested SPIN constraints (using SPARQL ASK queries) within an OWL/RDF ontology using TopBraid Composer Maestro Edition version 5.1.1. I would now like to test these SPIN constraints in Sesame. How can I get my SPIN constraints, class definitions, property definitions, and test individuals contained in an OWL ontology authored in TopBraid COmposer Maestro Edition into Sesame?

I'm using Sesame OpenRDF Workbench:

System Information
Application Information
Application Name    OpenRDF Workbench
Version 4.1.2
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    357 MB
Maximum 3463 MB

My constraints, classes, properties, and example individuals are contained in one RDF file under TopBraid Composer Maestro Edition.

I've tried using the Sesame Open RDF workbench Modify/Add command to pull in the RDF file generated by TopBraid Maestro Edition, but I get an error that appears to be related to a blank node:

javax.servlet.ServletException: org.openrdf.repository.RepositoryException: org.openrdf.repository.RepositoryException: org.openrdf.sail.SailException: org.openrdf.query.QueryEvaluationException: Multiple statements for pattern: _:node1alqlr2eix590 http://spinrdf.org/sp#where null

Perhaps I'm not exporting from TopBraid Composer Maestro Edition correctly? I used a generic export of the RDF file to the file system in TopBraid Composer Maestro Edition, and I used the Sesame OpenRDF workbench add RDF File / RDF Data File command, resulting in the above error message.

To preempt some possible answer directions which would not help in my particular case:

  1. I specifically want to use SPIN constructors and constraints, not SWRL or another rule language.
  2. Although I was successful in TopBraid Composer Maestro Edition and appreciate the help I got from TopQuadrant, I cannot afford the TopBraid Live license required to use my SPIN constructors and constraints while interacting with other computers. (TopBraid Composer Maestro Edition has a SPARQL endpoint, but that endpoint is only accessible from the host machine via localhost.) I also want to determine if the Sesame implementation imposes some of the same restrictions on SPIN constraints and constructors that the TopBraid tools do.
1

There are 1 answers

0
Greg Cox On

I was able to successfully load RDF from TopBraid Composer Free Edition by modifying how I was adding the RDF in Sesame and by avoiding instantiating classes in the RDF, deferring that by using a SPARQL UPDATE query executed usping the workbench Modify/SPARQL Update instead.

Specifically, the error message in my original post resulted from "use base URI as context identifier". This option is checked by default in Sesame Workbench Modify/Add. Unchecking this box loads my RDF into the default graph/context where it worked. Technically, I regard this as avoiding the problem rather than solving it since the RDF should have been able to load into a named graph/context as well, but I don't need that for now.

Add RDF Into Default Graph/Context by Unckecking "use base URI as context identifier"

After clearing this error, my RDF file had instantiated some individuals which caused trouble upon loading into Sesame. I avoided this problem by using a SPARQL Update query to create my test instantiations. Here's an example:

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:Pub7Proposal ;
           sxxicc:pub7ProposalHasDataItem sxxicci:testPub7Proposal_DataItem005 ;
           sxxicc:pub7ProposalHasDataItem sxxicci:testPub7Proposal_DataItem017 ;
           sxxicc:pub7ProposalHasDataItem sxxicci:testPub7Proposal_DataItem102 .

   sxxicci:testPub7Proposal_DataItem005 a sxxicc:Pub7DataItem005 ;
           sxxicc:pub7DataItemHasStringValue "S"^^xsd:string .

   sxxicci:testPub7Proposal_DataItem102 a sxxicc:Pub7DataItem102 ;
           sxxicc:pub7DataItemHasStringValue "AF  881234"^^xsd:string .

   sxxicci:testPub7Proposal_DataItem017 a sxxicc:Pub7DataItem017 ;
           sxxicc:pub7DataItemHasStringValue "U"^^xsd:string .
}