Based on the data provided on page 21 of the book Computer Algebra and Materials Physics, I tried to do the following testing in GAP:
gap> M1Right:=[[0,0,1,0],[1,0,0,0],[0,-1,0,0],[1/4,1/4,1/4,1]];;
gap> M2Right:=[[0,0,-1,0],[0,-1,0,0],[1,0,0,0],[0,0,0,1]];;
gap> SGGenSetAK227Right:=[M1Right,M2Right];;
gap> SGAK227Right:=AffineCrystGroupOnRight(SGGenSetAK227Right);
<matrix group with 2 generators>
gap> SGGenSet227Right:=[
> [ [ 1, 0, 0, 0 ], [ 0, -1, 0, 0 ], [ 0, 0, 1, 0 ], [ 1/4, 1/4, -7/4, 1 ] ],
> [ [ 1, 0, 0, 0 ], [ 0, 0, 1, 0 ], [ 0, -1, 0, 0 ], [ -1/4, 3/4, -3/4, 1 ] ],
> [ [ 0, 1, 0, 0 ], [ 0, 0, -1, 0 ], [ -1, 0, 0, 0 ], [ 1, -1/2, -1/2, 1 ] ],
> [ [ 1, 0, 0, 0 ], [ 0, -1, 0, 0 ], [ 0, 0, -1, 0 ], [ 0, 0, 0, 1 ] ],
> [ [ -1, 0, 0, 0 ], [ 0, -1, 0, 0 ], [ 0, 0, 1, 0 ], [ 0, 1/2, -1/2, 1 ] ],
> [ [ 1, 0, 0, 0 ], [ 0, 1, 0, 0 ], [ 0, 0, 1, 0 ], [ 1/2, 0, 1/2, 1 ] ],
> [ [ 1, 0, 0, 0 ], [ 0, 1, 0, 0 ], [ 0, 0, 1, 0 ], [ 0, 1/2, 1/2, 1 ] ],
> [ [ 1, 0, 0, 0 ], [ 0, 1, 0, 0 ], [ 0, 0, 1, 0 ], [ 0, 0, 1, 1 ] ]];;
gap> SG227Right:=AffineCrystGroup(SGGenSet227Right);
<matrix group with 8 generators>
gap> SG227Right=SGAK227Right;
true
As you can see, I've created two AffineCrystGroups using 2 and 8 generators respectively, and they are exactly the same one. Therefore, are there any feasible methods to find the minimum generators set of a specific AffineCrystGroup? In short, starting with case 2 as the starting point and obtaining the generator of case 1.
Regards,
HZ
This is not the final solution, but it is an improvement in a way and a response to Olexandr Konovalov:
MinimalGeneratingSet doesn't work in this situation:
gap> MinimalGeneratingSet(h1);
Error, no method found! For debugging hints type ?Recovery from NoMethodFound
Error, no 3rd choice method found for `MinimalGeneratingSet' on 1 arguments at /home/werner/Public/repo/github.com/gap-system/gap.git/lib/methsel2.g:249 called from
<function "HANDLE_METHOD_NOT_FOUND">( <arguments> )
called from read-eval loop at *stdin*:9
type 'quit;' to quit to outer loop
SmallGeneratingSet can only reduce to 4 generators. Based on your advice, I tried with the following trick, but only can reduce to 3 generators. In short, a set of less than three generators taken from the result given by SmallGeneratingSet cannot generate the same space group:
gap> SGGenSet227Right:=[
> [ [ 1, 0, 0, 0 ], [ 0, -1, 0, 0 ], [ 0, 0, 1, 0 ], [ 1/4, 1/4, -7/4, 1 ] ],
> [ [ 1, 0, 0, 0 ], [ 0, 0, 1, 0 ], [ 0, -1, 0, 0 ], [ -1/4, 3/4, -3/4, 1 ] ],
> [ [ 0, 1, 0, 0 ], [ 0, 0, -1, 0 ], [ -1, 0, 0, 0 ], [ 1, -1/2, -1/2, 1 ] ],
> [ [ 1, 0, 0, 0 ], [ 0, -1, 0, 0 ], [ 0, 0, -1, 0 ], [ 0, 0, 0, 1 ] ],
> [ [ -1, 0, 0, 0 ], [ 0, -1, 0, 0 ], [ 0, 0, 1, 0 ], [ 0, 1/2, -1/2, 1 ] ],
> [ [ 1, 0, 0, 0 ], [ 0, 1, 0, 0 ], [ 0, 0, 1, 0 ], [ 1/2, 0, 1/2, 1 ] ],
> [ [ 1, 0, 0, 0 ], [ 0, 1, 0, 0 ], [ 0, 0, 1, 0 ], [ 0, 1/2, 1/2, 1 ] ],
> [ [ 1, 0, 0, 0 ], [ 0, 1, 0, 0 ], [ 0, 0, 1, 0 ], [ 0, 0, 1, 1 ] ]];;
gap> SG227Right:=AffineCrystGroup(SGGenSet227Right);
<matrix group with 8 generators>
gap> SGSmallGenSet227Right:=SmallGeneratingSet(SG227Right);
[ [ [ 0, 1, 0, 0 ], [ 0, 0, -1, 0 ], [ -1, 0, 0, 0 ], [ 1, -1/2, -1/2, 1 ] ], [ [ 1, 0, 0, 0 ], [ 0, -1, 0, 0 ], [ 0, 0, 1, 0 ], [ 1/4, 1/4, -7/4, 1 ] ],
[ [ 1, 0, 0, 0 ], [ 0, 0, 1, 0 ], [ 0, -1, 0, 0 ], [ -1/4, 3/4, -3/4, 1 ] ], [ [ 1, 0, 0, 0 ], [ 0, 1, 0, 0 ], [ 0, 0, 1, 0 ], [ 1/2, 0, 1/2, 1 ] ] ]
gap> List(Combinations(SGSmallGenSet227Right,2),x -> AffineCrystGroup(x)=SG227Right);
[ false, false, false, false, false, false ]
gap> List(Combinations(SGSmallGenSet227Right,3),x -> AffineCrystGroup(x)=SG227Right);
[ true, false, false, false ]
Related
Issue
When logged in as a buyer, I am unable to see a product I should have access to. Issuing this request, /v1/me/products while passing a token for user buyer01, I see this response:
{
"Meta": {
"Facets": [],
"Page": 1,
"PageSize": 20,
"TotalCount": 0,
"TotalPages": 0,
"ItemRange": [
1,
0
],
"NextPageKey": null
},
"Items": []
}
I expect to see the product SHIRT listed in the Items array element.
Visibility rules
I've worked through the Visibility Rules Checklist and I believe all conditions have been met:
Product.Active = true
Catalog exists where:
Catalog.Active = true
Buyer is assigned via CatalogAssignment
Product is assigned via ProductCatalogAssignment
One of the following is true:
CatalogAssignment.ViewAllProducts = true
Product is active
{{baseUrl}}/v1/products returns this response:
{
"Meta": {
"Facets": [],
"Page": 1,
"PageSize": 20,
"TotalCount": 1,
"TotalPages": 1,
"ItemRange": [
1,
1
],
"NextPageKey": null
},
"Items": [
{
"OwnerID": "xxxxxxxxxxxxxxxx",
"DefaultPriceScheduleID": "SHIRT_PRICE",
"AutoForward": false,
"ID": "SHIRT",
"Name": "Cotton T-Shirt",
"Description": "A plain white, cotton shirt for everyday use.",
"QuantityMultiplier": 1,
"ShipWeight": null,
"ShipHeight": null,
"ShipWidth": null,
"ShipLength": null,
"Active": true,
"SpecCount": 0,
"VariantCount": 0,
"ShipFromAddressID": null,
"Inventory": null,
"DefaultSupplierID": null,
"AllSuppliersCanSell": false,
"Returnable": false,
"xp": null
}
]
}
Catalog is active
{{baseUrl}}/v1/catalogs returns
{
"Meta": {
"Page": 1,
"PageSize": 20,
"TotalCount": 1,
"TotalPages": 1,
"ItemRange": [
1,
1
],
"NextPageKey": null
},
"Items": [
{
"ID": "BUYER_ORGANIZATION",
"OwnerID": "xxxxxxxxxxxxxxxx",
"Name": "Example Buyer",
"Description": "Default catalog for Example Buyer",
"Active": true,
"CategoryCount": 0,
"xp": null
}
]
}
Buyer is assigned
Buyer user in organization
{{baseUrl}}/v1/me (with buyer01 cookie) returns:
{
"Buyer": {
"ID": "BUYER_ORGANIZATION",
"DefaultCatalogID": "BUYER_ORGANIZATION"
},
"Supplier": null,
"Seller": {
"ID": "xxxxxxxxxxxxxxxx"
},
"ID": "BUYER_USER",
"CompanyID": "BUYER_ORGANIZATION",
"Username": "buyer01",
"Password": null,
"FirstName": "Buyer",
"LastName": "User",
"Email": "buyer#email.com",
"Phone": null,
"TermsAccepted": null,
"Active": true,
"xp": null,
"AvailableRoles": [
"MeAdmin",
"PasswordReset",
"Shopper"
],
"Locale": null,
"DateCreated": "2022-12-21T00:43:53.507+00:00",
"PasswordLastSetDate": "2022-12-21T00:43:53.543+00:00"
}
Buyer organization is assigned catalog
{{baseUrl}}/v1/catalogs/assignments returns
{
"Meta": {
"Page": 1,
"PageSize": 20,
"TotalCount": 1,
"TotalPages": 1,
"ItemRange": [
1,
1
],
"NextPageKey": null
},
"Items": [
{
"CatalogID": "BUYER_ORGANIZATION",
"BuyerID": "BUYER_ORGANIZATION",
"ViewAllCategories": true,
"ViewAllProducts": true
}
]
}
Product is assigned
This may be the issue. When I make the documented assignment:
{{baseUrl}}/v1/catalogs/productassignments
{
"CatalogID": "BUYER_ORGANIZATION",
"ProductID": "SHIRT"
}
I receive a 200 response that does not show any assignment has occurred:
{
"Meta": {
"Page": 1,
"PageSize": 20,
"TotalCount": 0,
"TotalPages": 0,
"ItemRange": [
1,
0
],
"NextPageKey": null
},
"Items": []
}
Note that the above request, as all other steps, is taken from the Getting Started walkthrough. This step is provided under Making Your Product Visible.
This is confirmed by this request:
{{baseUrl}}/v1/products/assignments, which returns no products.
{
"Meta": {
"Page": 1,
"PageSize": 20,
"TotalCount": 0,
"TotalPages": 0,
"ItemRange": [
1,
0
],
"NextPageKey": null
},
"Items": []
}
View all products is true
{{baseUrl}}/v1/catalogs/assignments returns
{
"Meta": {
"Page": 1,
"PageSize": 20,
"TotalCount": 1,
"TotalPages": 1,
"ItemRange": [
1,
1
],
"NextPageKey": null
},
"Items": [
{
"CatalogID": "BUYER_ORGANIZATION",
"BuyerID": "BUYER_ORGANIZATION",
"ViewAllCategories": true,
"ViewAllProducts": true
}
]
}
The issue was that I was making a GET request instead of a POST when doing this:
{{baseUrl}}/v1/catalogs/productassignments
When issuing a POST, the service returns a 204 No Content.
It is worth noting that the tutorial is a bit out of date--the current Product API documentation omits the above call, and instead has /products/assignments here. This method will return a 405 Method Not Allowed an error if doing a GET, which makes this issue easier to identify.
Now when I view /me/products as buyer01 I see this:
{
"Meta": {
"Facets": [],
"Page": 1,
"PageSize": 20,
"TotalCount": 1,
"TotalPages": 1,
"ItemRange": [
1,
1
],
"NextPageKey": null
},
"Items": [
{
"PriceSchedule": {
"OwnerID": "xxxxxxxxxxxxxxxx",
"ID": "SHIRT_PRICE",
"Name": "Cotton T-Shirt Price",
"ApplyTax": false,
"ApplyShipping": false,
"MinQuantity": 1,
"MaxQuantity": null,
"UseCumulativeQuantity": false,
"RestrictedQuantity": false,
"PriceBreaks": [
{
"Quantity": 1,
"Price": 10.0,
"SalePrice": null
}
],
"Currency": null,
"SaleStart": null,
"SaleEnd": null,
"IsOnSale": false,
"xp": null
},
"ID": "SHIRT",
"Name": "Cotton T-Shirt",
"Description": "A plain white, cotton shirt for everyday use.",
"QuantityMultiplier": 1,
"ShipWeight": null,
"ShipHeight": null,
"ShipWidth": null,
"ShipLength": null,
"Active": true,
"SpecCount": 0,
"VariantCount": 0,
"ShipFromAddressID": null,
"Inventory": null,
"DefaultSupplierID": null,
"AllSuppliersCanSell": false,
"Returnable": false,
"xp": null
}
]
}
I am building a floormap from geojson data using d3.js topo and d3.js path. For clarification, I am also using vue.js. I want to add a tooltip when the user hovers over a room (aka the d3.js path). First I added just a console log to when the user hovers over a path but that did not work. I noticed that every time I load the app it does a console log but not when a user clicks / hovers over the d3.js path. I heard someone say that I would have to create an invisible circle or rectangle which would have the tooltip property bind to it but I don't think that route would work once the floor maps get complex. I dont care about adding any actual data to the tooltip right now but later I would want to. Can someone point me in the right direction, please? Thank you.
const data = {
"type": "FeatureCollection",
"features": [{
"type": "Feature",
"properties": {},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
0, 0
],
[
0, 11.4
],
[
7, 11.4
],
[
7, 0
],
[
0, 0
]
]
]
}
},
{
"type": "Feature",
"properties": {},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
7, 0
],
[
7, 11.4
],
[
12, 11.4
],
[
12, 0
],
[
7, 0
]
]
]
}
},
{
"type": "Feature",
"properties": {},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
12, 0
],
[
12, 11.4
],
[
19, 11.4
],
[
19, 0
],
[
12, 0
]
]
]
}
}
]
};
var svg = d3.select("svg")
var width = +svg.attr("width")
var height = +svg.attr("height")
svg.attr("transform", "translate(" + width / 2 + ",0)")
var projection = d3.geoIdentity().fitSize([width, height], data)
var path = d3.geoPath(projection)
svg.selectAll("path")
.data(data.features)
.enter()
.append("path")
.attr("d", path)
.attr("fill", "grey")
.attr("fill-opacity", .2)
.attr("stroke", "black")
.attr("stroke-width", 1.5)
.on("mouseover", console.log("hello"));
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/5.7.0/d3.min.js"></script>
<svg width="400" height="200"></svg>
There are several ways to do this. The simplest - but most limited - one is to create a <title> element in each path. It will show on hover, as it's browser native.
const data = {
"type": "FeatureCollection",
"features": [{
"type": "Feature",
"properties": { "name": "Kitchen" },
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
0, 0
],
[
0, 11.4
],
[
7, 11.4
],
[
7, 0
],
[
0, 0
]
]
]
}
},
{
"type": "Feature",
"properties": { "name": "Living room" },
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
7, 0
],
[
7, 11.4
],
[
12, 11.4
],
[
12, 0
],
[
7, 0
]
]
]
}
},
{
"type": "Feature",
"properties": { "name": "Toilet" },
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
12, 0
],
[
12, 11.4
],
[
19, 11.4
],
[
19, 0
],
[
12, 0
]
]
]
}
}
]
};
var svg = d3.select("svg")
var width = +svg.attr("width")
var height = +svg.attr("height")
svg.attr("transform", "translate(" + width / 2 + ",0)")
var projection = d3.geoIdentity().fitSize([width, height], data)
var path = d3.geoPath(projection)
svg.selectAll("path")
.data(data.features)
.enter()
.append("path")
.attr("d", path)
.attr("fill", "grey")
.attr("fill-opacity", .2)
.attr("stroke", "black")
.attr("stroke-width", 1.5)
.append("title")
// Do this to maintain access to the features you drew
.datum(function(d) { return d; })
.text(function(d) {
return d.properties.name;
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/5.7.0/d3.min.js"></script>
<svg width="400" height="200"></svg>
More complicated ones can use an absolutely positioned div, for example:
const data = {
"type": "FeatureCollection",
"features": [{
"type": "Feature",
"properties": {
"name": "Kitchen"
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
0, 0
],
[
0, 11.4
],
[
7, 11.4
],
[
7, 0
],
[
0, 0
]
]
]
}
},
{
"type": "Feature",
"properties": {
"name": "Living room"
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
7, 0
],
[
7, 11.4
],
[
12, 11.4
],
[
12, 0
],
[
7, 0
]
]
]
}
},
{
"type": "Feature",
"properties": {
"name": "Toilet"
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
12, 0
],
[
12, 11.4
],
[
19, 11.4
],
[
19, 0
],
[
12, 0
]
]
]
}
}
]
};
var svg = d3.select("svg")
var width = +svg.attr("width")
var height = +svg.attr("height")
var tooltip = d3.select("#tooltip")
svg.attr("transform", "translate(" + width / 2 + ",0)")
var projection = d3.geoIdentity().fitSize([width, height], data)
var path = d3.geoPath(projection)
svg.selectAll("path")
.data(data.features)
.enter()
.append("path")
.attr("d", path)
.attr("fill", "grey")
.attr("fill-opacity", .2)
.attr("stroke", "black")
.attr("stroke-width", 1.5)
.on("mousemove", function(d) {
// +3 as some offset to make sure spawning the tooltip doesn't
// accidentally also cause unhover and thus removing itself
tooltip
.html(d.properties.name)
.style("display", "block")
.style("left", d3.event.x + 3 + 'px')
.style("top", d3.event.y + 3 + 'px');
})
.on("mouseleave", function() {
tooltip
.style("display", null)
.style("left", null)
.style("top", null);
});
#tooltip {
position: absolute;
top: 0;
left: 0;
display: none;
border: solid 1px red;
padding: 5px;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/5.7.0/d3.min.js"></script>
<svg width="400" height="200"></svg>
<div id="tooltip"></div>
What is the appropriate syntax to add a sku with picklist modifiers to cart?
https://developer.bigcommerce.com/api-reference/cart-checkout/storefront-cart-api/cart/addcartlineitem
Assuming this is my product
GET https://api.bigcommerce.com/stores/:store-hash/v3/catalog/products?include=modifiers,variants&id:in=237
{
"data": [
{
"id": 237,
"name": "Awesome Bundle Sku",
"type": "physical",
"sku": "BUNDLE1",
"description": "",
"weight": 1,
"width": 1,
"depth": 1,
"height": 1,
"price": 99,
"cost_price": 0,
"retail_price": 0,
"sale_price": 0,
"map_price": 0,
"tax_class_id": 0,
"product_tax_code": "",
"calculated_price": 99,
"categories": [
50
],
"brand_id": 0,
"option_set_id": 25,
"option_set_display": "right",
"inventory_level": 0,
"inventory_warning_level": 0,
"inventory_tracking": "none",
"reviews_rating_sum": 0,
"reviews_count": 0,
"total_sold": 0,
"fixed_cost_shipping_price": 0,
"is_free_shipping": false,
"is_visible": false,
"is_featured": false,
"related_products": [
-1
],
"warranty": "",
"bin_picking_number": "",
"layout_file": "product.html",
"upc": "",
"mpn": "",
"gtin": "",
"search_keywords": "",
"availability": "available",
"availability_description": "",
"gift_wrapping_options_type": "any",
"gift_wrapping_options_list": [],
"sort_order": 500,
"condition": "New",
"is_condition_shown": false,
"order_quantity_minimum": 0,
"order_quantity_maximum": 0,
"page_title": "",
"meta_keywords": [],
"meta_description": "",
"date_created": "2019-05-29T19:16:08+00:00",
"date_modified": "2019-08-24T19:28:45+00:00",
"view_count": 0,
"preorder_release_date": null,
"preorder_message": "",
"is_preorder_only": false,
"is_price_hidden": false,
"price_hidden_label": "",
"custom_url": {
"url": "/bundle1/",
"is_customized": false
},
"base_variant_id": 202,
"open_graph_type": "product",
"open_graph_title": "",
"open_graph_description": "",
"open_graph_use_meta_description": true,
"open_graph_use_product_name": true,
"open_graph_use_image": true,
"variants": [
{
"id": 202,
"product_id": 237,
"sku": "BUNDLE1",
"sku_id": null,
"price": 99,
"calculated_price": 99,
"sale_price": 0,
"retail_price": 0,
"map_price": 0,
"weight": 1,
"width": 1,
"height": 1,
"depth": 1,
"is_free_shipping": false,
"fixed_cost_shipping_price": 0,
"calculated_weight": 1,
"purchasing_disabled": false,
"purchasing_disabled_message": "",
"image_url": "",
"cost_price": 0,
"upc": "",
"mpn": "",
"gtin": "",
"inventory_level": 0,
"inventory_warning_level": 0,
"bin_picking_number": "",
"option_values": []
}
],
"modifiers": [
{
"id": 140,
"product_id": 237,
"name": "53701567688198-237",
"display_name": "5370",
"type": "product_list",
"required": true,
"sort_order": 1,
"config": {
"product_list_adjusts_inventory": false,
"product_list_adjusts_pricing": false,
"product_list_shipping_calc": "none"
},
"option_values": [
{
"id": 127,
"option_id": 140,
"label": "COMPONENT1",
"sort_order": 0,
"value_data": {
"product_id": 136
},
"is_default": true,
"adjusters": {
"price": null,
"weight": null,
"image_url": "",
"purchasing_disabled": {
"status": false,
"message": ""
}
}
}
]
}
]
}
],
"meta": {
"pagination": {
"total": 1,
"count": 1,
"per_page": 250,
"current_page": 1,
"total_pages": 1,
"links": {
"current": "?limit=250&include=modifiers%2Cvariants&id%3Ain=237&page=1"
},
"too_many": false
}
}
}
POST https://api.bigcommerce.com/stores/:store-hash/v3/carts/:cart-id/items
{
"line_items": [
{
"product_id": 237,
"quantity": 1,
"option_selections": [
{
"option_id": 140,
"option_value": 127
}
]
}
]
}
I want to to render the JSON values from an API using vue and vue-chartjs. The bar-chart instead of looping through the array and plot the complete array, shows just the first two results (dc:title and dc:identifier).
Using JQUERY I have integrated the script into my chart.vue component
<script>
import Chart from 'chart.js';
import JQuery from 'jquery'
let $ = JQuery
export default {
name: 'app',
mounted() {
var chart = this.$refs.chart;
const ctx = chart.getContext("2d");
const myChart = new Chart(ctx, {
type: 'bar',
data: {
labels: [],
datasets: [{
label: '# of Metadata',
data: [],
backgroundColor: [
'rgba(255, 99, 132, 0.2)',
'rgba(54, 162, 235, 0.2)',
'rgba(255, 206, 86, 0.2)',
'rgba(75, 192, 192, 0.2)',
'rgba(153, 102, 255, 0.2)',
'rgba(255, 159, 64, 0.2)'
],
borderColor: [
'rgba(255,99,132,1)',
'rgba(54, 162, 235, 1)',
'rgba(255, 206, 86, 1)',
'rgba(75, 192, 192, 1)',
'rgba(153, 102, 255, 1)',
'rgba(255, 159, 64, 1)'
],
borderWidth: 1
}]
},
options: {
scales: {
yAxes: [{
ticks: {
beginAtZero: true
}
}]
}
}
});
var getData = function() {
$.ajax({
url: 'http://localhost:3000/ratio/total',
success: function(data) {
console.log(data[0].results);
for(var key in data[0].results[0]){
myChart.data.labels.push(data[0].results[key][0]);
myChart.data.datasets[0].data.push(data[0].results[key][1]);
}
myChart.update();
}
});
};
// get new data every 3 seconds
getData();
}
}
</script>
API JSON output
[
{
"results": [
[
"dc:title",
553
],
[
"dc:identifier",
553
],
[
"dc:subject",
553
],
[
"dc:type",
553
],
[
"dc:format",
553
],
[
"dc:description",
553
],
[
"dc:language",
553
],
[
"$",
553
],
[
"dc:relation",
553
],
[
"dc:source",
532
],
[
"dc:rights",
449
],
[
"dc:date",
21
],
[
"dc:creator",
21
],
[
"dc:publisher",
21
],
[
"dc:coverage",
21
],
[
"pico:anchor",
0
],
[
"pico:preview",
0
],
[
"dcterms:rightsHolder",
0
],
[
"pico:author",
0
],
[
"pico:materialAndTechnique",
0
],
[
"dc:isReferencedBy",
0
],
[
"dcterms:isReferencedBy",
0
],
[
"dcterms:spatial",
0
],
[
"dcterms:created",
0
],
[
"pico:producer",
0
],
[
"dcterms:medium",
0
],
[
"dcterms:extent",
0
],
[
"pico:distributor",
0
],
[
"dcterms:isPartOf",
0
],
[
"dcterms:license",
0
],
[
"pico:licenseMetadata",
0
],
[
"dcterms:alternative",
0
],
[
"dcterms:modified",
0
],
[
"dcterms:hasPart",
0
],
[
"pico:contact",
0
],
[
"pico:information",
0
],
[
"pico:service",
0
],
[
"pico:responsible",
0
],
[
"pico:isManagedBy",
0
],
[
"dcterms:provenance",
0
]
]
}
]
I don't think that is a valid object first off.
"results": [["dc:title",553], should be "results": [{"dc": "title", "key": 553}]
notice the curly braces { and the key missing from the second numeric prop
check this out: https://www.w3schools.com/js/js_json_objects.asp
you can run ur json through a validator as well to make sure: https://jsonformatter.curiousconcept.com/
Context:
300000 lines of JSON data are generated approximately every five seconds by a game's remote public API. This data disappears immediately after the next update and is never accessible again. I want to be able to save compressed historical records of this data, which can be reliably and efficiently indexed and searched.
Question:
What is the best database system to store JSON data on this scale, considering possible compression methods and most importantly query efficiency?
EDIT Adding example unpacked JSON (one object out of around 30000):
{
"accountName": "Kabancheg11",
"lastCharacterName": "KabanNeedBuff",
"id": "427d66d977b5a63af08b3c39173a1a567eb783fde6d6f97df505dbe6c1fa5988",
"stash": "~b/o 30 chaos",
"stashType": "PremiumStash",
"items": [
{
"verified": false,
"w": 1,
"h": 1,
"ilvl": 71,
"icon": "http://web.poecdn.com/image/Art/2DItems/Amulets/Amulet37.png?scale=1&w=1&h=1&v=25bebeac11abfd9f7931d574765521093",
"league": "Hardcore",
"id": "a7bb36a28e55865b9d766dcebd5bc0c6893d5ecb6cd9870dc0bcd3c9f1164f29",
"sockets": [],
"name": "",
"typeLine": "Onyx Amulet",
"identified": false,
"corrupted": false,
"lockedToCharacter": false,
"implicitMods": [
"+15 to all Attributes"
],
"frameType": 3,
"x": 11,
"y": 0,
"inventoryId": "Stash1",
"socketedItems": []
},
{
"verified": false,
"w": 1,
"h": 3,
"ilvl": 75,
"icon": "http://web.poecdn.com/image/Art/2DItems/Weapons/OneHandWeapons/Daggers/Heartbreaker.png?scale=1&w=1&h=3&v=b4f18d5c0602a17381df6a45b4c57be33",
"league": "Hardcore",
"id": "c955f054ffae9439e5d257c4a444b02423b2dbe304d1fa581227d21a0f203aa9",
"sockets": [
{
"group": 0,
"attr": "D"
},
{
"group": 0,
"attr": "D"
}
],
"name": "<<set:MS>><<set:M>><<set:S>>Heartbreaker",
"typeLine": "Royal Skean",
"identified": true,
"corrupted": false,
"lockedToCharacter": false,
"properties": [
{
"name": "Dagger",
"values": [],
"displayMode": 0
},
{
"name": "Physical Damage",
"values": [
[
"15-59",
0
]
],
"displayMode": 0
},
{
"name": "Critical Strike Chance",
"values": [
[
"6.60%",
0
]
],
"displayMode": 0
},
{
"name": "Attacks per Second",
"values": [
[
"1.45",
0
]
],
"displayMode": 0
}
],
"requirements": [
{
"name": "Level",
"values": [
[
"50",
0
]
],
"displayMode": 0
},
{
"name": "Dex",
"values": [
[
"71",
0
]
],
"displayMode": 1
},
{
"name": "Int",
"values": [
[
"102",
0
]
],
"displayMode": 1
}
],
"implicitMods": [
"40% increased Global Critical Strike Chance"
],
"explicitMods": [
"45% increased Spell Damage",
"+50 to maximum Mana",
"+50 to maximum Energy Shield",
"10% faster start of Energy Shield Recharge",
"Your Spells have Culling Strike"
],
"flavourText": [
"A heart can be stabbed by thoughts, \r",
"If your mind is sharp enough."
],
"frameType": 3,
"x": 0,
"y": 9,
"inventoryId": "Stash2",
"socketedItems": []
},
{
"verified": false,
"w": 2,
"h": 3,
"ilvl": 75,
"icon": "http://web.poecdn.com/image/Art/2DItems/Weapons/OneHandWeapons/Scepters/MontregulsGrasp.png?scale=1&w=2&h=3&v=fed985831c32e8e25b7663608a2b7a5c3",
"league": "Hardcore",
"id": "a78e6bfff62145c78b92714cc7de10e4484c42745d48b585ef905b3972c2a319",
"sockets": [
{
"group": 0,
"attr": "S"
},
{
"group": 0,
"attr": "S"
}
],
"name": "",
"typeLine": "Void Sceptre",
"identified": false,
"corrupted": false,
"lockedToCharacter": false,
"properties": [
{
"name": "One Handed Mace",
"values": [],
"displayMode": 0
},
{
"name": "Physical Damage",
"values": [
[
"42-63",
0
]
],
"displayMode": 0
},
{
"name": "Critical Strike Chance",
"values": [
[
"6.50%",
0
]
],
"displayMode": 0
},
{
"name": "Attacks per Second",
"values": [
[
"1.25",
0
]
],
"displayMode": 0
}
],
"requirements": [
{
"name": "Str",
"values": [
[
"104",
0
]
],
"displayMode": 1
},
{
"name": "Int",
"values": [
[
"122",
0
]
],
"displayMode": 1
}
],
"implicitMods": [
"15% increased Elemental Damage"
],
"frameType": 3,
"x": 0,
"y": 6,
"inventoryId": "Stash3",
"socketedItems": []
},
{
"verified": false,
"w": 2,
"h": 4,
"ilvl": 74,
"icon": "http://web.poecdn.com/image/Art/2DItems/Weapons/TwoHandWeapons/TwoHandAxes/TwoHandAxe11Unique.png?scale=1&w=2&h=4&v=49f4f7aff220d356fc6300d7454df63a3",
"league": "Hardcore",
"id": "c8d722c909939d1fda4431722c732e7af4c17781d9d9c58da613bf776ea1e993",
"sockets": [
{
"group": 0,
"attr": "D"
}
],
"name": "",
"typeLine": "Superior Karui Chopper",
"identified": false,
"corrupted": false,
"lockedToCharacter": false,
"properties": [
{
"name": "Two Handed Axe",
"values": [],
"displayMode": 0
},
{
"name": "Quality",
"values": [
[
"+10%",
1
]
],
"displayMode": 0
},
{
"name": "Physical Damage",
"values": [
[
"88-138",
1
]
],
"displayMode": 0
},
{
"name": "Critical Strike Chance",
"values": [
[
"5.00%",
0
]
],
"displayMode": 0
},
{
"name": "Attacks per Second",
"values": [
[
"1.15",
0
]
],
"displayMode": 0
}
],
"requirements": [
{
"name": "Str",
"values": [
[
"151",
0
]
],
"displayMode": 1
},
{
"name": "Dex",
"values": [
[
"43",
0
]
],
"displayMode": 1
}
],
"frameType": 3,
"x": 2,
"y": 0,
"inventoryId": "Stash4",
"socketedItems": []
},
{
"verified": false,
"w": 2,
"h": 3,
"ilvl": 51,
"icon": "http://web.poecdn.com/image/Art/2DItems/Armours/BodyArmours/StrInt3AUnique2.png?scale=1&w=2&h=3&v=3ef1aa6bc50b635ca334653ca95485a63",
"league": "Hardcore",
"id": "26c55af00fb31f63bec7229b622c3c79fb6efcfa03d3d2595672a92778d04d99",
"sockets": [
{
"group": 0,
"attr": "I"
},
{
"group": 1,
"attr": "I"
}
],
"name": "<<set:MS>><<set:M>><<set:S>>Ambu's Charge",
"typeLine": "Crusader Chainmail",
"identified": true,
"corrupted": false,
"lockedToCharacter": false,
"properties": [
{
"name": "Armour",
"values": [
[
"477",
1
]
],
"displayMode": 0
},
{
"name": "Energy Shield",
"values": [
[
"141",
1
]
],
"displayMode": 0
}
],
"requirements": [
{
"name": "Level",
"values": [
[
"43",
0
]
],
"displayMode": 0
},
{
"name": "Str",
"values": [
[
"64",
0
]
],
"displayMode": 1
},
{
"name": "Int",
"values": [
[
"64",
0
]
],
"displayMode": 1
}
],
"explicitMods": [
"182% increased Armour and Energy Shield",
"+15% to all Elemental Resistances",
"Gain an Endurance Charge when you take a Critical Strike",
"2% of Life Regenerated per second while on Low Life",
"Share Endurance Charges with nearby party members"
],
"flavourText": [
"Nothing stops the pain like a courageous rush into battle."
],
"frameType": 3,
"x": 0,
"y": 0,
"inventoryId": "Stash5",
"socketedItems": []
},
{
"verified": false,
"w": 1,
"h": 1,
"ilvl": 64,
"icon": "http://web.poecdn.com/image/Art/2DItems/Jewels/basicint.png?scale=1&w=1&h=1&v=cd579ea22c05f1c6ad2fd015d7a710bd3",
"league": "Hardcore",
"id": "34103c553f0ae3e36c695664a7540dd6e547338596c33554ca3a8443dd5349c1",
"sockets": [],
"name": "<<set:MS>><<set:M>><<set:S>>Cataclysm Heart",
"typeLine": "Cobalt Jewel",
"identified": true,
"corrupted": false,
"lockedToCharacter": false,
"explicitMods": [
"2% increased Cast Speed",
"7% increased maximum Energy Shield",
"+13% to Lightning Resistance"
],
"descrText": "Place into an allocated Jewel Socket on the Passive Skill Tree. Right click to remove from the Socket.",
"frameType": 2,
"x": 0,
"y": 3,
"inventoryId": "Stash6",
"socketedItems": []
},
{
"verified": false,
"w": 1,
"h": 1,
"ilvl": 0,
"icon": "http://web.poecdn.com/image/Art/2DItems/Gems/VaalGems/VaalArc.png?scale=1&w=1&h=1&v=b4f32328e279496ebb227521e8dce6793",
"support": false,
"league": "Hardcore",
"id": "be9a23cfe0a53942b19c22da32b7d461b464838749110d04689e15498dcad86b",
"sockets": [],
"name": "",
"typeLine": "Vaal Arc",
"identified": true,
"corrupted": true,
"lockedToCharacter": false,
"properties": [
{
"name": "Vaal, Spell, Chaining, Lightning",
"values": [],
"displayMode": 0
},
{
"name": "Level",
"values": [
[
"20 (Max)",
0
]
],
"displayMode": 0
},
{
"name": "Mana Cost",
"values": [
[
"0",
0
]
],
"displayMode": 0
},
{
"name": "Souls Per Use",
"values": [
[
"32",
0
]
],
"displayMode": 0
},
{
"name": "Can Store %0 Use",
"values": [
[
"1",
0
]
],
"displayMode": 3
},
{
"name": "Cast Time",
"values": [
[
"0.80 sec",
0
]
],
"displayMode": 0
},
{
"name": "Critical Strike Chance",
"values": [
[
"5.00%",
0
]
],
"displayMode": 0
},
{
"name": "Damage Effectiveness",
"values": [
[
"80%",
0
]
],
"displayMode": 0
}
],
"requirements": [
{
"name": "Level",
"values": [
[
"70",
0
]
],
"displayMode": 0
},
{
"name": "Int",
"values": [
[
"155",
0
]
],
"displayMode": 1
}
],
"secDescrText": "An arc of lightning stretches from the caster to a targeted nearby enemy and chains on to many additional targets.",
"explicitMods": [
"Deals 49 to 938 Lightning Damage",
"Chain +40 Times",
"100% chance to Shock enemies"
],
"descrText": "Place into an item socket of the right colour to gain this skill. Right click to remove from a socket.",
"frameType": 4,
"x": 0,
"y": 4,
"inventoryId": "Stash7",
"socketedItems": []
}
],
"public": true
}
An example query could be asking how many of the items nested inside every object like the one shown above have an ilvl field greater than or equal to an integer.