jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1416206 [5/5] - in /jena/branches/jena-core-simplified/src: main/java/com/hp/hpl/jena/assembler/assemblers/ main/java/com/hp/hpl/jena/graph/ main/java/com/hp/hpl/jena/graph/compose/ main/java/com/hp/hpl/jena/graph/impl/ main/java/com/hp/hp...
Date Sun, 02 Dec 2012 17:47:09 GMT
Modified: jena/branches/jena-core-simplified/src/test/java/com/hp/hpl/jena/reasoner/rulesys/test/TestInferenceReification.java
URL: http://svn.apache.org/viewvc/jena/branches/jena-core-simplified/src/test/java/com/hp/hpl/jena/reasoner/rulesys/test/TestInferenceReification.java?rev=1416206&r1=1416205&r2=1416206&view=diff
==============================================================================
--- jena/branches/jena-core-simplified/src/test/java/com/hp/hpl/jena/reasoner/rulesys/test/TestInferenceReification.java
(original)
+++ jena/branches/jena-core-simplified/src/test/java/com/hp/hpl/jena/reasoner/rulesys/test/TestInferenceReification.java
Sun Dec  2 17:46:51 2012
@@ -50,11 +50,7 @@ public class TestInferenceReification ex
     
     @Override
     public Graph getGraph()
-        { return getGraph( ReificationStyle.Minimal ); }
-
-    @Override
-    public Graph getGraph( ReificationStyle style )
-        { return makeInfGraph( "", "", style ); }
+        { return makeInfGraph( "", "" ); }
 
     /**
      * Case 1: Rules construct a reified statement, is that
@@ -64,51 +60,13 @@ public class TestInferenceReification ex
         String rules =  
             "[r1: (?x eh:p ?o) -> (?o rdf:type rdf:Statement) (?o rdf:subject ?x)" +
             "                         (?o rdf:predicate eh:q) (?o rdf:object 42)]";
-        Model m = makeInfModel( rules, "r1 p r", ReificationStyle.Standard );
+        Model m = makeInfModel( rules, "r1 p r" );
         TestUtil.assertIteratorLength( m.listReifiedStatements(), 1 );
     }
     
-    public void testBindFixesStyle()
-        {
-        testBindCopiesStyle( ruleBaseReasoner() );
-        testBindCopiesStyle( ReasonerRegistry.getRDFSReasoner() );
-        testBindCopiesStyle( ReasonerRegistry.getTransitiveReasoner() );
-        testBindCopiesStyle( ReasonerRegistry.getOWLMicroReasoner() );
-        testBindCopiesStyle( ReasonerRegistry.getOWLMiniReasoner() );
-        testBindCopiesStyle( ReasonerRegistry.getOWLReasoner() );
-        testBindCopiesStyle( ReasonerRegistry.getRDFSSimpleReasoner() );
-        }
-
-    private void testBindCopiesStyle( Reasoner r )
-        {
-        testCopiesStyle( r, ReificationStyle.Minimal );
-        testCopiesStyle( r, ReificationStyle.Standard );
-        testCopiesStyle( r, ReificationStyle.Convenient );
-        }
-
-    private void testCopiesStyle( Reasoner r, ReificationStyle style )
-        {
-        assertEquals( style, r.bind( graphWith( "", style ) ).getReifier().getStyle() );
-        }
-
     private Reasoner ruleBaseReasoner()
         { return new FBRuleReasoner( Rule.parseRules( "" ) ); }
     
-    public void testRetainsStyle()
-        {
-        testRetainsStyle( ReificationStyle.Standard );
-        testRetainsStyle( ReificationStyle.Convenient );
-        testRetainsStyle( ReificationStyle.Minimal );
-        }
-
-    private void testRetainsStyle( ReificationStyle style )
-        {
-        BasicForwardRuleInfGraph g = (BasicForwardRuleInfGraph) getGraph( style );
-        assertEquals( style, g.getReifier().getStyle() );
-        assertEquals( style, g.getRawGraph().getReifier().getStyle() );
-        assertEquals( style, g.getDeductionsGraph().getReifier().getStyle() );
-        }
-    
     public void testConstructingModelDoesntForcePreparation()
         {
         Model m = makeInfModel( "", "" );
@@ -132,27 +90,23 @@ public class TestInferenceReification ex
      * Internal helper: create an InfGraph with given rule set and base data.
      * The base data is encoded in kers-special RDF syntax.
      */    
