0
I am trying to import a JSON into Mysql, but without success
EDIT: JSON has the structure below, it is return of this wikidata sparql query. The query created a document for each tuple
{
"_id" : ObjectId("5d02f06243ced42c10bd28dc"),
"tipoLinguagem" : "http://www.wikidata.org/entity/Q9143",
"tipoLinguagemLabel" : "programming language",
"subtipoLinguagem" : "http://www.wikidata.org/entity/Q3839507",
"subtipoLinguagemLabel" : "functional programming language",
"linguagem" : "http://www.wikidata.org/entity/Q2005",
"linguagemLabel" : "JavaScript",
"wd" : "http://www.wikidata.org/entity/P127",
"wdLabel" : "owned by",
"ps" : "http://www.wikidata.org/prop/statement/P127",
"ps_Label" : "Oracle Corporation",
"isIdentifier" : "false"
}
{
"_id" : ObjectId("5d02f06243ced42c10bd28dd"),
"tipoLinguagem" : "http://www.wikidata.org/entity/Q9143",
"tipoLinguagemLabel" : "programming language",
"subtipoLinguagem" : "http://www.wikidata.org/entity/Q1993334",
"subtipoLinguagemLabel" : "interpreted language",
"linguagem" : "http://www.wikidata.org/entity/Q2005",
"linguagemLabel" : "JavaScript",
"wd" : "http://www.wikidata.org/entity/P127",
"wdLabel" : "owned by",
"ps" : "http://www.wikidata.org/prop/statement/P127",
"ps_Label" : "Sun Microsystems",
"isIdentifier" : "false"
}
{
"_id" : ObjectId("5d02f06143ced42c10bd27af"),
"tipoLinguagem" : "http://www.wikidata.org/entity/Q9143",
"tipoLinguagemLabel" : "programming language",
"subtipoLinguagem" : "http://www.wikidata.org/entity/Q3839507",
"subtipoLinguagemLabel" : "functional programming language",
"linguagem" : "http://www.wikidata.org/entity/Q2005",
"linguagemLabel" : "JavaScript",
"wd" : "http://www.wikidata.org/entity/P571",
"wdLabel" : "inception",
"ps" : "http://www.wikidata.org/prop/statement/P571",
"ps_Label" : "1995-12-04T00:00:00Z",
"isIdentifier" : "false"
}
What I need is to consult bank to bring objects like:
{
languageName: 'Javascript',
paradigms: [
function, scripting, etc
]
props: [
owned by: value,
inception: value
etc...
]
}
E também um objeto para os paradigmas
{
paradigm: functional programming
languages: javascript, curl, etc...
}
How should the tables be created? Each example I found uses a different method, and I could not with any of them.
I wanted something as simple as the mogoimport.
**I couldn’t install Workbench on Ubuntu 19.04, either by the terminal or by the store
** Does the entire JSON stand in one column? That seems very wrong...
CREATE TABLE IF NOT EXISTS lings_json(
id INT NOT NULL AUTO_INCREMENT,
json_data JSON NOT NULL,
PRIMARY KEY (`id`)
);
I think it would be useful to know what is in "Q3.json"
– Inkeliz
I edited there, you can help me?
– nanquim