1 6 package com.hp.hpl.jena.db.impl; 7 8 import com.hp.hpl.jena.db.GraphRDB; 9 import com.hp.hpl.jena.graph.*; 10 import com.hp.hpl.jena.vocabulary.RDF; 11 12 20 21 public class SpecializedGraph_TripleStore_RDB extends SpecializedGraph_TripleStore { 22 23 30 public SpecializedGraph_TripleStore_RDB(IPSet pSet, Integer dbGraphId) { 31 super(pSet, dbGraphId); 32 } 33 34 53 54 public char subsumes ( Triple pattern, int reifBehavior ) { 55 char res = allTriplesForPattern; 57 if ( reifBehavior == GraphRDB.OPTIMIZE_AND_HIDE_ONLY_FULL_REIFICATIONS ) 58 return res; 59 Node pred = pattern.getPredicate(); 60 boolean isReifPred = pred.equals(RDF.Nodes.subject) || 61 pred.equals(RDF.Nodes.predicate) || 62 pred.equals(RDF.Nodes.object); 63 boolean isPredType = pred.equals(RDF.Nodes.type); 64 Node obj = pattern.getObject(); 65 boolean isObjStmt = obj.equals(RDF.Nodes.Statement); 66 if ( reifBehavior == GraphRDB.OPTIMIZE_ALL_REIFICATIONS_AND_HIDE_NOTHING ) { 67 if ( isReifPred ) res = noTriplesForPattern; 68 else if ( isPredType ) { 69 if ( isObjStmt ) res = noTriplesForPattern; 70 else if ( !obj.isConcrete() ) res = someTriplesForPattern; 71 } if ( !pred.isConcrete() ) res = someTriplesForPattern; 72 } else { 73 if ( isReifPred || (isPredType && isObjStmt) ) 75 res = noTriplesForPattern; 76 } 77 return res; 78 } 79 } 80 81 107 | Popular Tags |