public void addSeeAlso(URI seeAlso) throws OREException { res.addProperty(RDFS.seeAlso, model.createTypedLiteral(seeAlso)); }
/** * Appends a boolean to the command text as a constant using appropriate * formatting * * @param b * Boolean to append */ public void appendLiteral(boolean b) { this.appendNode(this.model.createTypedLiteral(b)); }
/** * Sets a variable parameter to a date time literal * * @param var * Variable * @param dt * Date Time value */ public void setLiteral(String var, Calendar dt) { this.setParam(var, this.model.createTypedLiteral(dt)); }
/** * Sets a positional parameter to a double literal * * @param index * Positional Index * @param d * Double value */ public void setLiteral(int index, double d) { this.setParam(index, this.model.createTypedLiteral(d)); }
public void setCreated(Date created) { SimpleDateFormat sdf = new SimpleDateFormat(JenaOREConstants.dateFormat); String date = sdf.format(created); res.addProperty(DCTerms.created, model.createTypedLiteral(date, JenaOREConstants.dateTypedLiteral)); }
@Override public <T extends PropertyHelper & ResourceHelper & ModelHelper> T withTypedLiteral(Object value, String type) { return addStatement(model().createTypedLiteral(value.toString(),type)); }
@Override public Resource addLiteral( Property p, long o ) { Model m = mustHaveModel(); m.add( this, p, m.createTypedLiteral( o ) ); return this; }
@Override public Resource addLiteral( Property p, double o ) { Model m = mustHaveModel(); m.add( this, p, m.createTypedLiteral( o ) ); return this; }
public void relate(Predicate pred, Object literal) throws OREException { Property property = model.createProperty(pred.getURI().toString()); triple.addProperty(property, model.createTypedLiteral(literal)); }
public Resource asRDF(Model model, boolean result) { Resource results = model.createResource() ; results.addProperty(RDF.type, ResultSetGraphVocab.ResultSet) ; Literal lit = model.createTypedLiteral(result) ; results.addProperty(ResultSetGraphVocab.p_boolean, lit) ; return results ; }
private void addRecentMashups(Model model, Service service) { // Create Recent Mashups Value if (service.getRecentMashups() != null) { com.hp.hpl.jena.rdf.model.Resource current = model.createResource(service.getUri().toASCIIString()); Literal recentMashups = model.createTypedLiteral(service.getRecentMashups()); current.addProperty(MSM_NFP.hasRecentMashups, recentMashups); } }
/** * <p>Answer true if this property restriction has the given cardinality.</p> * @param cardinality The cardinality to test against * @return True if the given cardinality is the cardinality of the restricted property in this restriction * @exception OntProfileException If the {@link Profile#MIN_CARDINALITY_Q()} property is not supported in the current language profile. */ @Override public boolean hasMinCardinalityQ( int cardinality ) { return hasPropertyValue( getProfile().MIN_CARDINALITY_Q(), "MIN_CARDINALITY_Q", getModel().createTypedLiteral( cardinality ) ); }
/** * <p>Remove the statement that this restriction has the given maximum cardinality * for the restricted property. If this statement * is not true of the current model, nothing happens.</p> * @param cardinality A max cardinality value to be removed from this restriction */ @Override public void removeMaxCardinality( int cardinality ) { removePropertyValue( getProfile().MAX_CARDINALITY(), "MAX_CARDINALITY", getModel().createTypedLiteral( cardinality ) ); }
/** * <p>Assert that this restriction restricts the property to have the given * min cardinality. Any existing statements for <code>cardinalityQ</code> * will be removed.</p> * @param cardinality The cardinality of the restricted property * @exception OntProfileException If the {@link Profile#MIN_CARDINALITY_Q()} property is not supported in the current language profile. */ @Override public void setMinCardinalityQ( int cardinality ) { setPropertyValue( getProfile().MIN_CARDINALITY_Q(), "MIN_CARDINALITY_Q", getModel().createTypedLiteral( cardinality ) ); }
/** * <p>Answer true if this property restriction has the given cardinality.</p> * @param cardinality The cardinality to test against * @return True if the given cardinality is the cardinality of the restricted property in this restriction * @exception OntProfileException If the {@link Profile#MAX_CARDINALITY_Q()} property is not supported in the current language profile. */ @Override public boolean hasMaxCardinalityQ( int cardinality ) { return hasPropertyValue( getProfile().MAX_CARDINALITY_Q(), "MAX_CARDINALITY_Q", getModel().createTypedLiteral( cardinality ) ); }
/** * <p>Remove the statement that this restriction has the given cardinality * for the restricted property. If this statement * is not true of the current model, nothing happens.</p> * @param cardinality A cardinality value to be removed from this restriction * @exception OntProfileException If the {@link Profile#MAX_CARDINALITY_Q()} property is not supported in the current language profile. */ @Override public void removeMaxCardinalityQ( int cardinality ) { removePropertyValue( getProfile().MAX_CARDINALITY_Q(), "MAX_CARDINALITY_Q", getModel().createTypedLiteral( cardinality ) ); }
/** * <p>Answer true if this property restriction has the given cardinality.</p> * @param cardinality The cardinality to test against * @return True if the given cardinality is the cardinality of the restricted property in this restriction * @exception OntProfileException If the {@link Profile#CARDINALITY_Q()} property is not supported in the current language profile. */ @Override public boolean hasCardinalityQ( int cardinality ) { return hasPropertyValue( getProfile().CARDINALITY_Q(), "CARDINALITY_Q", getModel().createTypedLiteral( cardinality ) ); }
/** * <p>Remove the statement that this restriction has the given cardinality * for the restricted property. If this statement * is not true of the current model, nothing happens.</p> * @param cardinality A cardinality value to be removed from this restriction */ @Override public void removeCardinality( int cardinality ) { removePropertyValue( getProfile().CARDINALITY(), "CARDINALITY", getModel().createTypedLiteral( cardinality ) ); }
/** * <p>Answer true if this property restriction has the given minimum cardinality.</p> * @param cardinality The cardinality to test against * @return True if the given cardinality is the min cardinality of the restricted property in this restriction * @exception OntProfileException If the {@link Profile#MIN_CARDINALITY()} property is not supported in the current language profile. */ @Override public boolean hasMinCardinality( int cardinality ) { return hasPropertyValue( getProfile().MIN_CARDINALITY(), "MIN_CARDINALITY", getModel().createTypedLiteral( cardinality ) ); }
private void addAddress(Model model, Service service) { if (service.getAddress() != null) { com.hp.hpl.jena.rdf.model.Resource current = model.createResource(service.getUri().toASCIIString()); Literal address = model.createTypedLiteral(service.getAddress(), HRESTS.URITemplate.getURI()); current.addProperty(HRESTS.hasAddress, address); } }