Questions tagged [jsoniq]
JSONiq is a query and processing language specifically designed for the popular JSON data model.
36
questions
1
vote
3
answers
92
views
Remove duplicates in an object in JSONiq
This is an example object that I got:
{ "query1" : [ { "name" : "John", "id" : 1234 }, { "name" : "Rose", "id" : 3214 }, { "...
0
votes
1
answer
36
views
Storing an object with key value pairs in a variable in JSONiq
This is a sample JSON array
"transcript":[
{
"dcode": "CS",
"cno": 211,
"ssn": 82,
"grade": "...
1
vote
1
answer
81
views
How to write the program in JSONiq if the table is empty?
let $query_a := (for $st in $student
where
(some $t in $transcript
satisfies ($t.ssn = $st.ssn and $t.dcode = "CS" and $t.cno = 530))
return {ssn: ...
0
votes
1
answer
61
views
How do I fix the Jsoniq static error: invalid expression: syntax error, unexpected "every"?
I am performing this query to see if there is any multimedia software packages available in this pretend database
let $swpackages := [
{"name": "flimber", "version": ...
1
vote
1
answer
84
views
Performing joins in JSONiq (e.g., with the filter syntax)
I'm fairly new to JSONiq and I need help with writing a join using a filter.
Let's say I have two collections, $C1 and $C2
I want to find (join/filter) all of the items in $C2 by matching ID between $...
1
vote
1
answer
826
views
JSON not being able to compile due to : Expecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '[', got 'undefined'
So I have written a JSON file code to be able to help display the
title of books but when I compile I kept getting this same error, is
there a way for the fix or am I doing something wrong?
The code ...
-1
votes
2
answers
224
views
First Order Logic translation
Use the following definitions to represent English statements as first-order formulas.
Define:
● 𝐶 - is a set of companies
● 𝐼 - is a set of investors
● 𝐼𝐶𝑁 = {(𝑖, 𝑐, 𝑛) | (𝑖, 𝑐, 𝑛) ∈ 𝐼 × �...
0
votes
1
answer
65
views
Are the JSONiq documentation code snippets valid?
I was trying some examples from the JSONiq document, but it throws error for some of the snippets from the document.
I have installed jsoniq (version 0.0.8) using npm.
Tutorial/Document link
Example :
...
0
votes
1
answer
151
views
JSONiq - how do you convert an array to a sequence?
Using the JSONiq to JavaScript implementation of JSONiq, say I have an array
let $a := [1,2,3]
I'd like to get the elements as a sequence, but all of these return the array itself -
return $a()
...
2
votes
5
answers
2k
views
advanced JSON query language
I've explored couple of existing JSON query language such JMESPath, JsonPath and JSONiq. Unfortunately, none of them seem to be able to support my use case in a generic way.
Basically, I'm receiving ...
0
votes
1
answer
141
views
Array and object lookups in JSONiq
I'm currently working on improving JSON querying capabilities with Brackit[1] and [2], which is an XQuery engine with additional arrays and "records". I'm now basically following the same XDM as ...
2
votes
1
answer
99
views
Fetching JSON data with JSONiq
Let be those two simple JSON files
jsoniq version "1.0";
let $tweets :=
{
{ "screen_name": "ifp_tuebingen"
},
{ "screen_name": "ifp_tuebingen"
},
{ "screen_name": ...
1
vote
1
answer
102
views
Does JSONiq support processing XML?
I've seen statements that JSONiq query language also supports processing XM, but the only example I found is in the JSONiq Wikipedia article. It looks like XML processing is only possible with the "...
1
vote
1
answer
428
views
How to use JSONiq for JSON
The question is to write a JSONiq FLWOR expression that can display the name of the products which their price are at least 3.
I have tried the answers provided on How to run JSONiq from JSON with ...
2
votes
2
answers
513
views
How to run JSONiq from JSON with try.zorba.io
I need to write a JSONiq expression that lists only the name of the products that cost at least 3. This is my JSON file which i had typed in the XQuery section:
{ "supermarket_visit":{
"date"...
1
vote
1
answer
145
views
Zorba with more than just a filesystem
Is it possible to use Zorba (and xquery/jsoniq) to query documents stored in something other than a filesystem? I saw a slidedeck from 28msec and others that suggested they had done this, but I wasn't ...
1
vote
2
answers
630
views
access object in an object array in jsoniq
New to JSONIQ,and using zorba what I want to do so far is to extract some information from an indexed object in an object array in JSONIQ. Here's the code so far.
jsoniq version "1.0";
let $...
1
vote
2
answers
578
views
How do I import a JSON file into a JSONiq collection?
I have looked everywhere, and even the JSONiq documentation says "this is beyond the scope of this document." I have a JSON file (an array of JSON objects) I want to import into JSONiq (particularly ...
1
vote
1
answer
144
views
JSONiq console.log or print
Is it possible to print to console for debugging purposes in a JSONiq/Zorba script?
e.g.
declare function utils:lowerCaseKey($obj as item) as item{
print($obj)
{|
for $k in distinct-...
1
vote
1
answer
41
views
JSONiq with Zorba HMAC
I'm running the following code using the fcavalieri/zorba docker image. hmac:compute("The quick brown fox jumps over the lazy dog", "key" ,"SHA256") produces: 97yD9DBThCSxMpjmqm+xQ+...
1
vote
1
answer
252
views
jsoniq - empty() function to determine if attribute is present
I use try.zorba.io
My code (simplified) is:
jsoniq version "1.0";
let $tweets :=
[
{
"id" : 1,
"user" : {
"id" : 1111,
"screen_name" : "Bobby"
...
1
vote
1
answer
461
views
JSONiq count duplicates in array
I want to count duplicate values with JSONiq. I have following code:
jsoniq version "1.0";
import module namespace fetch = "http://zorba.io/modules/fetch";
let $tweets := parse-json(fetch:content("/...
4
votes
2
answers
2k
views
JSONiq: Java implementation as library?
Looking at the implementation of the JSONiq specification (www.jsoniq.org).
Most of them are standalone deployment. e.g. Zorba, VXQuery, etc and are designed to query JSON based databases or process ...
10
votes
2
answers
1k
views
What are the differences between JSONiq and XQuery 3.1?
Both JSONiq and XQuery 3.1 extend XQuery 3.0 with support for JSON.
How do they differ?
0
votes
1
answer
77
views
MongoDB Complex Stages Query With different Results
I'm trying to find a Query Language for our product team, so they can create "red-flags" based on complex queries of a collection.
as they are not familiar with code, i've tried looking at JsonIQ ...
1
vote
2
answers
660
views
Insert into JSON using JSONiq
We are writing a JSONiq query to insert new properties into a JSON and return the updated JSON from the query.
Query:
jsoniq version "1.0";
let $users := {
"name" : "Deadbeat Jim",
"address" : "...
1
vote
1
answer
382
views
SQL Query to JSONiq Query
I want to convert an SQL query into a JSONiq Query, is there already an implementation for this, if not, what do I need to know to be able to create a program that can do this ?
1
vote
1
answer
394
views
Using Jsoniq to display some of the string in json
Can you guys teach me on how to use jsoniq to display both of the book name which is robin cruose and tom jones? i've gone through some research but no matter how i do, it's always wrong.
{
...
1
vote
1
answer
107
views
Why it returns last element only in JSONiq?
Images of my json and query
Json code
{
"reading_list": {
"book": {
"name": "Fifty shades of grey",
"author": "E.L James",
"date": "March 2015",
...
1
vote
1
answer
276
views
Transforming SOAP Output to JSON issue
I called a SOAP service and like to transform it to a JSON using XQuery but always the result said that there are error tokens:
This is the SOAP:
<soapenv:Envelope xmlns:soapenv="http://schemas....
0
votes
1
answer
1k
views
Export Google App Engine datastore as JSON using Java
I am doing a research project on the JSON JSONIQ using Google App Engine and its Datastore. The Datastore is NoSQL so it is what I need for my JSON to work, but the problem is I am not able to export ...
11
votes
6
answers
4k
views
json query that returns parent element and child data?
Given the following json:
{
"README.rst": {
"_status": {
"md5": "952ee56fa6ce36c752117e79cc381df8"
}
},
"docs/conf.py": {
"_status": {
"md5"...
1
vote
0
answers
1k
views
Decode a base64 string in xquery
We are trying to decode the encoded string in xquery.
I didnt know how to decode the string.
Following is the xquery. this basically converts xml to json and we should also need to do the decoding.
...
2
votes
2
answers
873
views
How to get all string from json document in jsoniq or javascript?
I am trying to get all the values of json string as a single string. for example
in xquery xml
let $x := <a> welcome to the world of <b> JSONiq </b></a>
return string($x)
...
2
votes
3
answers
965
views
Eliminate duplicates in array (JSONiq)
I'd like to delete duplicates in a JSONiq array.
let $x := [1, 2, 4 ,3, 3, 3, 1, 2, 5]
How can I eliminate the duplicates in $x?
0
votes
2
answers
280
views
Large json file transformation via code or not
after trying to work with mongoDB , and finding out that it dosn't work with documents that are larger the 16 mega .
i need to find way to load large complex json file ( i guess to memory ) .
and to ...