marklogic-samplestack | sample implementation of the MarkLogic Reference | Application Framework library
kandi X-RAY | marklogic-samplestack Summary
kandi X-RAY | marklogic-samplestack Summary
Samplestack is a sample application showing how to build a three tier application on MarkLogic. It was released in 2015 on MarkLogic 8 using a Java middle tier and a parallel Node.js stack implementation, with an Angular front end. As of 2019: While the product team is no longer maintaining the application, the archived repository makes the code available for browsing as a valid reference architecture at a high-level which uses many still relevant features. Samplestack is a comprehensive sample application that demonstrates how to build an effective MarkLogic application. Based on the idea of a "Question and Answer" website, Samplestack shows you how to integrate MarkLogic into a three-tier application architecture (browser, application server, and database).
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of marklogic-samplestack
marklogic-samplestack Key Features
marklogic-samplestack Examples and Code Snippets
Community Discussions
Trending Discussions on marklogic-samplestack
QUESTION
Background
I'm using NoSql database supporting graphs for the first time. It is a huge medical application handling thousands of patients. It is a greenfield project and we as a team are struggling with our persistence layer. We don't know how relationships should be represented and if we should use Triples to handle queries involving huge amount of data. We are using Java API.
Data structure
Imagine that there are 3 types of JSON documents in our Marklogic database: Patient, Event, File Evidence.
- There are thousands of patients in the application
- One patient can have multiple events associated with this patient (admitted, discharged, transferred, prescribed medications, added note, changed internal status etc.)
- each event can have multiple files attached to it as an evidence
Assume there are hundreds of thousands of patients, events and files.
Question
Is it possible to query patients with events and files at once? Is using semantics (possible triples: 'patient has event', 'event has file') recommended in our case?
Our approach
We try to use triples to provide relationships between our documents, add them to one graph, use combination query to fetch IRI first and then in the second call fetch documents by IRI. We tried self-paced trainings and exploring https://github.com/marklogic/marklogic-samplestack but with no luck. Help of someone who has done that in the past and would like to share his experience would be great.
...ANSWER
Answered 2017-Mar-02 at 09:36I your situation, keep in mind that you can also store the triples in each of the documents themselves (with the inferred subject being the document itself). Then in your example, you could be combining cts:triple-range-query with standard cts:search.
Example: If I had events and embedded a triple such as [this event-> ownedByPatient -> [iri/for/patiens#12345]
Then I could query: search for events filtered by fragments where the cts:triple-range-query states that the events are owned by patient 12345
This approach is a combination of semantics and MarkLogic search - using triples to link the appropriate types.
As for different types of documents, triples do not care what they are pointing at - an IRI of a person, event, etc. Its just about how you model you data itself and the ontology used to describe the relationships. So, you can also approach this as managed triples (not embedded) and treat it all as a graph database pointing at your content (like the approach you are describing)
Once you get further along, you may also decide to force restrictions on the types of relationships using RDF rules.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install marklogic-samplestack
Database
Middle Tier - Application Server
Set up the Java middle tier and database tier with gradle. A pre-built instance of the browser app is included.
Set up the JavaScript Node.js-based tiers and database tier using npm
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page