@Override public EnhNode wrap( Node n, EnhGraph eg ) { return new PropertyImpl( n, eg ); } };
@Override public int getOrdinal() { if (ordinal < 0) ordinal = computeOrdinal(); return ordinal; }
private int computeOrdinal() { String localName = getLocalName(); if (getNameSpace().equals( RDF.getURI() ) && localName.matches( "_[0-9]+" )) return parseInt( localName.substring( 1 ) ); return 0; }
@Override public Property createProperty(String uriref) { return new PropertyImpl(uriref); }
private int computeOrdinal() { String localName = getLocalName(); if (getNameSpace().equals( RDF.getURI() ) && localName.matches( "_[0-9]+" )) return parseInt( localName.substring( 1 ) ); return 0; }
@Override public int getOrdinal() { if (ordinal < 0) ordinal = computeOrdinal(); return ordinal; }
@Override public Property createProperty(String namespace, String localName) { return new PropertyImpl(namespace, localName); }
@Override public Property createProperty(String uriref) { return new PropertyImpl(uriref); }
@Override public Property createProperty(String namespace, String localName) { return new PropertyImpl(namespace, localName); }
@Override public EnhNode wrap( Node n, EnhGraph eg ) { return new PropertyImpl( n, eg ); } };
protected Property createProperty( final String uri ) { return new PropertyImpl(uri); }
protected Property createProperty( final String uri ) { return new PropertyImpl(uri); }
/** * Creates an RDF model containing a generic message. * * @return */ public static Model genericMessage(URI predicate, URI object) { return genericMessage(new PropertyImpl(predicate.toString()), new ResourceImpl(object.toString())); }
/** * Casts a Resource into a Property. * @param resource the Resource to cast * @return resource as an instance of Property */ public static Property asProperty(Resource resource) { if(resource instanceof Property) { return (Property) resource; } else { return new PropertyImpl(resource.asNode(), (EnhGraph)resource.getModel()); } }
/** * Casts a Resource into a Property. * @param resource the Resource to cast * @return resource as an instance of Property */ public static Property asProperty(Resource resource) { if(resource instanceof Property) { return (Property) resource; } else { return new PropertyImpl(resource.asNode(), (EnhGraph)resource.getModel()); } }
/** * * @param baseUrl * @param datasources */ public IndexRequestProcessorForTPFs( final String baseUrl, final HashMap<String, IDataSource> datasources ) { this.model = ModelFactory.createDefaultModel(); for (Map.Entry<String, IDataSource> entry : datasources.entrySet()) { String datasourceName = entry.getKey(); IDataSource datasource = entry.getValue(); Resource datasourceUrl = new ResourceImpl(baseUrl + "/" + datasourceName); model.add(datasourceUrl, new PropertyImpl(RDF + "type"), VOID + "Dataset"); model.add(datasourceUrl, new PropertyImpl(RDFS + "label"), datasource.getTitle()); model.add(datasourceUrl, new PropertyImpl(DC + "title"), datasource.getTitle()); model.add(datasourceUrl, new PropertyImpl(DC + "description"), datasource.getDescription()); } }
/** * create a Statement from the triple _t_ in the enhanced graph _eg_. The * Statement has subject, predicate, and object corresponding to those of * _t_. */ public static Statement toStatement( Triple t, ModelCom eg ) { Resource s = new ResourceImpl( t.getSubject(), eg ); Property p = new PropertyImpl( t.getPredicate(), eg ); RDFNode o = createObject( t.getObject(), eg ); return new StatementImpl( s, p, o, eg ); }
/** * create a Statement from the triple _t_ in the enhanced graph _eg_. The * Statement has subject, predicate, and object corresponding to those of * _t_. */ public static Statement toStatement( Triple t, ModelCom eg ) { Resource s = new ResourceImpl( t.getSubject(), eg ); Property p = new PropertyImpl( t.getPredicate(), eg ); RDFNode o = createObject( t.getObject(), eg ); return new StatementImpl( s, p, o, eg ); }