/** * Creates an object to modify data on a Wikibase site. The API is used to * request the changes. The site URI is necessary since it is not contained * in the data retrieved from the API. * * @param connection * {@link ApiConnection} Object to send the requests * @param siteIri * the URI identifying the site that is accessed (usually the * prefix of entity URIs), e.g., * "http://www.wikidata.org/entity/" */ public WbEditingAction(ApiConnection connection, String siteIri) { this.connection = connection; this.siteIri = siteIri; this.mapper = new DatamodelMapper(siteIri); }
/** * Creates an object to fetch data from the given ApiConnection. The site * URI is necessary since it is not contained in the data retrieved from the * API. * * @param connection * {@link ApiConnection} Object to send the requests * @param siteIri * the URI identifying the site that is accessed (usually the * prefix of entity URIs), e.g., * "http://www.wikidata.org/entity/" */ public WbGetEntitiesAction(ApiConnection connection, String siteIri) { this.connection = connection; this.siteIri = siteIri; this.mapper = new DatamodelMapper(siteIri); }
/** * Creates an object to fetch data from the given ApiConnection. The site * URI is necessary since it is not contained in the data retrieved from the * API. * * @param connection * {@link ApiConnection} Object to send the requests * @param siteIri * the URI identifying the site that is accessed (usually the * prefix of entity URIs), e.g., * "http://www.wikidata.org/entity/" */ public WbGetEntitiesAction(ApiConnection connection, String siteIri) { this.connection = connection; this.siteIri = siteIri; this.mapper = new DatamodelMapper(siteIri); }
/** * Creates an object to modify data on a Wikibase site. The API is used to * request the changes. The site URI is necessary since it is not contained * in the data retrieved from the API. * * @param connection * {@link ApiConnection} Object to send the requests * @param siteIri * the URI identifying the site that is accessed (usually the * prefix of entity URIs), e.g., * "http://www.wikidata.org/entity/" */ public WbEditingAction(ApiConnection connection, String siteIri) { this.connection = connection; this.siteIri = siteIri; this.mapper = new DatamodelMapper(siteIri); }
public JsonDumpFileProcessor( EntityDocumentProcessor entityDocumentProcessor, String siteIri) { this.entityDocumentProcessor = entityDocumentProcessor; this.mapper = new DatamodelMapper(siteIri); this.documentReader = this.mapper .readerFor(EntityDocumentImpl.class) .with(DeserializationFeature.ACCEPT_EMPTY_ARRAY_AS_NULL_OBJECT); }
/** * Constructor. * * @param entityDocumentProcessor * the object that entity documents will be forwarded to * @param siteIri * the IRI of the site that the data comes from, as used in * {@link ItemIdValue#getSiteIri()} */ public WikibaseRevisionProcessor( EntityDocumentProcessor entityDocumentProcessor, String siteIri) { this.entityDocumentProcessor = entityDocumentProcessor; ObjectMapper mapper = new DatamodelMapper(siteIri); itemReader = mapper.readerFor(ItemDocumentImpl.class) .with(DeserializationFeature.ACCEPT_EMPTY_ARRAY_AS_NULL_OBJECT); propertyReader = mapper.readerFor(PropertyDocumentImpl.class) .with(DeserializationFeature.ACCEPT_EMPTY_ARRAY_AS_NULL_OBJECT); lexemeReader = mapper.readerFor(LexemeDocumentImpl.class) .with(DeserializationFeature.ACCEPT_EMPTY_ARRAY_AS_NULL_OBJECT); }
/** * Constructor. Marks the given lists of statements for being added to or * deleted from the given document, respectively. The current content of the * document is compared with the requested changes to avoid duplicates * (merging references of duplicate statements), and to avoid deletions of * statements that have changed or ceased to exist. * * @param currentDocument * the document with the current statements * @param addStatements * the list of new statements to be added * @param deleteStatements * the list of statements to be deleted */ public StatementUpdate(StatementDocument currentDocument, List<Statement> addStatements, List<Statement> deleteStatements) { this.currentDocument = currentDocument; this.toKeep = new HashMap<>(); this.toDelete = new ArrayList<>(); markStatementsForUpdate(currentDocument, addStatements, deleteStatements); this.mapper = new DatamodelMapper(currentDocument.getEntityId().getSiteIri()); }
/** * Constructor. Marks the given lists of statements for being added to or * deleted from the given document, respectively. The current content of the * document is compared with the requested changes to avoid duplicates * (merging references of duplicate statements), and to avoid deletions of * statements that have changed or ceased to exist. * * @param currentDocument * the document with the current statements * @param addStatements * the list of new statements to be added * @param deleteStatements * the list of statements to be deleted */ public StatementUpdate(StatementDocument currentDocument, List<Statement> addStatements, List<Statement> deleteStatements) { this.currentDocument = currentDocument; this.toKeep = new HashMap<>(); this.toDelete = new ArrayList<>(); markStatementsForUpdate(currentDocument, addStatements, deleteStatements); this.mapper = new DatamodelMapper(currentDocument.getEntityId().getSiteIri()); }