1 5 6 package com.hp.hpl.jena.db.impl; 7 8 import com.hp.hpl.jena.graph.*; 9 import com.hp.hpl.jena.util.iterator.*; 10 import com.hp.hpl.jena.vocabulary.DB; 11 12 30 public class DBPropLSet extends DBProp { 31 32 public static Node_URI lSetName = (Node_URI)DB.lSetName.getNode(); 33 public static Node_URI lSetType = (Node_URI)DB.lSetType.getNode(); 34 public static Node_URI lSetPSet = (Node_URI)DB.lSetPSet.getNode(); 35 36 public DBPropLSet( SpecializedGraph g, String name, String type) { 37 super( g); 38 putPropString(lSetName, name); 39 putPropString(lSetType, type); 40 } 41 42 public DBPropLSet( SpecializedGraph g, Node n) { 43 super(g,n); 44 } 45 46 public void setPSet( DBPropPSet pset ) { 47 putPropNode( lSetPSet, pset.getNode() ); 48 } 49 50 public String getName() { return self.getURI().substring(DB.getURI().length()); } 51 public String getType() { return getPropString( lSetType); } 52 53 public DBPropPSet getPset() { 54 ClosableIterator matches = graph.find( self, lSetPSet, null, newComplete() ); 55 if( matches.hasNext() ) { 56 try { return new DBPropPSet( graph, ((Triple) matches.next()).getObject()); } 57 finally { matches.close(); } 58 } 59 else 60 return null; 61 } 62 63 public void remove() { 64 DBPropPSet pSet = getPset(); 65 if (pSet != null ) 66 pSet.remove(); 67 super.remove(); 68 } 69 70 public ExtendedIterator listTriples() { 71 ExtendedIterator result = DBProp.listTriples(graph, self); 73 74 DBPropPSet pset = getPset(); 76 if( pset != null ) 77 result = result.andThen( DBProp.listTriples(graph, getPset().getNode()) ); 78 79 return result; 80 } 81 82 83 } 84 85 | Popular Tags |