Related
I need a mongo DB query as well as corresponding java code for the query using aggregation framework for the below mentioned scenario,
Scenario is :
I need to search an array for "seqNo": 4 based on "aC","aI","aN","aT","bID","pD" from collection A.
Please find the collection mentioned below,
Collection A:
/*1*/
{
"_id" : ObjectId("6398b904aa0c28d6193bb853"),
"aC" : "AB",
"aI" : "ABCD",
"aN" : "040000000002",
"aT" : "CA",
"bID" : NumberLong(0),
"pD" : "2019-04-19",
"timeToLive" : ISODate("2019-04-19T00:00:00.000Z"),
"transactions" : [
{
"amt" : NumberDecimal("-12.340"),
"seqNo" : 2,
"valDt" : "2022-10-04"
},
{
"amt" : NumberDecimal("-6.800"),
"seqNo" : 5,
"valDt" : "2022-10-04"
}
]
}
/*2*/
{
"_id" : ObjectId("5d42daa7decf182710080d46"),
"aC" : "AB",
"aI" : "ABCD",
"aN" : "040000000002",
"aT" : "CA",
"bID" : NumberLong(1),
"pD" : "2019-04-19",
"timeToLive" : ISODate("2019-04-19T00:00:00.000Z"),
"transactions" : [
{
"seqNo" : 4,
"amt" : NumberDecimal("26074.000"),
"valDt" : "2019-04-19"
},
{
"seqNo" : 3,
"amt" : NumberDecimal("26074.000"),
"valDt" : "2019-04-19"
}
]
}
Please help me with the query it will be really helpful if explained in detail.
Thanks in advance.
To kick off the answer we will start with the mongo CLI (javascript) because it outlines what we are going to do later in Java.
db.foo.aggregate([
{$match: {"aC": val_aC, "aI": val_aI}},
{$project: {transaction: {$arrayElemAt: [ {$filter: {
input: "$transactions",
cond: {$eq:["$$this.seqNo",4]}
}}, 0] }
}},
{$match: {transaction: {$exists: true}}}
]);
Java is always a little more verbose than python or javascript but here is how I do it. Because my editor matches braces and brackets, I find it easier to construct the query as JSON and then convert it into the required pipeline of Document objects.
import com.mongodb.client.MongoClient;
import com.mongodb.client.MongoClients;
import com.mongodb.client.ClientSession;
import com.mongodb.client.MongoDatabase;
import com.mongodb.client.MongoCollection;
import com.mongodb.client.MongoCursor;
import com.mongodb.client.AggregateIterable;
import org.bson.*;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.List;
import java.util.Date;
import java.text.SimpleDateFormat;
import java.util.Map;
import java.util.HashMap;
import java.math.BigDecimal;
public class agg4 {
private MongoClient mongoClient;
private MongoDatabase db;
private MongoCollection<Document> coll;
private static class StageHelper {
private StringBuilder txt;
public StageHelper() {
this.txt = new StringBuilder();
}
public void add(String expr, Object ... subs) {
expr.replace("'", "\""); // This is the helpful part.
if(subs.length > 0) {
expr = String.format(expr, subs); // this too
}
txt.append(expr);
}
public Document fetch() {
return Document.parse(txt.toString());
}
}
private List<Document> makePipeline() {
List<Document> pipeline = new ArrayList<Document>();
StageHelper s = new StageHelper();
// It is left as an exercise to add all the other individual fields
// that need to be matched and properly pass them in, etc.
String val_aC = "AB";
String val_aI = "ABCD";
s.add(" {'$match': {'aC':'%s','aI':'%s'}}", val_aC, val_aI );
pipeline.add(s.fetch());
s = new StageHelper();
// This is the meat. Find seqNo = 4. Since I suspect seqNo is
// unique, it does no extra good to filter the array to just an array
// array of one; changing the array of 1 (if found of course) to a
// *single* object has more utility, hence use of $arrayElemAt:
s.add(" {'$project': {'transaction': {'$arrayElemAt': [ ");
s.add(" {'$filter': {'input': '$transactions', ");
s.add(" 'cond': {'$eq':['$$this.seqNo', 4]} ");
s.add(" }}, 0]} ");
s.add(" }}");
pipeline.add(s.fetch());
s = new StageHelper();
// If seqNo = 4 could not be found, transaction will be unset so
// use the following to exclude that doc.
s.add(" {'$match': {'transaction': {'$exists': true}}} ");
pipeline.add(s.fetch());
return pipeline;
}
private void doAgg() {
try {
List<Document> pipeline = makePipeline();
AggregateIterable<Document> output = coll.aggregate(pipeline);
MongoCursor<Document> iterator = output.iterator();
while (iterator.hasNext()) {
Document doc = iterator.next();
}
} catch(Exception e) {
System.out.println("some fail: " + e);
}
}
public static void main(String[] args) {
(new agg4()).go(args);
}
public void go(String[] args) {
try {
Map params = new HashMap();
String host = "mongodb://localhost:37017/?replicaSet=rs0";
String dbname = "testX";
String collname = "foo";
mongoClient = MongoClients.create(host);
db = mongoClient.getDatabase(dbname);
coll = db.getCollection(collname, Document.class);
doAgg();
} catch(Exception e) {
System.out.println("epic fail: " + e);
e.printStackTrace();
}
}
If you are using Java 13 or higher, text blocks for String make it even easier:
String s = """
{'$project': {'transaction': {'$arrayElemAt': [
{'$filter': {'input': '$transactions',
'cond': {'$eq':['$$this.seqNo', 4]}
}}, 0]}
}}
""";
pipeline.add(s.fetch());
I am making an app in angular nativescript, I am using web services, but when I try to do a http request in Android 4, it throws this error. But when I do it on Android 9, there are no errors and it makes the insert.
app.module.ts
import { NgModule, NO_ERRORS_SCHEMA } from "#angular/core";
import { NativeScriptModule, NativeScriptHttpClientModule, NativeScriptFormsModule } from "#nativescript/angular";
import { NgShadowModule } from 'nativescript-ng-shadow';
import { AppRoutingModule } from "./app-routing.module";
import { AppComponent } from "./app.component";
import { LoginComponent } from './components/login/login.component';
import { HeaderComponent } from './components/partials/header/header.component';
import { FooterComponent } from './components/partials/footer/footer.component';
import { IndexComponent } from './components/index/index.component';
import { RegistrarComponent } from './components/registrar/registrar.component';
#NgModule({
bootstrap: [
AppComponent
],
imports: [
NativeScriptModule,
AppRoutingModule,
NativeScriptHttpClientModule,
NgShadowModule,
NativeScriptFormsModule
],
declarations: [
AppComponent,
LoginComponent,
HeaderComponent,
FooterComponent,
IndexComponent,
RegistrarComponent,
],
providers: [],
schemas: [
NO_ERRORS_SCHEMA
]
})
/*
Pass your application module to the bootstrapModule function located in main.ts to start your app
*/
export class AppModule { }
service
post(url: string, body: Object): Observable<any> {
return this.http.post(this.apiUrl() + url, JSON.stringify(body), { headers: this.getHeaders() })
.pipe(catchError(function (error: any) {
return throwError(error || 'Server error');
}));
}
app.gradle
android {
defaultConfig {
minSdkVersion 17
generatedDensities = []
flavorDimensions "versionCode"
}
aaptOptions {
additionalParameters "--no-version-vectors"
}
}
Thanks for your time
Try to this:- Add HttpClientModule In App Module.
import { NgModule, NO_ERRORS_SCHEMA } from "#angular/core";
import { NativeScriptModule, NativeScriptHttpClientModule,
NativeScriptFormsModule } from "#nativescript/angular";
import { NgShadowModule } from "nativescript-ng-shadow";
import { AppRoutingModule } from "./app-routing.module";
import { AppComponent } from "./app.component";
import { LoginComponent } from './components/login/login.component';
import { HeaderComponent } from
'./components/partials/header/header.component';
import { FooterComponent } from
'./components/partials/footer/footer.component';
import { IndexComponent } from './components/index/index.component';
import { RegistrarComponent } from
'./components/registrar/registrar.component';
import { HttpClientModule } from "#angular/common/http";
#NgModule({
bootstrap: [
AppComponent
],
imports: [
NativeScriptModule,
AppRoutingModule,
NativeScriptHttpClientModule,
NgShadowModule,
HttpClientModule,
NativeScriptFormsModule
],
declarations: [
AppComponent,
LoginComponent,
HeaderComponent,
FooterComponent,
IndexComponent,
RegistrarComponent,
],
providers: [],
schemas: [
NO_ERRORS_SCHEMA
]
})
/*
Pass your application module to the bootstrapModule function located in
main.ts to start your app
*/
export class AppModule { }
And Add One Line In AndroidManifest.xml File:-
<application
android:usesCleartextTraffic="true">
File Location:- App_Resource->Android->src->main
Make a sample Java service which takes the following json from an endpoint as input, parses it
and puts it into the database.
Input: The input will have a fixed format which will be posted as a content body to the endpoint.
Output: The output should be a number of rows that are filled in the database or error in case of failures.
Sample input :
{
"quiz": {
"sport": {
"q1": {
"question": "Which one is correct team name in NBA?",
"options": [
"New York Bulls",
"Los Angeles Kings",
"Golden State Warriros",
"Huston Rocket"
],
"answer": "Huston Rocket"
}
},
"maths": {
"q1": {
"question": "5 + 7 = ?",
"options": [
"10",
"11",
"12",
"13"
],
"answer": "12"
},
"q2": {
"question": "12 - 8 = ?",
"options": [
"1",
"2",
"3",
"4"
],
"answer": "4"
}
}
}
}
I've created a basic Rest service with springboot that takes in question, options and answer as input, and also displays it in the same way.
Ex. input :
{
"question": "khis is the question part",
"options": [
"option 1",
"option 2",
"option 3",
"option 4"
],
"answer": "option 1"
}
I have created a springboot project and created the following java classes:
1. QuestionSet.java
package com.example.demo.questionset;
import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonRootName;
public class QuestionSet {
private String question;
private String options[];
private String answer;
public QuestionSet() {
}
public QuestionSet(String question, String[] options, String answer) {
super();
this.question = question;
this.options = options;
this.answer = answer;
}
public String getQuestion() {
return question;
}
public String[] getOptions() {
return options;
}
public String getAnswer() {
return answer;
}
public void setQuestion(String question) {
this.question = question;
}
public void setOptions(String[] options) {
this.options = options;
}
public void setAnswer(String answer) {
this.answer = answer;
}
}
`
QuestionSetService.java
package com.example.demo.questionset;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.ObjectWriter;
#Service
public class QuestionSetService {
String nameString[] = {"kabir", "ram", "shyam", "varun"};
QuestionSetController.java
package com.example.demo.questionset;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.fasterxml.jackson.annotation.JsonGetter;
#RestController
public class QuestionSetController {
#Autowired
QuestionSetService questionSetService;
#RequestMapping("/questionsets")
public List<QuestionSet> getAllQuestionSets(){
return questionSetService.getAllQuestionSets();
}
#RequestMapping("/questionsets/{question}")
public QuestionSet getQuestionSetByQuestion(#PathVariable String question)
{
return questionSetService.getQuestionSetByQuestion(question);
}
#PostMapping("/questionsets")
public void postController(
#RequestBody QuestionSet questionSet) {
questionSetService.addQuestionSet(questionSet);
}
}
private List<QuestionSet> questionSets = null;
public List<QuestionSet> getAllQuestionSets() {
return questionSets;
}
public QuestionSet getQuestionSetByQuestion(String question) {
return questionSets.stream().filter(t ->
t.getQuestion().equals(question)).findFirst().get();
}
public ResponseEntity addQuestionSet( QuestionSet questionSet) {
questionSets.add(questionSet);
return ResponseEntity.ok(HttpStatus.OK);
}
}
I can take in simple json input in the form of questionset but the required json input is much more complex. I understand that I need to make wrapper classes and use objectmapper, but I don't know how.
JSONObject obj = (JSONObject) parser.parse(reader);
JSONObject response =(JSONObject) parser.parse(obj.get("quiz").toString());
JSONObject sub =(JSONObject) parser.parse(response.get("sport").toString());
JSONObject q1 = (JSONObject) parser.parse(sub.get("q1").toString());
String question =(q1.get("question").toString());
System.out.println(question);
JSONArray options = (JSONArray)parser.parse(q1.get("options").toString());
for(int i=0 ;i<options.size();i++) {
System.out.println(options.get(i));
}
Output :-
Which one is correct team name in NBA?
New York Bulls
Los Angeles Kings
Golden State Warriros
Huston Rocket
This is a sample on how you can parse the input json using simple-json. Although there is a lot of manual work here, you can avoid it by using nested JSONArray and iterate over it.
I am creating a mod but the texture of a block (the only one) loads only in the inventory and when it gets dropped, hope you can help me, I'm using the 1.8 MDK.
Blockstates:
{
"variants"": {
"normal": {"model": "horsenexus:horse_block"},
}
}
Models, block:
{
"parent": "block/cube_all",
"textures": {
"down": "horsenexus:blocks/horse_block_down",
"up": "horsenexus:blocks/horse_block_top",
"north": "horsenexus:blocks/horse_block_north",
"east": "horsenexus:blocks/horse_block_east",
"south": "horsenexus:blocks/horse_block_south",
"west": "horsenexus:blocks/horse_block_west"
}
}
Models, item:
{
"parent": "horsenexus:block/horse_block",
"display": {
"thirdperson": {
"rotation": [ 10, -45, 170 ],
"translation": [ 0, 1.5, -2.75 ],
"scale": [ 0.375, 0.375, 0.375 ]
}
}
}
And the codes:
package com.crazyhoorse961.core.blocks;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.MinecraftForge;
public class HorseBlock extends Block{
public HorseBlock(Material materialIn) {
super(materialIn);
this.setHardness(5.6F);
this.setResistance(56.34F);
this.setStepSound(this.soundTypeSnow);
}
}
And the last one:
package com.crazyhoorse961.core.init;
import com.crazyhoorse961.core.Reference;
import com.crazyhoorse961.core.blocks.HorseBlock;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.registry.GameRegistry;
public class Horse_Block {
public static Block horse_block;
public static void init()
{
horse_block = new HorseBlock(Material.clay).setUnlocalizedName("horse_block");
}
public static void register()
{
GameRegistry.registerBlock(horse_block, horse_block.getUnlocalizedName().substring(5));
}
public static void registerRenders()
{
registerRender(horse_block);
}
public static void registerRender(Block block)
{
Item item = Item.getItemFromBlock(block);
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Reference.MOD_ID + ":" + item.getUnlocalizedName().substring(5), "inventory"));
}
}
Thank you for trying to help me, have a good day.
Try changing the following line in your "Models, block" code
"parent": "block/cube_all",
into:
"parent": "block/cube",
As far as I'm aware 'cube_all' is only used when you use the same texture for all sides of your block.
Actually I am trying to parse schema.org Microdata from HTML source pages using a java library.I tried many sites finally I found any23 and Mf2j from github For .apache any23 I didn't find proper documentation so I left that and finally using Mf2j I build the project and I got the jar. I created a sample project to execute Mf2j to parse Microdata. Here is the sample code which I wrote.
package org.mypro;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.Map;
import java.util.Properties;
import java.util.Map.Entry;
import com.kylewm.mf2j.Mf2Parser;
public class MySample {
/**
* #param args
* #throws URISyntaxException
* #throws IOException
*/
public static void main(String[] args) throws IOException, URISyntaxException {
// TODO Auto-generated method stub
Mf2Parser parser = new Mf2Parser()
.setIncludeAlternates(true)
.setIncludeRelUrls(true);
URL server = new URL("http://blogbasics.com/examples-of-blogs/");
Properties systemProperties = System.getProperties();
systemProperties.setProperty("http.proxyHost","pp.xyz.com");
systemProperties.setProperty("http.proxyPort","1234");
HttpURLConnection connection = (HttpURLConnection)server.openConnection();
connection.connect();
Map<String,Object> parsed = parser.parse(new URI("http://blogbasics.com/examples-of-blogs/"));
for (Entry<String, Object> string : parsed.entrySet()) {
System.out.println(string.getKey() +" = "+string.getValue());
}
}
}
But I got output like this. I got ly image URL's but I need all Microdata metadata.
rels = {"Icon":["http://blogbasics.com/wp-content/uploads/cropped-Blog-Basics-favicon.png"],"Shortcut":["http://blogbasics.com/wp-content/uploads/cropped-Blog-Basics-favicon.png"],"apple-touch-icon-precomposed":["http://blogbasics.com/wp-content/uploads/apple-touch-icon-144x144.png","http://blogbasics.com/wp-content/uploads/apple-touch-icon-114x114.png","http://blogbasics.com/wp-content/uploads/apple-touch-icon-72x72.png","http://blogbasics.com/wp-content/uploads/apple-touch-icon-57x57.png"],"canonical":["http://blogbasics.com/examples-of-blogs/"],"external":["http://blogbasics.com","http://allisondduncan.com","http://www.kuldipsonsjewellers.com/Earring.html","http://jin6000.tumblr.com/","http://ckckarate.com","http://www.ferrypress.com/profile.php?u=Herman1879"],"nofollow":["http://bit.ly/1EQF6HG","https://curlcentric.leadpages.net/leadbox/14581e773f72a2%3A12e927026b46dc/5758142528880640/","http://blogbasics.com/examples-of-blogs/#comment-261","http://blogbasics.com","http://blogbasics.com/examples-of-blogs/#comment-262","http://allisondduncan.com","http://blogbasics.com/examples-of-blogs/#comment-270","http://blogbasics.com/examples-of-blogs/#comment-736","http://www.kuldipsonsjewellers.com/Earring.html","http://blogbasics.com/examples-of-blogs/#comment-1407","http://blogbasics.com/examples-of-blogs/#comment-3036","http://blogbasics.com/examples-of-blogs/#comment-5682","http://blogbasics.com/examples-of-blogs/#comment-6877","http://blogbasics.com/examples-of-blogs/#comment-8615","http://jin6000.tumblr.com/","http://blogbasics.com/examples-of-blogs/#comment-8684","http://ckckarate.com","http://blogbasics.com/examples-of-blogs/#comment-18326","http://www.ferrypress.com/profile.php?u=Herman1879","http://blogbasics.com/examples-of-blogs/#comment-22883","http://blogbasics.com/examples-of-blogs/#comment-26672","http://blogbasics.com/examples-of-blogs/#respond","http://www.blogbasics.com","http://www.blogbasics.com/privacy","http://www.blogbasics.com/terms-conditions/","http://www.blogbasics.com/contact/"],"publisher":["https://www.google.com/+Blogbasics"],"stylesheet":["http://blogbasics.com/wp-content/themes/tru/style.css?v=1427736009&ver=2.1.3","http://fonts.googleapis.com/css?family=Open+Sans%3A300%2C400italic%2C400%2C600%2C700%7CRokkitt&ver=1.5","http://optinskin.com/src-4/min/normalize.min.css?ver=4.3","http://blogbasics.com/wp-content/plugins/OptinSkin/skins/1/style.css?ver=4.3","http://blogbasics.com/wp-content/themes/tru/includes/lib/spyr_slidingshare/style.css?ver=0.9.3"]}
items = []
rel-urls = {"http://allisondduncan.com":{"rels":["external","nofollow"],"text":"Allison Duncan"},"http://bit.ly/1EQF6HG":{"rels":["nofollow"]},"http://blogbasics.com":{"rels":["external","nofollow"],"text":"Paul Odtaa"},"http://blogbasics.com/examples-of-blogs/":{"rels":["canonical"]},"http://blogbasics.com/examples-of-blogs/#comment-1407":{"rels":["nofollow"],"text":"Reply"},"http://blogbasics.com/examples-of-blogs/#comment-18326":{"rels":["nofollow"],"text":"Reply"},"http://blogbasics.com/examples-of-blogs/#comment-22883":{"rels":["nofollow"],"text":"Reply"},"http://blogbasics.com/examples-of-blogs/#comment-261":{"rels":["nofollow"],"text":"Reply"},"http://blogbasics.com/examples-of-blogs/#comment-262":{"rels":["nofollow"],"text":"Reply"},"http://blogbasics.com/examples-of-blogs/#comment-26672":{"rels":["nofollow"],"text":"Reply"},"http://blogbasics.com/examples-of-blogs/#comment-270":{"rels":["nofollow"],"text":"Reply"},"http://blogbasics.com/examples-of-blogs/#comment-3036":{"rels":["nofollow"],"text":"Reply"},"http://blogbasics.com/examples-of-blogs/#comment-5682":{"rels":["nofollow"],"text":"Reply"},"http://blogbasics.com/examples-of-blogs/#comment-6877":{"rels":["nofollow"],"text":"Reply"},"http://blogbasics.com/examples-of-blogs/#comment-736":{"rels":["nofollow"],"text":"Reply"},"http://blogbasics.com/examples-of-blogs/#comment-8615":{"rels":["nofollow"],"text":"Reply"},"http://blogbasics.com/examples-of-blogs/#comment-8684":{"rels":["nofollow"],"text":"Reply"},"http://blogbasics.com/examples-of-blogs/#respond":{"rels":["nofollow"],"text":"Cancel reply"},"http://blogbasics.com/wp-content/plugins/OptinSkin/skins/1/style.css?ver=4.3":{"media":"all","rels":["stylesheet"],"type":"text/css"},"http://blogbasics.com/wp-content/themes/tru/includes/lib/spyr_slidingshare/style.css?ver=0.9.3":{"media":"all","rels":["stylesheet"],"type":"text/css"},"http://blogbasics.com/wp-content/themes/tru/style.css?v=1427736009&ver=2.1.3":{"media":"all","rels":["stylesheet"],"type":"text/css"},"http://blogbasics.com/wp-content/uploads/apple-touch-icon-114x114.png":{"rels":["apple-touch-icon-precomposed"]},"http://blogbasics.com/wp-content/uploads/apple-touch-icon-144x144.png":{"rels":["apple-touch-icon-precomposed"]},"http://blogbasics.com/wp-content/uploads/apple-touch-icon-57x57.png":{"rels":["apple-touch-icon-precomposed"]},"http://blogbasics.com/wp-content/uploads/apple-touch-icon-72x72.png":{"rels":["apple-touch-icon-precomposed"]},"http://blogbasics.com/wp-content/uploads/cropped-Blog-Basics-favicon.png":{"rels":["Shortcut","Icon"],"type":"image/x-icon"},"http://ckckarate.com":{"rels":["external","nofollow"],"text":"Ed JP"},"http://fonts.googleapis.com/css?family=Open+Sans%3A300%2C400italic%2C400%2C600%2C700%7CRokkitt&ver=1.5":{"media":"all","rels":["stylesheet"],"type":"text/css"},"http://jin6000.tumblr.com/":{"rels":["external","nofollow"],"text":"Edward Carty"},"http://optinskin.com/src-4/min/normalize.min.css?ver=4.3":{"media":"all","rels":["stylesheet"],"type":"text/css"},"http://www.blogbasics.com":{"rels":["nofollow"],"text":"Blog Basics"},"http://www.blogbasics.com/contact/":{"rels":["nofollow"],"text":"Contact"},"http://www.blogbasics.com/privacy":{"rels":["nofollow"],"text":"Privacy Policy"},"http://www.blogbasics.com/terms-conditions/":{"rels":["nofollow"],"text":"Terms and Conditions"},"http://www.ferrypress.com/profile.php?u=Herman1879":{"rels":["external","nofollow"],"text":"hgh xl"},"http://www.kuldipsonsjewellers.com/Earring.html":{"rels":["external","nofollow"],"text":"Jewellery Shop in Ranchi"},"https://curlcentric.leadpages.net/leadbox/14581e773f72a2%3A12e927026b46dc/5758142528880640/":{"rels":["nofollow"],"text":"(Click Here)"},"https://www.google.com/+Blogbasics":{"rels":["publisher"]}}
Actually I need output in this form, not in json format. I need data content like this. I found this using JavaScript Microdata Parser from http://foolip.org/microdatajs/live/ but I need same kind of parser in java. Please suggest me. Thanks
"type": [ "http://schema.org/WebPage" ], "properties": { "mainContentOfPage": [ { "type": [ "http://schema.org/Blog" ], "properties": { "blogPost": [ { "type": [ "http://schema.org/BlogPosting" ], "properties": { "headline": [ "Examples of Blogs" ], "author": [ { "type": [ "http://schema.org/Person" ], "properties": { "name": [ "Kenneth Byrd" ] } } ],
Read more: http://foolip.org/microdatajs/live/#ixzz3lJJII7g0