@JsonProperty("lexicalCategory") String getJsonLexicalCategory() { return lexicalCategory.getId(); }
/** * 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(ItemIdValue o) { return o.getIri() + " (item)"; }
/** * Copies an {@link ItemIdValue}. * * @param object * object to copy * @return copied object */ public ItemIdValue copy(ItemIdValue object) { return dataObjectFactory.getItemIdValue(object.getId(), object.getSiteIri()); }
@JsonProperty("lexicalCategory") String getJsonLexicalCategory() { return lexicalCategory.getId(); }
/** * Copies an {@link ItemIdValue}. * * @param object * object to copy * @return copied object */ public ItemIdValue copy(ItemIdValue object) { return dataObjectFactory.getItemIdValue(object.getId(), object.getSiteIri()); }
/** * 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(ItemIdValue o) { return o.getIri() + " (item)"; }
@JsonProperty("language") String getJsonLanguage() { return language.getId(); }
/** * 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(ItemDocument o) { StringBuilder sb = new StringBuilder(); sb.append("==ItemDocument ").append(o.getEntityId().getIri()); sb.append(" (r").append(o.getRevisionId()).append(") "); sb.append("==").append(toStringForTermedDocument(o)); sb.append(toStringForStatementDocument(o)); sb.append("* Site links: "); boolean first = true; SortedSet<String> siteKeys = new TreeSet<>(o.getSiteLinks() .keySet()); for (String key : siteKeys) { if (first) { first = false; } else { sb.append("; "); } sb.append(toString(o.getSiteLinks().get(key))); } return sb.toString(); }
@JsonProperty("language") String getJsonLanguage() { return language.getId(); }
/** * 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(ItemDocument o) { StringBuilder sb = new StringBuilder(); sb.append("==ItemDocument ").append(o.getEntityId().getIri()); sb.append(" (r").append(o.getRevisionId()).append(") "); sb.append("==").append(toStringForTermedDocument(o)); sb.append(toStringForStatementDocument(o)); sb.append("* Site links: "); boolean first = true; SortedSet<String> siteKeys = new TreeSet<>(o.getSiteLinks() .keySet()); for (String key : siteKeys) { if (first) { first = false; } else { sb.append("; "); } sb.append(toString(o.getSiteLinks().get(key))); } return sb.toString(); }
@JsonProperty("grammaticalFeatures") List<String> getJsonGrammaticalFeatures() { if (grammaticalFeatures.isEmpty()) { return Collections.emptyList(); } List<String> output = new ArrayList<>(grammaticalFeatures.size()); for(ItemIdValue feature : grammaticalFeatures) { output.add(feature.getId()); } return output; }
@JsonProperty("grammaticalFeatures") List<String> getJsonGrammaticalFeatures() { if (grammaticalFeatures.isEmpty()) { return Collections.emptyList(); } List<String> output = new ArrayList<>(grammaticalFeatures.size()); for(ItemIdValue feature : grammaticalFeatures) { output.add(feature.getId()); } return output; }
@JsonProperty("badges") List<String> getBadgesString() { if (badges.isEmpty()) { return Collections.emptyList(); } List<String> output = new ArrayList<>(badges.size()); for(ItemIdValue badge : badges) { output.add(badge.getId()); } return output; }
void writeSiteLinks(Resource subject, Map<String, SiteLink> siteLinks) throws RDFHandlerException { if (!hasTask(RdfSerializer.TASK_SITELINKS)) { return; } for (String key : siteLinks.keySet()) { SiteLink siteLink = siteLinks.get(key); String siteLinkUrl = this.sites.getSiteLinkUrl(siteLink); if (siteLinkUrl != null) { IRI siteLinkUri = this.rdfWriter.getUri(siteLinkUrl); this.rdfWriter.writeTripleValueObject(siteLinkUri, RdfWriter.RDF_TYPE, RdfWriter.SCHEMA_ARTICLE); this.rdfWriter.writeTripleValueObject(siteLinkUri, RdfWriter.SCHEMA_ABOUT, subject); String siteLanguageCode = this.sites.getLanguageCode(siteLink.getSiteKey()); this.rdfWriter.writeTripleStringObject(siteLinkUri, RdfWriter.SCHEMA_IN_LANGUAGE, convertSiteLanguageCode(siteLanguageCode)); for(ItemIdValue badge : siteLink.getBadges()) { this.rdfWriter.writeTripleUriObject(siteLinkUri, RdfWriter.WB_BADGE, badge.getIri()); } } else { logger.warn("Failed to find URL for page \"" + siteLink.getPageTitle() + "\" on site \"" + siteLink.getSiteKey() + "\""); } } }
@JsonProperty("badges") List<String> getBadgesString() { if (badges.isEmpty()) { return Collections.emptyList(); } List<String> output = new ArrayList<>(badges.size()); for(ItemIdValue badge : badges) { output.add(badge.getId()); } return output; }
public void writeItemDocument(ItemDocument document) throws RDFHandlerException { if (!hasTask(RdfSerializer.TASK_ITEMS)) { return; } String subjectUri = document.getEntityId().getIri(); // probably // construct the // URI from // Vocabulary Resource subject = this.rdfWriter.getUri(subjectUri); if ((this.tasks & (RdfSerializer.TASK_ALL_EXACT_DATA | RdfSerializer.TASK_SIMPLE_STATEMENTS)) != 0) { this.rdfWriter.writeTripleValueObject(subject, RdfWriter.RDF_TYPE, RdfWriter.WB_ITEM); } writeDocumentTerms(subject, document); if (hasTask(RdfSerializer.TASK_SIMPLE_STATEMENTS)) { writeSimpleStatements(subject, document); } if (hasTask(RdfSerializer.TASK_STATEMENTS)) { writeStatements(subject, document); } writeSiteLinks(subject, document.getSiteLinks()); this.snakRdfConverter.writeAuxiliaryTriples(); this.owlDeclarationBuffer.writePropertyDeclarations(this.rdfWriter, hasTask(RdfSerializer.TASK_STATEMENTS), hasTask(RdfSerializer.TASK_SIMPLE_STATEMENTS)); this.referenceRdfConverter.writeReferences(); }
/** * Prints the current status, time and entity count. */ public void printStatus() { System.out.println("Found " + this.itemsWithPropertyCount + " matching items after scanning " + this.itemCount + " items."); if (this.largestNumberValue != null) { System.out.println("The item with the greatest number is: " + this.largestNumberItemLabel + " (" + this.largestNumberItem.getId() + ") with number " + this.largestNumberValue); } else { System.out.println("No number with a specified value found yet."); } }
/** * Prints the current status, time and entity count. */ public void printStatus() { System.out.println("Found " + this.itemsWithPropertyCount + " matching items after scanning " + this.itemCount + " items."); if (this.largestNumberValue != null) { System.out.println("The item with the greatest number is: " + this.largestNumberItemLabel + " (" + this.largestNumberItem.getId() + ") with number " + this.largestNumberValue); } else { System.out.println("No number with a specified value found yet."); } }