1

Are there any functions/API's available to extract/retrieve the entities definitions at run time?

Could someone help me with information and provide any links to documentation?

Mads Hansen
  • 63,927
  • 12
  • 112
  • 147

1 Answers1

1

The entity model JSON or XML descriptors are typically loaded into the content database in the http://marklogic.com/entity-services/models collection.

That makes it possible to use a cts.collectionQuery() with either cts.search() or JSearch to search for entity model descriptors.

In addition, a TDE for entity model descriptors is typically loaded into the schemas database to project semantic triples from the JSON or XML documents.

That makes it possible to execute SPARQL queries over the model using op.fromSPARQL() or sem.sparql(). For more information see:

https://docs.marklogic.com/guide/entity-services/search#id_53854

https://docs.marklogic.com/guide/entity-services/search#id_27381

https://docs.marklogic.com/op.fromSPARQL

https://docs.marklogic.com/sem.sparql

Hoping that helps,

ehennum
  • 7,295
  • 13
  • 9
  • Thanks ehennum.I tried the same cts.collectionQuery() and thought that,may be ML has direct functions to access the entity definitions. – Jhansi Lakshmi Aug 26 '20 at 06:51
  • While there aren't any functions like that, a little library could provide a function that takes criteria such as an entity type name queries to return the appropriate descriptors. – ehennum Aug 26 '20 at 16:41