Questions tagged [jsoniq]

JSONiq is a query and processing language specifically designed for the popular JSON data model.

JSONiq is a query and functional programming language that is designed to declaratively query and transform collections of hierarchical and heterogeneous data in format of JSON, XML, as well as unstructured, textual data.

JSONiq is an open specification published under the Creative Commons Attribution-ShareAlike 3.0 license. It is based on the XQuery language, with which it shares the same core expressions and operations on atomic types. JSONiq comes in two syntactical flavors, which both support JSON and XML natively.

  • The JSONiq syntax (a superset of JSON) extended with XML support through a compatible subset of XQuery.
  • The XQuery syntax (native XML support) extended with JSON support through a compatible subset (the JSONiq extension to XQuery) of the above JSONiq syntax.

Main website: http://www.jsoniq.org

(Source)

36 questions
11
votes
6 answers

json query that returns parent element and child data?

Given the following json: { "README.rst": { "_status": { "md5": "952ee56fa6ce36c752117e79cc381df8" } }, "docs/conf.py": { "_status": { "md5": "6e9c7d805a1d33f0719b14fe28554ab1" } …
thebjorn
  • 26,297
  • 11
  • 96
  • 138
10
votes
2 answers

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?
Ghislain Fourny
  • 6,971
  • 1
  • 30
  • 37
4
votes
2 answers

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 large JSON documents. I am surprised to find all…
kiran
  • 223
  • 4
  • 12
2
votes
1 answer

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: $st.ssn, name: $st.name, major: $st.major, status:…
Sandhya
  • 21
  • 1
2
votes
5 answers

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 different type of responses from different web…
mathpaquette
  • 406
  • 4
  • 16
2
votes
1 answer

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": "ifp_reutlingen" } } let $users := …
aniani2020
  • 143
  • 1
  • 8
2
votes
2 answers

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":"08032019", "bought":[ …
Master Irfan Elahee
  • 165
  • 1
  • 1
  • 14
2
votes
2 answers

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 := welcome to the world of JSONiq return string($x) will return welcome to the world of JSONiq what is the equvalent result of…
Prakash Thapa
  • 1,285
  • 14
  • 27
2
votes
3 answers

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?
konze
  • 859
  • 2
  • 11
  • 30
1
vote
3 answers

Remove duplicates in an object in JSONiq

This is an example object that I got: { "query1" : [ { "name" : "John", "id" : 1234 }, { "name" : "Rose", "id" : 3214 }, { "name" : "John", "id" : 1234 } ] } How can I remove the duplicates using group by and array navigation / unboxing? I tried…
prav
  • 33
  • 5
1
vote
1 answer

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 $C1 and $C2 but since $C1 is a collection, i can't…
1
vote
1 answer

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 is below: jsoniq version "1.0"; let $file: = { …
KeKDee
  • 43
  • 5
1
vote
1 answer

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 "JSONiq extension to XQuery" but this is not the…
Jakob
  • 3,570
  • 3
  • 36
  • 49
1
vote
1 answer

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 try.zorba.io but that's not the answers that i…
dsong98
  • 15
  • 2
1
vote
1 answer

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 sure how. I didn't know if they used 3rd party…
Woodsman
  • 901
  • 21
  • 61
1
2 3