-    private InfGraph makeInfGraph(String rules, String data, ReificationStyle style ) {
+    private InfGraph makeInfGraph(String rules, String data) {
         PrintUtil.registerPrefix("eh", "eh:/");
-        Graph base = graphWith( data, style );
+        Graph base = graphWith( data );
         List<Rule> ruleList = Rule.parseRules(rules);
         return new FBRuleReasoner(ruleList).bind( base );
     }
     
     private Graph graphWith( String data, ReificationStyle style )
-        { return graphAdd( Factory.createDefaultGraph( style ), data ); }
+        { return graphAdd( Factory.createDefaultGraph( ), data ); }
 
     /**
      * Internal helper: create a Model which wraps an InfGraph with given rule set and base
data.
      * The base data is encoded in kers-special RDF syntax.
-     * @param style TODO
      */
-    private Model makeInfModel( String rules, String data, ReificationStyle style ) {
-        return ModelFactory.createModelForGraph( makeInfGraph(rules, data, style ) );
-    }
         
     private Model makeInfModel( String rules, String data ) {
-        return makeInfModel( rules, data, ReificationStyle.Minimal );
+        return ModelFactory.createModelForGraph( makeInfGraph(rules, data ) );
     }
     
 }

Modified: jena/branches/jena-core-simplified/src/test/java/com/hp/hpl/jena/reasoner/rulesys/test/WebOntTestHarness.java
URL: http://svn.apache.org/viewvc/jena/branches/jena-core-simplified/src/test/java/com/hp/hpl/jena/reasoner/rulesys/test/WebOntTestHarness.java?rev=1416206&r1=1416205&r2=1416206&view=diff
==============================================================================
--- jena/branches/jena-core-simplified/src/test/java/com/hp/hpl/jena/reasoner/rulesys/test/WebOntTestHarness.java
(original)
+++ jena/branches/jena-core-simplified/src/test/java/com/hp/hpl/jena/reasoner/rulesys/test/WebOntTestHarness.java
Sun Dec  2 17:46:51 2012
@@ -18,18 +18,18 @@
 
 package com.hp.hpl.jena.reasoner.rulesys.test;
 
-import com.hp.hpl.jena.graph.query.*;
-import com.hp.hpl.jena.graph.*;
-import com.hp.hpl.jena.ontology.OntModelSpec;
-import com.hp.hpl.jena.rdf.model.*;
-
-import com.hp.hpl.jena.reasoner.*;
-import com.hp.hpl.jena.reasoner.rulesys.FBRuleInfGraph;
-import com.hp.hpl.jena.reasoner.test.WGReasonerTester;
-import com.hp.hpl.jena.vocabulary.*;
+import java.io.* ;
+import java.util.* ;
 
