@Test public void testPropertyDocumentToJson() { PropertyDocument pd = Datamodel.makePropertyDocument( Datamodel.makeWikidataPropertyIdValue("P1"), Collections. emptyList(), Collections. emptyList(), Collections. emptyList(), Collections. emptyList(), Datamodel.makeDatatypeIdValue(DatatypeIdValue.DT_ITEM)); String json = "{\"id\":\"P1\",\"aliases\":{},\"labels\":{},\"descriptions\":{},\"claims\":{},\"type\":\"property\", \"datatype\":\"wikibase-item\"}"; JsonComparator.compareJsonStrings(json, JsonSerializer.getJsonString(pd)); }
public static String getJsonString(ItemDocument itemDocument) { return jacksonObjectToString(itemDocument); }
JsonSerializer implements EntityDocumentDumpProcessor { public static String getJsonString(ItemDocument itemDocument) { return jacksonObjectToString(itemDocument); } }
JsonSerializer implements EntityDocumentDumpProcessor { public static String getJsonString(ItemDocument itemDocument) { return jacksonObjectToString(itemDocument); } JsonSerializer(OutputStream outputStream); }
JsonSerializer implements EntityDocumentDumpProcessor { public static String getJsonString(ItemDocument itemDocument) { return jacksonObjectToString(itemDocument); } JsonSerializer(OutputStream outputStream); @Override void open(); @Override void processItemDocument(ItemDocument itemDocument); @Override void processPropertyDocument(PropertyDocument propertyDocument); @Override void processLexemeDocument(LexemeDocument lexemeDocument); @Override void processMediaInfoDocument(MediaInfoDocument mediaInfoDocument); @Override void close(); int getEntityDocumentCount(); static String getJsonString(ItemDocument itemDocument); static String getJsonString(PropertyDocument propertyDocument); static String getJsonString(MediaInfoDocument mediaInfoDocument); static String getJsonString(Statement statement); }
JsonSerializer implements EntityDocumentDumpProcessor { public static String getJsonString(ItemDocument itemDocument) { return jacksonObjectToString(itemDocument); } JsonSerializer(OutputStream outputStream); @Override void open(); @Override void processItemDocument(ItemDocument itemDocument); @Override void processPropertyDocument(PropertyDocument propertyDocument); @Override void processLexemeDocument(LexemeDocument lexemeDocument); @Override void processMediaInfoDocument(MediaInfoDocument mediaInfoDocument); @Override void close(); int getEntityDocumentCount(); static String getJsonString(ItemDocument itemDocument); static String getJsonString(PropertyDocument propertyDocument); static String getJsonString(MediaInfoDocument mediaInfoDocument); static String getJsonString(Statement statement);  }