How to select a document whit a specific child in Alfreso? - alfresco

I have a set of documents where some of them have a child (associtaion type "ecmccontent:content_origin") and some of them don't have such child association. I need a result set of documents without such association, how to do that (in any query language)?
Thank you!

There's no way to query for associations, unfortunately.
What you can do is setup a property or an aspect - at the same time when you create the association - and then query for that property/aspect.
find nodes with a specific child association

Related

Tinkerpop: Creating nested Properties

I want to create a Vertex of label foo, which contains a property child. Child property will have two properties A, B. Child in itself can contain more nested children.
If vertex foo is deleted, its all properties including child property should be deleted. My query pattern would be to query all vertexes of label foo which has property A = 'bar'
This can be easily represented by representing the child as vertices instead of property, but then the child has to be deleted by doing dfs/bfs originating from vertex foo. This is proving a costly affair. If childs are saved as property, drop operation will be saved of dfs/bfs.
How do I create nested properties and how can I query them using apache tinkerpop. Is there any other data model I can adopt to reduce the query cost.
Neptune does not support meta properties. Even if it would, you should not have used them. If you have hierarchical structure, and you already use a graph DB, then you should benefit from its capabilities.
If just storing nested properties is your need, maybe you should look at document DB instead.
Deleting a child vertex should not be an expensive operation:
g.V(child_id).emit().repeat(out()).drop()

Alfresco: Search all nodes without parents

I'd like to know how to get all nodes of a given type ts:folderSet which has no parent association of type ts:FolderSubSet informed.
Currently:
So, I mean, I need all nodes of type ts:folderSet where tsfss:folderSubSet-folder is null or not informed.
Currently, I'm using admin tool in order to build this query, but I'll need to use it into a java code.
So I mean, I can use FTS or lucene...
Any ideas?
If your parent type is different you can do:
+TYPE:"ts:folderSet"
The problem is that the PARENT keyword in search uses the primary parent. Your ts:folderSubSet object is a secondary parent to your ts:folderSet object. I don't think you will be able to write a single query that can find instances of ts:folderSet that do not have an instance of ts:folderSubSet as a secondary parent.
You can write a query that returns ts:folderSet objects and then you can iterate over each one of the results checking its list of parents for the secondary object. Not ideal, but it is probably the best you can do.
You can search for a type of nodes using the following Lucene query
TYPE:"cm:folder"

How to query google-cloud-datastore to find records that dont have a specific property

I want to query cloud datastore and find all records that dont have a property 'foo'
I was looking at the docs, but didnt find anything there.
Any pointers for such query would be appreciated.
You cannot do that with a query. You will have to read all records and check if the property exists in each of those entities and do what's needed.
The documentation states that -
Entities lacking a property named in the query are ignored
Entities of the same kind need not have the same properties. To be
eligible as a query result, an entity must possess a value (possibly
null) for every property named in the query's filters and sort orders.
If not, the entity is omitted from the indexes used to execute the
query and consequently will not be included in the query's results.
Note: It is not possible to query for entities that are specifically
lacking a given property. One alternative is to add the property with
a null value, then filter for entities with null as the value of that
property.

MarkLogic 8 - XQuery - cts query to find document property by value

Is there a way to find documents with a specific property value in the document properties?
Follow-up question, are the document properties indexed?
(Properties meaning the xdmp:document-add-properties() kind)
You can wrap arbitrary queries in cts:properties-fragment-query() to scope those queries to match only document properties. And, yes, document properties are indexed.

InventTransType table reference

In AX2009, how is it possible to find the table that is related to an InventTransType in the code?
For instance, InvnetTransType::Sales is related to the SalesTable, but how is it possible to get the table id or table name from SalesTable in the code?
I do not think this is possible, because there is no 1:1 relationship between the elements of the InventTransType enum and tables. At best there is a 1:n relationship (e.g. you could argue that InventTransType::Sales is related to table SalesLine just as well or even better as table SalesTable). Note also that the documentation on the enum says that it specifies "the module that generated the transaction".
It really depends on the question you ask and the data you want to retrieve. That said, here are some points you could research, maybe one of them fits your question/requirements. If all else fails, you can always write your one mapping method that takes an enum element and gives you the id of the table you think is appropriate for this element(standard AX does this in several cases to map other entities to the enum elements, see for example table InventDimSetup, method transType2FieldId).
cross references: check the cross references of the enum or of an enum element, that should give you an idea which table(s) are associated with which element
relations of table InventTrans: for some of the enum elements, you can find table relations in table InventTrans (but unfortunately not for all of them); ponus point is that by using reflection, you can analyze the relations and get the referenced table (which is probably as close to your requirement as it can get in standard AX)

Resources