-import java.io.*;
-import java.util.*;
+import com.hp.hpl.jena.ontology.OntModelSpec ;
+import com.hp.hpl.jena.rdf.model.* ;
+import com.hp.hpl.jena.reasoner.InfGraph ;
+import com.hp.hpl.jena.reasoner.Reasoner ;
+import com.hp.hpl.jena.reasoner.ReasonerException ;
+import com.hp.hpl.jena.reasoner.ReasonerRegistry ;
+import com.hp.hpl.jena.reasoner.rulesys.FBRuleInfGraph ;
+import com.hp.hpl.jena.reasoner.test.WGReasonerTester ;
+import com.hp.hpl.jena.vocabulary.* ;
 
 /**
  * Test harness for running the WebOnt working group tests relevant 
@@ -377,7 +377,7 @@ public class WebOntTestHarness {
                 ((FBRuleInfGraph)graph).resetLPProfile(true);
             }
             Model result = ModelFactory.createModelForGraph(graph);
-            boolean correct = testEntailment(conclusions.getGraph(), result.getGraph());
+            boolean correct = WGReasonerTester.testConclusions(conclusions.getGraph(), result.getGraph());
             long t2 = System.currentTimeMillis();
             lastTestDuration = t2 - t1; 
             if (printProfile) {
@@ -468,18 +468,6 @@ public class WebOntTestHarness {
     }
     
     /**
-     * Test a conclusions graph against a result graph. This works by
-     * translating the conclusions graph into a find query which contains one
-     * variable for each distinct bNode in the conclusions graph.
-     */
-    public boolean testEntailment(Graph conclusions, Graph result) {
-        QueryHandler qh = result.queryHandler();
-        GraphQuery query = WGReasonerTester.graphToQuery(conclusions);
-        Iterator<Domain> i = qh.prepareBindings(query, new Node[] {}).executeBindings();
-        return i.hasNext();
-    }
-    
-    /**
      * Example the conclusions graph for introduction of restrictions which
      * require a comprehension rewrite and declare new (anon) classes
      * for those restrictions.

Added: jena/branches/jena-core-simplified/src/test/java/com/hp/hpl/jena/reasoner/test/Matcher.java
URL: http://svn.apache.org/viewvc/jena/branches/jena-core-simplified/src/test/java/com/hp/hpl/jena/reasoner/test/Matcher.java?rev=1416206&view=auto
==============================================================================
--- jena/branches/jena-core-simplified/src/test/java/com/hp/hpl/jena/reasoner/test/Matcher.java
(added)
+++ jena/branches/jena-core-simplified/src/test/java/com/hp/hpl/jena/reasoner/test/Matcher.java
Sun Dec  2 17:46:51 2012
@@ -0,0 +1,218 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.hp.hpl.jena.reasoner.test;
+
+import java.util.* ;
+
+import org.slf4j.Logger ;
+import org.slf4j.LoggerFactory ;
+
+import com.hp.hpl.jena.graph.Graph ;
+import com.hp.hpl.jena.graph.Node ;
+import com.hp.hpl.jena.graph.Triple ;
+import com.hp.hpl.jena.shared.JenaException ;
+
+public class Matcher
+{
+    private static Logger log = LoggerFactory.getLogger("Matcher") ;
+    static boolean logging = false ;
+    private static Allocator anyizer = new AllocatorAny() ;
+
+    /**
+     * Subgraph isomorphism.
+     * Like a BGP match except you can only bind to bNodes.
+     */
+    public static boolean subgraphIsomorphism(Graph subgraph, Graph graph) {
+        // BNode subgraph isomorphism.  For small graphs.
+        List<Triple> pattern = bnodes2vars(subgraph) ;
+        return match(pattern, graph, false).hasNext();
+    }
+    
+    /**
+     * Subgraph inferred by .
+     * Like a BGP match except you can only bind to bNodes.
+     */
+    public static boolean subgraphInferred(Graph subgraph, Graph graph) {
+        // BNode subgraph isomorphism.  For small graphs.
+        List<Triple> pattern = bnodes2vars(subgraph) ;
+        return match(pattern, graph, true).hasNext();
+    }
+    
+    /*package*/ static List<Triple> bnodes2vars(Graph graph)
+    {
+        Map<Node, Node> bnodeMapping = new HashMap<Node, Node>();
+        Allocator allocator = new AllocatorBlankVar() ;
+        List<Triple> pattern = remap(bnodeMapping, graph, allocator) ;
+        return pattern ;
+    }
+
+    private static Iterator<Map<Node, Node>> match(List<Triple> pattern,
Graph graph, boolean bindAny) {
+        List<Map<Node, Node>> solutions = new ArrayList<Map<Node, Node>>()
;
+        solutions.add(new HashMap<Node, Node>()) ;  // Root binding.
+        return solve(solutions, pattern, graph, bindAny) ; 
+    }
+    
+    private static Iterator<Map<Node, Node>> solve(List<Map<Node, Node>>
solutions , List<Triple> pattern, Graph graph, boolean bindAny)
+    {
+        log("Solve: %s", pattern) ;
+        
+        if ( pattern.size() == 0 )
+        {
+            log("Solve: Result: %s", solutions) ;
+            return solutions.iterator() ;
+        }
+        
+        Triple step  = pattern.get(0) ;
+        List<Map<Node, Node>> solutions2 = new ArrayList<Map<Node, Node>>()
;
+        
+        for ( Map<Node, Node> binding : solutions )
+        {
+            Triple gStep = remap(binding, step, anyizer) ;
+            log("Solve: %s => %s", step, gStep) ;
+            Iterator<Triple> iter = graph.find(gStep) ;
+            while ( iter.hasNext() )
+            {
+                Triple t = iter.next() ;
+                log("Solve: %s -> %s", step, t) ;
+                Map<Node, Node> newBinding = bind(step, t, binding, bindAny) ;
+                if ( newBinding == null )
+                    continue ;
+                log("Solve: soln: %s", newBinding) ;
+                solutions2.add(newBinding) ;
+            }
+        }
+        
+        List<Triple> nextPattern = pattern.subList(1, pattern.size()) ;
+        return solve(solutions2, nextPattern, graph, bindAny) ;
+    }
+    
+    private static Map<Node, Node> bind(Triple step, Triple t, Map<Node, Node>
bindings, boolean bindAny)
+    {
+        log("Bind: %s :: %s",step,t) ;
+        HashMap<Node, Node> newBinding = new HashMap<Node, Node>() ;
+        newBinding.putAll(bindings) ;
+        if ( ! process(newBinding, t.getSubject(), step.getSubject(), bindAny ))
+            return null ;
+        if ( ! process(newBinding, t.getPredicate(), step.getPredicate(), bindAny ))
+            return null ;
+        if ( ! process(newBinding, t.getObject(), step.getObject(), bindAny ))
+            return null ;
+        log("Bind: %s",newBinding) ;
+        return newBinding ;
+    }
+
+    private static boolean process(Map<Node, Node> results, Node dataNode, Node varNode,
boolean bindAny)
+    {
+        if ( ! varNode.isVariable() )
+        {
+            if ( ! dataNode.sameValueAs(varNode) )
+                throw new JenaException("Internal error in Matcher") ;
+            return true ;
+        }
+        Node x = results.get(varNode) ;
+        if ( x != null )
+            // Bound already.  Match?
+            return dataNode.equals(x) ;
+        
+        // Isomorphism - must be a bNode.
+        // Infered, can be anything.
+        if ( !bindAny && ! dataNode.isBlank() )
+            return false ;
+        
+        results.put(varNode, dataNode) ;
+        return true ;
+    }
+
+    private static List<Triple> remap(Map<Node, Node> bnodeMapping, Graph g,
Allocator alloc)
+    {
+        List<Triple> triples = g.find(Node.ANY,  Node.ANY, Node.ANY).toList() ;
+        return remap(bnodeMapping, triples, alloc) ;
+    }
+
+    private static List<Triple> remap(Map<Node, Node> bnodeMapping, List<Triple>triples,
Allocator alloc)
+    {
+        List<Triple> pattern = new ArrayList<Triple>() ;
+        for ( Triple t : triples )
+        {
+            Triple t2 = remap(bnodeMapping, t, alloc) ;
+            pattern.add(t2) ;
+        }
+        return pattern ; 
+        
+    }
+    
+    private static Triple remap(Map<Node, Node> bnodeMapping, Triple t, Allocator alloc)
+    {
+        Node s = t.getSubject() ;
+        Node p = t.getPredicate() ;
+        Node o = t.getObject() ;
+        return new Triple(remap(bnodeMapping,s,alloc), remap(bnodeMapping,p,alloc), remap(bnodeMapping,o,alloc)
) ;
+    }
+
+    private static Node remap(Map<Node, Node> mapping, Node n, Allocator alloc)
+    {
+        // caution
+        if ( ! n.isBlank() && ! n.isVariable() )
+            return n ;
+        if ( mapping.containsKey(n) )
+            return mapping.get(n) ;
+        Node n2 = alloc.allocate() ;
+        alloc.update(mapping, n, n2) ;
+        return n2 ;
+    }
+    
+    private static void log(String fmt, Object... args)
+    {
+        if ( logging && log.isInfoEnabled() )
+        {
+            String x = String.format(fmt, args) ;
+            log.info(x) ;
+        }
+    }
+    
+    private interface Allocator
+    {
+        boolean test(Node n) ;
+        Node allocate() ;
+        void update(Map<Node, Node> mapping, Node inNode, Node allocNode) ;
+    }
+    
+    private static class AllocatorBlankVar implements Allocator {
+        int counter = 0 ; 
+        @Override
+        public Node allocate()
+        { return Node.createVariable("v"+(counter++)) ; }
+        @Override
+        public boolean test(Node n) { return n.isBlank() ; }
+        @Override
+        public void update(Map<Node, Node> mapping, Node inNode, Node allocNode) {
mapping.put(inNode, allocNode) ; }
+    }
+    
+    private static class AllocatorAny implements Allocator {
+        int counter = 0 ; 
+        @Override
+        public Node allocate()
+        { return Node.ANY ; }
+        @Override
+        public boolean test(Node n) { return n.isVariable() ; }
+        @Override
+        public void update(Map<Node, Node> mapping, Node inNode, Node allocNode) {
}
+        
+    }
+}

