@Override public EnhNode wrap( Node n, EnhGraph eg ) { return new PropertyImpl( n, eg ); } };
@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 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 ); }
/** * create a Statement from the triple <code>t</code> in the enhanced graph <code>eg</code>. * The Statement has subject, predicate, and object corresponding to those of * <code>t</code>. * * @param t the triple to build into a Statement * @param eg the Graph in which the Statement will be created * @return Statement the statement created */ public static Statement toStatement(Triple t, AGModel eg) { Resource s = new ResourceImpl(t.getSubject(), eg); Property p = new PropertyImpl(t.getPredicate(), eg); RDFNode o = createObject(t.getObject(), eg); return new AGStatement(s, p, o, eg); }
/** * Find a property value with a subject of this object * @param namespace Namespace for the property name * @param propertyName Name of the property * @return The string value of the property or null if no property exists */ public String findSinglePropertyValue(String namespace, String propertyName) { if (this.model == null || this.node == null) { return null; } Statement stmt = resource.getProperty(new PropertyImpl(namespace, propertyName)); if (stmt == null) return null; else if (stmt.getObject().isLiteral()){ return stmt.getObject().asLiteral().getString(); } else if (stmt.getObject().isResource()){ return PRE_DEFINED_URI_VALUE.get(stmt.getObject().asResource().getURI()); } else { return stmt.getObject().toString(); } }
/** * Find a property value with a subject of this object * @param namespace Namespace for the property name * @param propertyName Name of the property * @return The string value of the property or null if no property exists */ public String findSinglePropertyValue(String namespace, String propertyName) { if (this.model == null || this.node == null) { return null; } Statement stmt = resource.getProperty(new PropertyImpl(namespace, propertyName)); if (stmt == null) return null; else if (stmt.getObject().isLiteral()){ return stmt.getObject().asLiteral().getString(); } else if (stmt.getObject().isResource()){ return PRE_DEFINED_URI_VALUE.get(stmt.getObject().asResource().getURI()); } else { return stmt.getObject().toString(); } }
new StatementImpl( s.asResource(), new PropertyImpl(p.asResource().getURI()), o); currentProposalContent.add(newStatement);
new StatementImpl( s.asResource(), new PropertyImpl(p.asResource().getURI()), o); currentProposalContent.add(newStatement);