2

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.
scotthenninger
  • 3,921
  • 1
  • 15
  • 24
Greg Cox
  • 287
  • 1
  • 12
  • Have you chosen a Sesame repository type with SPIN reasoning? See [Sesame server support for SPIN](http://stackoverflow.com/questions/36738282/sesame-server-support-for-spin). – scotthenninger Jun 23 '16 at 17:32
  • Yes, Scott, I selected an In Memory Store with SPIN+RDFS support. I meant to include that in my question, but it didn't make it in. The error message references Sail which supplies the Sesame implementation of SPIN, I believe. Also note that the RDF file I'm trying to import is relatively small with under 2000 facts total, so in memory should not be a problem. – Greg Cox Jun 23 '16 at 22:34
  • The SPIN support in Sesame / RDF4J is still beta and it's quite possible that you've uncovered a bug. Could you submit a bug report with relevant details (including the actual RDF/SPIN file that causes the problem)? – Jeen Broekstra Jun 24 '16 at 03:59
  • 1
    Thanks Jeen Broekstrat. The work is for the DoD. Although it's not classified, I should still take a couple things out of the ontology and make sure it still has the same problem. I can preserve one of the constraints without worrying about disclosing something I shouldn't. Then, assuming the problem persists, I can submit the bug report. If the problem doesn't persist, that itself would be an important clue. – Greg Cox Jun 24 '16 at 17:39
  • Thanks for the reformatting, TallTed. I'll try to get it formatted better upon submission next time. I'm not yet familiar with the question formatting tools. – Greg Cox Jun 24 '16 at 17:40
  • Issue reported at https://github.com/eclipse/rdf4j/issues/195 – Jeen Broekstra Jun 25 '16 at 04:32
  • Thanks for linking my issue report, Jean Broekstra. I should do that myself in the future. Still a newbie... – Greg Cox Jun 25 '16 at 13:06

1 Answers1

1

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 .
}
Greg Cox
  • 287
  • 1
  • 12