public class JsonConverter extends Object
Modifier and Type | Field and Description |
---|---|
static String |
PREFIX_ITEM |
static String |
PREFIX_PROPERTY |
Constructor and Description |
---|
JsonConverter(String baseIri,
DataObjectFactory factory)
Creates a new instance of the JsonConverter.
|
Modifier and Type | Method and Description |
---|---|
ItemDocument |
convertToItemDocument(org.json.JSONObject jsonObject,
String itemIdString)
Creates an ItemDocument from the given JSON object and item id string.
|
PropertyDocument |
convertToPropertyDocument(org.json.JSONObject jsonObject,
String propertyIdString)
Creates a PropertyDocument from the given JSON object and property id
string.
|
String |
getBaseIri() |
public static final String PREFIX_ITEM
public static final String PREFIX_PROPERTY
public JsonConverter(String baseIri, DataObjectFactory factory)
ItemIdValue
.baseIri
- the base IRI to be used for entitiesfactory
- the DataObjectFactory to be used to construct objects of the
data modelpublic PropertyDocument convertToPropertyDocument(org.json.JSONObject jsonObject, String propertyIdString) throws org.json.JSONException
jsonObject
- a JSON object representing a PropertyDocumentpropertyIdString
- the string id of the property that is described in this
documentorg.json.JSONException
- if the given JSON did not have the expected formpublic ItemDocument convertToItemDocument(org.json.JSONObject jsonObject, String itemIdString) throws org.json.JSONException
jsonObject
- a JSON object representing an ItemDocumentitemIdString
- the string id of the item that is described in this documentorg.json.JSONException
- if the given JSON did not have the expected formpublic String getBaseIri()
Copyright © 2014 Wikidata Toolkit Developers. Generated from source code published under the Apache License 2.0. For more information, see the Wikidata Toolkit homepage