Modified: jena/branches/jena-core-simplified/src/test/java/com/hp/hpl/jena/reasoner/test/TestInfGraph.java
URL: http://svn.apache.org/viewvc/jena/branches/jena-core-simplified/src/test/java/com/hp/hpl/jena/reasoner/test/TestInfGraph.java?rev=1416206&r1=1416205&r2=1416206&view=diff
==============================================================================
--- jena/branches/jena-core-simplified/src/test/java/com/hp/hpl/jena/reasoner/test/TestInfGraph.java
(original)
+++ jena/branches/jena-core-simplified/src/test/java/com/hp/hpl/jena/reasoner/test/TestInfGraph.java
Sun Dec  2 17:46:51 2012
@@ -18,13 +18,12 @@
 
 package com.hp.hpl.jena.reasoner.test;
 
-import junit.framework.*;
+import junit.framework.TestSuite ;
 
-import com.hp.hpl.jena.graph.Graph;
-import com.hp.hpl.jena.graph.test.AbstractTestGraph;
-import com.hp.hpl.jena.rdf.model.ModelFactory;
-import com.hp.hpl.jena.reasoner.InfGraph;
-import com.hp.hpl.jena.reasoner.rulesys.BasicFBReifier;
+import com.hp.hpl.jena.graph.Graph ;
+import com.hp.hpl.jena.graph.test.AbstractTestGraph ;
+import com.hp.hpl.jena.rdf.model.ModelFactory ;
+import com.hp.hpl.jena.reasoner.InfGraph ;
 
 /**
      Needs extending; relys on knowing that the only InfGraph currently used is
@@ -56,12 +55,6 @@ public class TestInfGraph extends Abstra
         assertSame( ig.getPrefixMapping(), ig.getRawGraph().getPrefixMapping() );
         }
     
-    public void testInfReification()
-        {
-        InfGraph ig = getInfGraph();
-        assertInstanceOf( BasicFBReifier.class, ig.getReifier() );
-        }
-    
     /**
          Placeholder. Will need revision later.
     */

