public PropertyDocument filter(PropertyDocument property) { return dataObjectFactory.getPropertyDocument( property.getEntityId(), filterMonoLingualTextValues(property.getLabels().values()), filterMonoLingualTextValues(property.getDescriptions().values()), filterMonoLingualTextValues(flatten(property.getAliases().values())), filterStatementGroups(property.getStatementGroups()), property.getDatatype(), property.getRevisionId() ); }
/** * Returns a hash code for the given object. * * @see java.lang.Object#hashCode() * @param o * the object to create a hash for * @return the hash code of the object */ public static int hashCode(PropertyDocument o) { int result; result = hashCodeForTermedDocument(o); result = prime * result + o.getStatementGroups().hashCode(); result = prime * result + o.getDatatype().hashCode(); return result; }
/** * 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); }
for (EntityDocument ed : results.values()) { PropertyDocument pd = (PropertyDocument) ed; if (DatatypeIdValue.DT_STRING.equals(pd.getDatatype().getIri()) && pd.getLabels().containsKey("en")) { stringProperties.add(pd.getEntityId()); System.out.println("* Found string property " + pd.getEntityId().getId() + " (" + pd.getLabels().get("en") + ")");
public void writePropertyDocument(PropertyDocument document) throws RDFHandlerException { propertyTypes.setPropertyType(document.getPropertyId(), 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); } this.snakRdfConverter.writeAuxiliaryTriples(); this.owlDeclarationBuffer.writePropertyDeclarations(this.rdfWriter, hasTask(RdfSerializer.TASK_STATEMENTS), hasTask(RdfSerializer.TASK_SIMPLE_STATEMENTS)); this.referenceRdfConverter.writeReferences(); }
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(); }
String data = JsonSerializer.getJsonString(propertyDocument); return (PropertyDocument) this.wbEditingAction.wbEditEntity( propertyDocument.getEntityId().getId(), null, null, null, data, clear, this.editAsBot, propertyDocument.getRevisionId(), summary);
@Override public void processPropertyDocument(PropertyDocument propertyDocument) { PropertyRecord pr = getPropertyRecord(propertyDocument.getEntityId()); pr.label = propertyDocument.findLabel("en"); .findStatementGroup("P1630"); if (urlPatterns != null) { for (Statement s : urlPatterns) { .findStatementGroup("P31"); if (instanceClasses != null) { for (Statement s : instanceClasses) {
@Override public void processPropertyDocument(PropertyDocument propertyDocument) { this.countProperties++; PropertyRecord propertyRecord = getPropertyRecord(propertyDocument.getEntityId()); propertyRecord.propertyDocument = propertyDocument; }
/** * Constructor when building the property document from an existing one. * * @param initialDocument * the initial property document to start the build from */ protected PropertyDocumentBuilder(PropertyDocument initialDocument) { super(initialDocument); this.datatype = initialDocument.getDatatype(); }
for (EntityDocument ed : results.values()) { PropertyDocument pd = (PropertyDocument) ed; if (DatatypeIdValue.DT_STRING.equals(pd.getDatatype().getIri()) && pd.getLabels().containsKey("en")) { stringProperties.add(pd.getEntityId()); System.out.println("* Found string property " + pd.getEntityId().getId() + " (" + pd.getLabels().get("en") + ")");
/** * 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 true if the parameters are two {@link PropertyDocument} objects * with exactly the same data. It does not matter if they are different * implementations of the interface as long as their content is the same. * * @param o1 * the first object to compare * @param o2 * the second object to compare * @return true if both objects are equal */ public static boolean equalsPropertyDocument(PropertyDocument o1, Object o2) { if (o2 == o1) { return true; } if (!(o2 instanceof PropertyDocument)) { return false; } PropertyDocument other = (PropertyDocument) o2; // Note: property id already compared by equalsTermedDocument() return equalsTermedDocument(o1, other) && o1.getDatatype().equals(other.getDatatype()) && o1.getStatementGroups().equals(other.getStatementGroups()); }
String data = JsonSerializer.getJsonString(propertyDocument); return (PropertyDocument) this.wbEditingAction.wbEditEntity( propertyDocument.getEntityId().getId(), null, null, null, data, clear, this.editAsBot, propertyDocument.getRevisionId(), summary);
@Override public void processPropertyDocument(PropertyDocument propertyDocument) { this.countProperties++; PropertyRecord propertyRecord = getPropertyRecord(propertyDocument .getEntityId()); propertyRecord.propertyDocument = propertyDocument; }
/** * Constructor when building the property document from an existing one. * * @param initialDocument * the initial property document to start the build from */ protected PropertyDocumentBuilder(PropertyDocument initialDocument) { super(initialDocument); this.datatype = initialDocument.getDatatype(); }
public PropertyDocument filter(PropertyDocument property) { return dataObjectFactory.getPropertyDocument( property.getEntityId(), filterMonoLingualTextValues(property.getLabels().values()), filterMonoLingualTextValues(property.getDescriptions().values()), filterMonoLingualTextValues(flatten(property.getAliases().values())), filterStatementGroups(property.getStatementGroups()), property.getDatatype(), property.getRevisionId() ); }
/** * Returns a hash code for the given object. * * @see java.lang.Object#hashCode() * @param o * the object to create a hash for * @return the hash code of the object */ public static int hashCode(PropertyDocument o) { int result; result = hashCodeForTermedDocument(o); result = prime * result + o.getStatementGroups().hashCode(); result = prime * result + o.getDatatype().hashCode(); return result; }
Resource subject = this.rdfWriter.getUri(document.getEntityId() .getIri()); this.rdfWriter.writeTripleUriObject(subject, this.rdfWriter .getUri(Vocabulary.WB_DIRECT_CLAIM_PROP), Vocabulary .getPropertyUri(document.getEntityId(), PropertyContext.DIRECT)); document.getEntityId(), PropertyContext.STATEMENT)); .getPropertyUri(document.getEntityId(), PropertyContext.VALUE_SIMPLE)); Vocabulary.getPropertyUri(document.getEntityId(), PropertyContext.VALUE)); .getPropertyUri(document.getEntityId(), PropertyContext.QUALIFIER_SIMPLE)); .getPropertyUri(document.getEntityId(), PropertyContext.QUALIFIER)); .getPropertyUri(document.getEntityId(), PropertyContext.REFERENCE_SIMPLE)); .getPropertyUri(document.getEntityId(), PropertyContext.REFERENCE)); .getPropertyUri(document.getEntityId(), PropertyContext.NO_VALUE));
if (propertyRecord.propertyDocument != null) { datatype = getDatatypeLabel(propertyRecord.propertyDocument .getDatatype());