Drupal API: find text in paragraphs related to node - drupal

I'm trying to search article nodes for some text which sits in paragraphs which are related to them.
Let's say the search term is string: the.
I'm following this but for some reason my following filter yields no results:
/jsonapi/node/article?filter[xyz][condition][path]=field_content.field_para_text.value&filter[xyz][condition][operator]=CONTAINS&filter[xyz][condition][value]=the
I'm stuck (the search term does exist in multiple paragraphs).
Here's the data structure:
In relationships of Artcile node:
Related Paragraph:
I'll very much appreciate some help!

Related

How to add customized tokens into solr to change the indexing token behaviour

It's a Drupal site with solr for search. Mainly I am not satisfied with current search result on Chinese. The tokenizer has broken the words into supposed small pieces. Most of them are reasonable. But still, it made mistakes by not treating something as a valid token either breaking it to pieces or not breaking it.
Assuming I am writing Chinese now: big data analysis is one word which shouldn't be broken. So my search on it should find it. Also I want people to find AI and big data analysis training as the first hit when they search the exact phrase AI and big data analysis training.
So I want a way to intervene or compensate the current tokens to make the search smarter.
Maybe there is a file in solr allow me to manually write these tokens down to relate them certain phrases? So every time when indexing, solr can use it as a reference.
You different steps to achieve what you want :
1) I don't see an extremely big problem with your " over tokenization" :
big data analysis is one word which shouldn't be broken. So my search on it should find it. -> your search will find it even if tokenized, I understand this was an example and the actual words are chinese, but I suspect a different issue there
2) You can use the edismax[1] query parser with phrase boost at various level to boost subsequent tokens or phrases ( pf,pf2,pf3...ps,ps2,ps3...)
[1] https://lucene.apache.org/solr/guide/6_6/the-extended-dismax-query-parser.html , https://lucene.apache.org/solr/guide/6_6/the-extended-dismax-query-parser.html#TheExtendedDisMaxQueryParser-ThepsParameter

How to query elements from a list of items in wikidata?

There is a list of proper names of stars here: https://www.wikidata.org/wiki/Q1433418
How can I query this in the Wikidata Query Service so that all individual names of stars are listed, alongwith other data in the list, such as Constellation?
In other words, how do I get at the members of the list? "Instance of" doesn't seem to work.
There is a confusion here coming from the fact that this List of proper names of stars (Q1433418) is an element centralizing links to Wikipedia pages playing this role in the different Wikipedia editions but isn't really playing any meaningful role in Wikidata: there are no instance of (P31) List of proper names of stars (Q1433418) in Wikidata.
You would have more luck looking for instance of (P31) Stars (Q523) and instance of elements that are a subclass of (P279) Star, a pattern that you will find in many of the SPARQL query examples: ?star wdt:P31/wdt:P279* wd:Q523 .
That could give this query (json version).
And if you're into JS, you can parse the JSON result with this function I wrote: wdk.simplifySparqlResults
I would not take official names of stars from there. The Wikipedia is one of the most useful resources to get first hand, somewhat organised information, on any topic. It is irreplaceable for this, and it would be a great mess not having it. However, the information is very sensitive to misuse caused by vandalism or clumsy editors.
To get (the only) official proper names of stars, the IAU is making an effort started this year. I would use this as reference. It is also stored in a text file which is easy to retrieve by a program, and is being updated while the Committee accepts more star names. It is here:
http://www.pas.rochester.edu/~emamajek/WGSN/IAU-CSN.txt
In fact, as you see, the file structure is presented in a format ready to use by software applications. It has been made to meet needs as yours.

Drupal Entity Reference based on custom field

I hope that this question has not yet been answered, but I searched through lots of topics and I didn't find an answer.
Here is the problem: I'm trying to link two nodes from different content types, and I'd like to use another field than the Title of the other node as a reference.
The reason I dont want to use the node's Title is because I'm currently building a website for a movie theater. I'm using Feeds to import movies and movie times from a xml file. These are both represented by their own content type.
Each movie has its own unique ID picked from a database, and this is the field I'd like to use for joining two nodes.
The aim is to display a movie alongside its movie times (they are more than one movie
time's node for one movie, because a movie can be seen in 3D/non 3D mode, VO/translated...).
When I'm trying to use Entity Reference, I can't find a way to fill (for example) a text field with this unique movie's ID, in order to use it as a relationship in Views.
I hope my problem and question are both understandable (excuse my English...), and that some of you could help me to find a solution.
Thanks by advance
I solved this problem by grouping fields based on Film ID.
I'll just have a bit of templating to make in order to wrap my view's output to wrap all fields, but it shouldn't be a problem ;)
You can switch the entity reference selection method to use a view instead of the "simple". You have to have views installed.

Decision tables in Enterprise Architect?

I'm trying to model a business rule set in EA.
The rules are easily described in a decision table: a column is a matching condition, a row is a rule, if all the conditions are matched in a row then the rule matched. More info is available in the Drools docs, for example.
These rules are an integral part of the application, even if on a different level than the technology details (classes, database tables, etc.). So naturally I would like to add the decision table to my documentation in EA.
I found no way to do this. EA doesn't even know about a "table" or a "spreadsheet", let alone decision tables. I would be happy to simply insert my XLS as an "attachment" to the model, but I didn't find a way to do that either.
Any ideas are appreciated.
There currently seems to be no way to do this short of taking a screen shot of the decision table and pasting it into the generated report after the fact. I believe it is in Sparx System's road-map to implement but no immediate time-frame has been given.
You could try submitting a feature request via their official forms, it can do nothing but add more ammunition to the request. At the very least they should notify you when its available.
Update1: You could always paste that screen shot into the linked document (Ctrl+Alt+D) of the parent element that contains the business rules matrix. This could then be automatically included in the auto generated report. At least then it is still contained in the model and can be used in many places.
Update2: Just Rereading your OP, are you actually using EA's business Rules engine? or are you just after a matrix that can be included in the reporting? if it is the latter then you have two options.
The first is the Relationship Matrix (View -> Relationship matrix). This can be included automatically in RTF and HTML generated reports as well has the option to Export to CSV, save as a png or metafile.
The second option is to shoehorn the State Machine Table, (From a State Machine Diagram, right click and select State Chart Editor - Table) Both of these options will allow you to layout a grid style table where you can compare your business rules.
I hope this helps

Find Unique Words in One or More Columns?

I'm looking at implementing tags in my ASP.NET website. After looking at several algorithms, I'm leaning towards having a couple of database columns that contain one or more tag words. I will then use full-text search to locate rows with specified tags.
All of this seems pretty straight forward except for one thing: I need to be able to generate a list of available tags, which the user can select from.
I know I can write a C# program to build the list of available tags, and then run it once every week or so, but I was just wondering if there's any SQL-method for doing stuff like this more efficiently.
Also, I can't help but notice that the words will be extracted anyway as part of building the full-text index. I don't suppose there's any way to access that information?
This isn't how I'd choose to structure this but to answer the actual question...
In SQL Server 2008 you can query the sys.dm_fts_index_keywords and sys.dm_fts_index_keywords_by_document table valued functions to get the information that you want.
Why not to use separate table for tags with many-to-many relationship with tagged items table?
I mean something like that:
--Articles
ArticleId
Text
--Tags
TagId
Name
--TagsToArticles
ArticleRef
TagRef

Resources