/* * (non-Javadoc) * * @see gate.creole.ontology.OInstance#addObjectPropertyValue(gate.creole.ontology.ObjectProperty, * gate.creole.ontology.OInstance) */ public void addObjectPropertyValue(ObjectProperty aProperty, OInstance value) throws InvalidValueException { // we need to check if the current instance is a valid domain for // the property if (!aProperty.isValidDomain(this)) { Utils.error( this.getURI().toString() + " is not a valid domain for the property " + aProperty.getURI().toString()); return; } // we need to check if the current instance is a valid domain for // the property if (!aProperty.isValidRange(value)) { Utils.error( value.getURI().toString() + " is not a valid range for the property " + aProperty.getURI().toString()); return; } owlim.addObjectPropertyValue( this.repositoryID, this.uri.toString(), aProperty.getURI().toString(), value.getURI().toString()); ontology.fireResourcePropertyValueChanged( this, aProperty, value, OConstants.OBJECT_PROPERTY_VALUE_ADDED_EVENT); }
/* * (non-Javadoc) * * @see gate.creole.ontology.ObjectProperty#setInverseOf(gate.creole.ontology.ObjectProperty) */ public void setInverseOf(ObjectProperty theInverse) { if (this == theInverse) { Utils.warning( "setInverseOf(ObjectProperty) : The source and the argument properties are referring to the same property"); return; } ontologyService.setInverseOf(nodeId.toString(), theInverse.getOURI().toString()); }
/* * (non-Javadoc) * * @see gate.creole.ontology.OInstance#removeObjectPropertyValue(gate.creole.ontology.ObjectProperty, * gate.creole.ontology.OInstance) */ public void removeObjectPropertyValue(ObjectProperty aProperty, OInstance value) { owlim.removeObjectPropertyValue( this.repositoryID, this.uri.toString(), aProperty.getURI().toString(), value.getURI().toString()); ontology.fireResourcePropertyValueChanged( this, aProperty, value, OConstants.OBJECT_PROPERTY_VALUE_REMOVED_EVENT); }
/* * (non-Javadoc) * * @see gate.creole.ontology.OInstance#getObjectPropertyValues(gate.creole.ontology.ObjectProperty) */ public List<OInstance> getObjectPropertyValues(ObjectProperty aProperty) { String[] list = owlim.getObjectPropertyValues( this.repositoryID, uri.toString(), aProperty.getURI().toString()); List<OInstance> values = new ArrayList<OInstance>(); for (int i = 0; i < list.length; i++) { values.add(Utils.createOInstance(this.repositoryID, this.ontology, this.owlim, list[i])); } return values; }