sdn4.0 set resultDataContents graph - d3.js

I want to use SDN4.0 to visualize by D3 in web application.For example,I want to use the following cypher query to get data:
#Query("MATCH (n:app)-[r:r1]->(m:app) RETURN n.alias,r,m.alias")
Iterable<Map<String, Object>> getAllRelations();
But the httpServer not response the exact data I want.
[{n.alias=A, r=(227)-[r1]->(235), m.alias=B}, ....]
And I want to response r1's properties ,tried r1.* but failed.
From the http://neo4j.com/developer/guide-data-visualization/ there is possible to set resultDataContents to graph(origin as rest)
So Is it any possiblity to set this parameter in SDN4.0 or have other solutions?
Thanks if having any ideas.

SDN is for creating domain rich applications. As such it's not the best tool to use if all you need is a list of properties to represent a graph.
You have a couple of paths as I can see it:
Model your application properly with SDN. Use #NodeEntity on a class called App and create a #Relationship to another App. You can then leverage SDN's repositories to return you a rich domain model which you can then transform (e.g. using DTO's) to the front end if need be.
Use the java Neo4j client, OGM HTTP driver (Undocumented), or if you are happy to completely use Javascript (either from the browser or with meteor or using a NodeJS server) you can just use the Javascript driver and call the database directly.
Either way if you are using D3 I highly recommend you use JSOG to represent your model in the front end.

How do I query for relationship data in spring data neo4j 4?
Above Answer solved my question.By using Neo4jOperations.queryForObjects() under Spring data Neo4j and return path in cypher query.

Related

Implement AEM search using query builder API using wildcard-contains in node name

I have a requirement to fetch search results based on partial/wild card in node name to retrieve AEM forms portal data.
For example, if there are multiple draft Id node under any user-email (Unique node created under /conten/forms/fp). each draft application node will reside under conten/forms/fp/.com|.net/metadata/draftId
Note: User nodes will have .com or .net in the end. Image also attached for reference. I should get testsonar#mailiantor.com/testsonar%40#mailinator.com as result since the user has more than one draft application.
My requirement is to find out users who are having multiple drafts. Can anyone suggest this would be possible using Query builder API . I have tried below predicate but noticed that wild card is not supporting in path.
type=nt:unstructured
path=/content/forms/fp/*/drafts/metadata
path.exact=false
path.false=false
When using predicates you should be able to use something like this:
group.1_property.value=%term%
group.1_property=jcr:path
group.1_property.operation=like

Migration from Spring Data Elasticsearch 4.0.0.M3 to M4

In Spring Data Elasticsearch 4.0.0.M3 I used UpdateQuery.builder().withUpdateRequest() while building UpdateRequest directly. So I could set retryOnConflict() parameter.
After moving to M4 I can't set it anymore because there is no withUpdateRequest() method in the UpdateQuery and the UpdateRequst is being built internally. UpdateQuery.builder doesn't provide an option to set retryOnConflict().
My question is what is the right way to migrate my code so that I will have full control over UpdateRequst?
Thanks.
wait for 4.0.0.RC1. I just merged the code to expose all the update query parameters on the UpdateQuery.builder

Pagination feature in Pivotal GemFire

Is there any built-in API which provides a pagination feature in Pivotal GemFire, such as in the QueryService API or using Functions? We are currently using Pivotal GemFire 9.3.0 running in PCC.
TIA.
No yet. It is a planned feature for SD Lovelace/Moore release trains. See SGF-524 - Add support for PagingAndSortingRepositories. NOTE: sorting is already supported; paging is a WIP.
There is not. However there is a common pattern for this. Instead of directly querying the matching objects, write your query to return the keys of the matching objects. The client can then implement paging (e.g. page1 is key0-key99, page 2 is key 100-199, etc.). Use the "getAll" method with a list of keys to pull back one page at a time.
BTW, you can query the keys like this: "select key from /person.entries where value.ssn='222-22-2222'"

How to access View Template Properties for Revit and compare them in Real Time?

I am trying to list the view template’s properties so we can compare them with another old template.
For example what model elements are hidden or have overrides in a given template or which Revit links have been hidden or overridden in a given template.
View Template
(https://www.google.com/search?q=view+template+revit&rlz=1C1GGRV_enUS770US770&source=lnms&tbm=isch&sa=X&ved=0ahUKEwjLndrd2cTbAhVESq0KHX1cAPwQ_AUICygC&biw=1536&bih=824#imgrc=Q0v-pV7Nxl4kfM:)
I’m looking to devise a View Template Compare tool and access to the owner and creator of them.
public void ApplyViewTemplateToActiveView()
{
Document doc = this.ActiveUIDocument.Document;
View viewTemplate = (from v in new FilteredElementCollector(doc)
.OfClass(typeof(View))
.Cast<View>()
where v.IsTemplate == true && v.Name == "MyViewTemplate"
select v)
.First();
using (Transaction t = new Transaction(doc,"Set View Template"))
{
t.Start();
doc.ActiveView.ViewTemplateId = viewTemplate.Id;
t.Commit();
}
}
With Revit API you can access with:
GetTemplateParameterIds Method / ViewTemplateId Property
The Revit API exposes almost all the ViewTemplate properties.
For instance this method returns all the Visibility/Graphic Overrides for a specific category:
https://apidocs.co/apps/revit/2019/ed267b82-56be-6e3b-0c6d-4de7df1ed312.htm
The only thing I couldn't get for a ViewTemplate are the "includes", but all the rest seems to be there.
Update:
The list or properties "not included" can be retrieved with GetNonControlledTemplateParameterIds().
Yes, and no.
Yes, I guess you can use Forge Model Derivative API to export RVT file and then build a dashboard around the View Templates data. That's assuming that View Templates data actually gets exported when the model is translated. That data is not attached to any geometry so I would not be surprised if it was skipped. The question here is why? This is like renting a 16-wheel truck to move a duffel bag across the street.
No, if your intention is to directly interact with the RVT model. Forge can view it, but to push anything back or request changes to the model, is not available yet. Then again, I am not even sure that the view template data is available via model derivative exports.
This brings me another alternative. Why not just collect the data using Revit API, the standard way and then push it out to a Database and build on top of that? There is no reason to employ Forge for any of that.
Thanks Jeremy, I had dig into your amazing website and also some solution that Konrad post in the Dynamo Forum about this. In Revit seems pretty achievable, you filter the View that is View Template and then extracts these properties, is it correct?.
I am wondering if someone can point me in the right direction with Forge.
Some amazing guys are developing a BQL https://www.retriever.works/.
BQL(Building Query Language) is a query language for buildings, similar to how SQL is a query language for databases. It is fast and flexible. BQL helps improve efficiency for QA/QC (quality assurance and quality control), and building data extraction without leaving Revit. I am also trying these and I would like to understand if there are some works where I could start with Forge next week about this.

Spring Data: can it find by two values of the same field without writing the implementation?

I am doing a Spring web app and I use Spring Data.
I am able to use Spring Data to find objects by a single value of a field. For example:
some_object_repository.findByFirstName("John")
Is there any way I can provide two first names (e.g., "John", "David") similar to the following in concept:
some_object_repository.findByFirstName({"John", "David"})
without me writing a custom implementation?
Regards and thanks!
You can do this with In at the end
findByAgeIn(Collection ages) … where x.age in ?1
http://docs.spring.io/spring-data/jpa/docs/1.6.0.RELEASE/reference/html/jpa.repositories.html#jpa.query-methods
Section 2.3.2 Query creation
In your case it will be
findByFirstNameIn(Collection names)

Resources