/** * Returns a human-readable string representation of the given object. * * @see java.lang.Object#toString() * @param o * the object to represent as string * @return a string representation of the object */ public static String toString(PropertyIdValue o) { return o.getIri() + " (property)"; }
/** * Returns a human-readable string representation of the given object. * * @see java.lang.Object#toString() * @param o * the object to represent as string * @return a string representation of the object */ public static String toString(PropertyIdValue o) { return o.getIri() + " (property)"; }
/** * Get the URI for the given property in the given context. * * @param propertyIdValue * the property id for which to create a URI * @param propertyContext * the context for which the URI will be needed * @return the URI */ public static String getPropertyUri(PropertyIdValue propertyIdValue, PropertyContext propertyContext) { switch (propertyContext) { case STATEMENT: return propertyIdValue.getIri() + "s"; case VALUE: return propertyIdValue.getIri() + "v"; case QUALIFIER: return propertyIdValue.getIri() + "q"; case REFERENCE: return propertyIdValue.getIri() + "r"; case SIMPLE_CLAIM: return propertyIdValue.getIri() + "c"; default: return null; } }
/** * Returns a human-readable string representation of the given object. * * @see java.lang.Object#toString() * @param o * the object to represent as string * @return a string representation of the object */ public static String toString(NoValueSnak o) { return o.getPropertyId().getIri() + " has no value"; }
/** * Returns a human-readable string representation of the given object. * * @see java.lang.Object#toString() * @param o * the object to represent as string * @return a string representation of the object */ public static String toString(NoValueSnak o) { return o.getPropertyId().getIri() + " has no value"; }
/** * Returns a human-readable string representation of the given object. * * @see java.lang.Object#toString() * @param o * the object to represent as string * @return a string representation of the object */ public static String toString(SomeValueSnak o) { return o.getPropertyId().getIri() + " has some value"; }
/** * Returns a human-readable string representation of the given object. * * @see java.lang.Object#toString() * @param o * the object to represent as string * @return a string representation of the object */ public static String toString(SomeValueSnak o) { return o.getPropertyId().getIri() + " has some value"; }
/** * Returns the IRI of the primitive Type of an Property for * {@link StringValue} objects. * * @param propertyIdValue * @param value */ public String setPropertyTypeFromStringValue( PropertyIdValue propertyIdValue, StringValue value) { String datatype = getPropertyType(propertyIdValue); if (datatype == null) { logger.warn("Could not fetch datatype of " + propertyIdValue.getIri() + ". Assuming type " + DatatypeIdValue.DT_STRING); return DatatypeIdValue.DT_STRING; // default type for StringValue } else { return datatype; } }
/** * Returns a human-readable string representation of the given object. * * @see java.lang.Object#toString() * @param o * the object to represent as string * @return a string representation of the object */ public static String toString(ValueSnak o) { return o.getPropertyId().getIri() + " :: " + o.getValue().toString(); }
/** * Returns a human-readable string representation of the given object. * * @see java.lang.Object#toString() * @param o * the object to represent as string * @return a string representation of the object */ public static String toString(ValueSnak o) { return o.getPropertyId().getIri() + " :: " + o.getValue().toString(); }
@Override public Void visit(StringValue value) { ValueExportExtension<StringValue> vee = this.stringExportExtensions .get(this.currentPropertyIdValue.getIri()); if (vee != null) { try { vee.writeExtensionData(this.currentResource, this.currentPropertyIdValue, value, this.rdfWriter, this.owlDeclarationBuffer); } catch (RDFHandlerException e) { // give up; it's probably // impossible to continue anyway throw new RuntimeException(e.toString(), e); } } return null; }
@Override public void writeExtensionData(Resource resource, PropertyIdValue propertyIdValue, StringValue value, RdfWriter rdfWriter, OwlDeclarationBuffer owlDeclarationBuffer) throws RDFHandlerException { URI propertyUri = rdfWriter.getUri(propertyIdValue.getIri() + "-" + getPropertyPostfix()); owlDeclarationBuffer.addObjectProperty(propertyUri); rdfWriter.writeTripleUriObject(resource, propertyUri, getValueUri(value)); }
/** * Returns a human-readable string representation of the given object. * * @see java.lang.Object#toString() * @param o * the object to represent as string * @return a string representation of the object */ public static String toString(PropertyDocument o) { return "==PropertyDocument " + o.getEntityId().getIri() + " (r" + o.getRevisionId() + ") ==\n" + "* Datatype: " + o.getDatatype() + toStringForTermedDocument(o) + toStringForStatementDocument(o); }
/** * Returns a human-readable string representation of the given object. * * @see java.lang.Object#toString() * @param o * the object to represent as string * @return a string representation of the object */ public static String toString(PropertyDocument o) { return "==PropertyDocument " + o.getEntityId().getIri() + " (r" + o.getRevisionId() + ") ==\n" + "* Datatype: " + o.getDatatype() + toStringForTermedDocument(o) + toStringForStatementDocument(o); }
writeNoValueRestriction(rdfWriter, propertyIdValue.getIri(), Vocabulary.OWL_THING, Vocabulary.getPropertyUri( propertyIdValue, PropertyContext.NO_VALUE)); writeNoValueRestriction(rdfWriter, propertyIdValue.getIri(), Vocabulary.OWL_THING, Vocabulary.getPropertyUri( propertyIdValue, writeNoValueRestriction(rdfWriter, propertyIdValue.getIri(), Vocabulary.XSD_STRING, Vocabulary.getPropertyUri( propertyIdValue, PropertyContext.NO_VALUE)); writeNoValueRestriction(rdfWriter, propertyIdValue.getIri(), Vocabulary.XSD_STRING, Vocabulary.getPropertyUri( propertyIdValue,
public void writePropertyDocument(PropertyDocument document) throws RDFHandlerException { propertyRegister.setPropertyType(document.getEntityId(), document .getDatatype().getIri()); if (!hasTask(RdfSerializer.TASK_PROPERTIES)) { return; } String propertyUri = document.getEntityId().getIri(); Resource subject = this.rdfWriter.getUri(propertyUri); this.rdfWriter.writeTripleValueObject(subject, RdfWriter.RDF_TYPE, RdfWriter.WB_PROPERTY); writeDocumentTerms(subject, document); if (hasTask(RdfSerializer.TASK_DATATYPES)) { this.rdfWriter.writeTripleValueObject(subject, RdfWriter.WB_PROPERTY_TYPE, this.rdfWriter.getUri(document.getDatatype().getIri())); } if (hasTask(RdfSerializer.TASK_STATEMENTS)) { writeStatements(subject, document); } if (hasTask(RdfSerializer.TASK_PROPERTY_LINKS)) { writeInterPropertyLinks(document); } this.snakRdfConverter.writeAuxiliaryTriples(); this.owlDeclarationBuffer.writePropertyDeclarations(this.rdfWriter, hasTask(RdfSerializer.TASK_STATEMENTS), hasTask(RdfSerializer.TASK_SIMPLE_STATEMENTS)); this.referenceRdfConverter.writeReferences(); }
throws RDFHandlerException { Resource subject = this.rdfWriter.getUri(document.getEntityId() .getIri()); this.rdfWriter.writeTripleUriObject(subject, this.rdfWriter .getUri(Vocabulary.WB_DIRECT_CLAIM_PROP), Vocabulary