title: How to use CONSTRUCT / WHERE in a SPARQL SPIN rule declaration
body: <p><strong>Summary</strong></p>
  
  <p>Thank you in advance for helping me write a CONSTRUCT/WHERE statement that can be declared as a SPIN Rule in TopBraid Composer Free Edition and used.</p>
  
  <p>I am trying to embed a SPARQL CONSTRUCT/WHERE statement in a <code>spin:rule</code> declaration and then execute it. I am returning zero inferences to Statements 1 or 2 below. I am using Java 7, and Eclipse 4.3., and TopBraid Composer Free Edition. I have been successful running Statement 3 as a SPIN Constructor Declaration in the classes form (Statement 3). I have been successful running Statement 4 in the SPARQL query editor (interpreter) I have cross-posted to the user forum.</p>
  
  <p><strong>Details</strong></p>
  
  <p>Fact 1: I have not been able to run Statement 1 as a SPIN Rule.</p>
  
  <p>----Statement 1---</p>
  
  <pre><code>CONSTRUCT {
  ?this owl:hasKey ?x .
  }
  WHERE {
  BIND (spif:generateUUID() AS ?x) .
  }
  </code></pre>
  
  <p>Fact 2: I have not been able to run Statement 2 as a SPIN Rule.</p>
  
  <p>----Statement 2----</p>
  
  <pre><code>CONSTRUCT {
  ?this owl:hasKey ?x .
  }
  WHERE {
  ?this rdfs:subClassOf node:entity .
  BIND (spif:generateUUID() AS ?x) .
  }
  --No Error Message--
  </code></pre>
  
  <p>Fact 3: However I have been successful with Statement 3 in the constructor field of the classes form.</p>
  
  <p>----Statement 3----</p>
  
  <pre><code>CONSTRUCT {
  ?this owl:hasKey ?x .
  }
  WHERE {
  BIND (spif:generateUUID() AS ?x) .
  }
  Success: When a new instance is created a new triple indicating a key is created.
  </code></pre>
  
  <p>Fact 4: I have been successful with Statement 4 in the SPARQL query editor which is analogous.</p>
  
  <p>----Statement 4----</p>
  
  <pre><code>CONSTRUCT {
  ?s owl:hasKey ?x .
  }
  WHERE {
  ?s rdf:type node:word_use
  BIND (spif:generateUUID() AS ?x) .
  }
  Success: When statement is run all current instances get keys.
  </code></pre>
  
  <p>Fact 5: I do not have any SPARQL Rules libraries checked in the Ontology Profile form.</p>
  
  <p>Fact 6: I have imported the following two libraries.</p>
  
  <pre><code>&lt;http://spinrdf.org/spin&gt; from local file TopBraid/SPIN/spin.ttl.
  &lt;http://spinrdf.org/sp&gt; from local file TopBraid/SPIN/sp.ttl
  </code></pre>
  
  <p>Fact 7: The namespaces in the file are:</p>
  
  <pre><code>Base URI (Location) - http://example.org/
  Default Namespace - http://example.org/
  
  But the Base URI keeps getting reset to:
  http://www.semanticweb.org/owl/owlapi/turtle
  
  ace_lexicon - http://attempto.ifi.uzh.ch/ace_lexicon#
  arc - http://example.org/arc#
  arg - http://spinrdf.org/arg#
  concept - http://example.org/concept#
  node - http://www.example.org/node#
  owl - http://www.w3.org/2002/07/owl#
  rdf - http://www.w3.org/1999/02/22-rdf-syntax-ns#
  rdfs - http://www.w3.org/2001/01/rdf-schema#
  skos - http://www.w3.org/2004/02/skos/core#
  sp - http://spinrdf.org/sp#
  spif - http://spinrdf.org/spif#
  spin - http://spinrdf.org/spin#
  spl - http://spinrdf.org/spl#
  word_sense - http://example.org/word_sense#
  word_term - http://example.org/word_term#
  word_use - http://example.org/word_use#
  </code></pre>
  
  <p>Fact 8: The class that I am using has the following assertions.</p>
  
  <pre><code>Name - node:unclassified_concept
  SubClassOf - node:entity
  </code></pre>
  
  <p>Fact 9: An instance of the node:unclassified_concept class is described below.</p>
  
  <pre><code>URI - http://example.org/concept#regardless_of1
  rdfs:comment - without attention to
  rdfs:isDefinedBy - &lt;http://en.wiktionary.org/wiki/regardless_of&gt;
  rdfs:label - regardless of
  </code></pre>
  
  <p>Fact 10: I have been successful using Jena Generic Rules reasoning as well as the OWL_MEM_RULE_INF OntModelSpec, reading/writing, base models, inf models, and ont models. </p>
  
  <p><strong>Context</strong></p>
  
  <p>The context of my problem is the following. I am building and iteratively executing an      ontology and rule set using Java and Jena to prove the concept of OWL/RDF representing, considering, and responding to non-trivial type-written English. The sentence I am using is non-trivial (41 words, three clauses, etc.). The current ontology has 1422 assertions when not run against any OWL/RDF rules (transitivity, etc.). I am using TopBraid Composer when possible to complement Jena programming to make sure I am compliant with conventions and standards.</p>