Comments (3)
advances for MYSQL
E.g.
Given a strawberry field in DB
mysql> select * from node__field_descriptive_metadata;
+----------------+---------+-----------+-------------+----------+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| bundle | deleted | entity_id | revision_id | langcode | delta | field_descriptive_metadata_value |
+----------------+---------+-----------+-------------+----------+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| digital_object | 0 | 45 | 54 | en | 0 | {"a_uri": {"0": "http://www.wikidata.org/wiki/Q2", "1": "http://www.wikidata.org/wiki/Q1"}, "label": "A new Label", "reasons_and_justifications": "Because i love metadata and repository Workflows", "strawberry_field_widget_source_entity_uuid": ""} |
| digital_object | 0 | 46 | 57 | en | 0 | {"a_uri": {"0": "https://www.wikidata.org/wiki/Q125133", "1": "http://www.wikidata.org/wiki/Q1"}, "label": "The label", "reasons_and_justifications": "Another test here", "strawberry_field_widget_source_entity_uuid": "5e20c237-3f05-4a5c-9c01-9c97ebd3340f"} |
+----------------+---------+-----------+-------------+----------+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Get first URIS of a set
mysql> select entity_id, field_descriptive_metadata_value->>'$.a_uri."0"' AS `wikiuri` FROM `node__field_descriptive_metadata` WHERE field_descriptive_metadata_value->"$.a_uri" IS NOT NULL;
+-----------+---------------------------------------+
| entity_id | wikiuri |
+-----------+---------------------------------------+
| 45 | http://www.wikidata.org/wiki/Q2 |
| 46 | https://www.wikidata.org/wiki/Q125133 |
+-----------+---------------------------------------+
2 rows in set (0.00 sec)
Now get them all
mysql> select entity_id, field_descriptive_metadata_value->>"$.a_uri" AS `wikiuri` FROM `node__field_descriptive_metadata` WHERE field_descriptive_metadata_value->"$.a_uri" IS NOT NULL;
+-----------+----------------------------------------------------------------------------------------+
| entity_id | wikiuri |
+-----------+----------------------------------------------------------------------------------------+
| 45 | {"0": "http://www.wikidata.org/wiki/Q2", "1": "http://www.wikidata.org/wiki/Q1"} |
| 46 | {"0": "https://www.wikidata.org/wiki/Q125133", "1": "http://www.wikidata.org/wiki/Q1"} |
+-----------+----------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)
In a Drupal SQL pseudo query it would be added via ::addExpression
Super fast!
from strawberryfield.
Ok, I got this done. Views can access now, via, SQL, JSON properties. Will commit before code freeze. Right now use I'm giving this is to filter by 'rdf:type' properties directly from the JSON content. I had to access $query directly to avoid the overreacting Drupal escaping of operators. '->>'
from strawberryfield.
This is probably not relevant anymore with the whole set of Key Name providers we have and Solr Indexing still, do not want to close it because it demonstrates how SQL can be used to access JSON data too. Means. DO NOT CLOSE
from strawberryfield.
Related Issues (20)
- Missed a Jquery Once() replacement in Key name Provider overview for Drupal 10 HOT 2
- Deprecation error: "trim" receiving NULL HOT 3
- Escape tags on the default raw json formatter HOT 3
- Basic IABookreader Search Controller misbehaves when a CWS Child uses it directly HOT 1
- Are we sure Flavors are being removed on File deletion/removal from an ADO? HOT 3
- Allow ETDF Sets to be processed by our Key Name Providers HOT 1
- Recent change in Views/Initialization breaks Rendered Item Index if Display Mode invokes/contains/renders a view (any) HOT 1
- Use Case: Audit Trail for Solr Index Activity
- Call to undefined method Drupal\search_api_db in StrawberryfieldUtilityService.php HOT 2
- Silly old bug, valid Strawberry Flavor index check is not right HOT 2
- Add extra configurations to Semantic Breadcrumbs
- Normalize Pronom Output HOT 1
- Make flavorsearch limit configurable HOT 6
- Dealing with Layout Builder + Views + no Search API driven Views (SQL) mixed with Search API views HOT 1
- Add re-tracker Search API Index implementation for Strawberry Flavors HOT 1
- Add a simple space to time constant
- noAI. Yes. that
- Support Vectors and ML Model Metadata on Strawberry Flavors HOT 1
- Add extra Caching context for breadcrumbs to avoid Drupal 10/11 changes in breadcrumb manager HOT 1
- Add extra checks for as:filetype structure values if a user decides (still don't OK?) RAW edit JSON and remove keys
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from strawberryfield.