Modified: jena/branches/jena-core-simplified/src/test/java/com/hp/hpl/jena/reasoner/test/WGReasonerTester.java
URL: http://svn.apache.org/viewvc/jena/branches/jena-core-simplified/src/test/java/com/hp/hpl/jena/reasoner/test/WGReasonerTester.java?rev=1416206&r1=1416205&r2=1416206&view=diff
==============================================================================
--- jena/branches/jena-core-simplified/src/test/java/com/hp/hpl/jena/reasoner/test/WGReasonerTester.java
(original)
+++ jena/branches/jena-core-simplified/src/test/java/com/hp/hpl/jena/reasoner/test/WGReasonerTester.java
Sun Dec  2 17:46:51 2012
@@ -18,24 +18,31 @@
 
 package com.hp.hpl.jena.reasoner.test;
 
-import com.hp.hpl.jena.rdf.model.*;
-import com.hp.hpl.jena.graph.*;
-import com.hp.hpl.jena.graph.query.*;
-import com.hp.hpl.jena.rdf.model.impl.PropertyImpl;
-import com.hp.hpl.jena.rdf.model.impl.ResourceImpl;
-import com.hp.hpl.jena.reasoner.*;
-import com.hp.hpl.jena.vocabulary.RDF;
-import com.hp.hpl.jena.rdf.arp.ARPTests;
-
-import com.hp.hpl.jena.shared.*;
-
-import junit.framework.*;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.*;
-import java.util.*;
-import java.net.*;
+import java.io.BufferedInputStream ;
+import java.io.FileInputStream ;
+import java.io.IOException ;
+import java.io.InputStream ;
+import java.net.URL ;
+import java.util.ArrayList ;
+import java.util.Iterator ;
+import java.util.List ;
+
+import junit.framework.Assert ;
+import junit.framework.TestCase ;
+import org.slf4j.Logger ;
+import org.slf4j.LoggerFactory ;
+
+import com.hp.hpl.jena.graph.Factory ;
+import com.hp.hpl.jena.graph.Graph ;
+import com.hp.hpl.jena.rdf.arp.ARPTests ;
+import com.hp.hpl.jena.rdf.model.* ;
+import com.hp.hpl.jena.rdf.model.impl.PropertyImpl ;
+import com.hp.hpl.jena.rdf.model.impl.ResourceImpl ;
+import com.hp.hpl.jena.reasoner.InfGraph ;
+import com.hp.hpl.jena.reasoner.Reasoner ;
+import com.hp.hpl.jena.reasoner.ReasonerFactory ;
+import com.hp.hpl.jena.shared.JenaException ;
+import com.hp.hpl.jena.vocabulary.RDF ;
 
 /**
  * A utility to support execution of the RDFCode working group entailment
@@ -364,62 +371,27 @@ public class WGReasonerTester {
         
         // Signal the results        
         if (testcase != null) {
+//            if ( !correct )
+//            {
+//                boolean b = testConclusions(conclusions.getGraph(), result.getGraph());
+//                System.out.println("**** actual") ;
+//                result.write(System.out, "TTL") ; 
+//                System.out.println("**** expected") ;
+//                conclusions.write(System.out, "TTL") ;
+//            }
             Assert.assertTrue("Test: " + test + "\n" +  description, correct);
         }
         return correct?goodResult:FAIL;
     }
     
     /**
-     * Test a conclusions graph against a result graph. This works by
+     * Test a conclusions graph against a result graph.
+    * This works by
      * translating the conclusions graph into a find query which contains one
      * variable for each distinct bNode in the conclusions graph.
      */
-    private boolean testConclusions(Graph conclusions, Graph result) {
-        QueryHandler qh = result.queryHandler();
-        GraphQuery query = graphToQuery(conclusions);
-        Iterator<Domain> i = qh.prepareBindings(query, new Node[] {}).executeBindings();
-        return i.hasNext();
+    public static boolean testConclusions(Graph conclusions, Graph result) {
+        return Matcher.subgraphInferred(conclusions, result) ;
     }
 
- 
-    /**
-     * Translate a conclusions graph into a query pattern
-     */
-    public static GraphQuery graphToQuery(Graph graph) {
-        HashMap<Node, Node> bnodeToVar = new HashMap<Node, Node>();
-        GraphQuery query = new GraphQuery();
-        for (Iterator<Triple> i = graph.find(null, null, null); i.hasNext(); ) {
-            Triple triple = i.next();
-            query.addMatch(
-                translate(triple.getSubject(), bnodeToVar),
-                translate(triple.getPredicate(), bnodeToVar),
-                translate(triple.getObject(), bnodeToVar) );
-        }
-        return query;
-    }
-   
-    /**
-     * Translate a blank node to a variable node
-     * @param node the bNode to translate
-     * @param bnodeToVar a map of translations already known about
-     * @return a variable node
-     */
-    private static Node translate(Node node, HashMap<Node, Node> bnodeToVar) {
-        String varnames = "abcdefghijklmnopqrstuvwxyz";
-        if (node.isBlank()) {
-            Node t = bnodeToVar.get(node);
-            if (t == null) {
-               int i = bnodeToVar.size();
-               if (i > varnames.length()) {
-                   throw new ReasonerException("Too many bnodes in query");
-               }
-               t = Node.createVariable(varnames.substring(i, i+1));
-               bnodeToVar.put(node, t);
-            } 
-            return t;
-        } else {
-            return node;
-        }
-    }
- 
 }

Modified: jena/branches/jena-core-simplified/src/test/java/com/hp/hpl/jena/shared/TestReificationStyle.java
URL: http://svn.apache.org/viewvc/jena/branches/jena-core-simplified/src/test/java/com/hp/hpl/jena/shared/TestReificationStyle.java?rev=1416206&r1=1416205&r2=1416206&view=diff
==============================================================================
--- jena/branches/jena-core-simplified/src/test/java/com/hp/hpl/jena/shared/TestReificationStyle.java
(original)
+++ jena/branches/jena-core-simplified/src/test/java/com/hp/hpl/jena/shared/TestReificationStyle.java
Sun Dec  2 17:46:51 2012
@@ -48,14 +48,17 @@ public class TestReificationStyle extend
         assertEquals( true, new ReificationStyle( true, true ).conceals() );
         assertEquals( true, new ReificationStyle( false, true ).conceals() ); }
         
+    @SuppressWarnings("deprecation")
     public void testConstants()
-        { assertEquals( false, ReificationStyle.Minimal.intercepts() );
+        { 
+        assertEquals( false, ReificationStyle.Minimal.intercepts() );
         assertEquals( true, ReificationStyle.Minimal.conceals() );
         assertEquals( true, ReificationStyle.Standard.intercepts() );
         assertEquals( false, ReificationStyle.Standard.conceals() );
         assertEquals( true, ReificationStyle.Convenient.intercepts() );
         assertEquals( true, ReificationStyle.Convenient.conceals() ); }
     
+    @SuppressWarnings("deprecation")
     public void testPrettyPrinting()
         { assertEquals( "Minimal", ReificationStyle.Minimal.toString() );
         assertEquals( "Convenient", ReificationStyle.Convenient.toString() );



Mime
View raw message