Knowledgebase:
Optic, Search, SQL, or SPARQL - when should I use which interface?
04 June 2020 01:21 AM

Introduction

MarkLogic offers many different ways to access your data. The best interface to use is ultimately determined by your use case. The table below is taken from MarkLogic University's on demand training course "Using the Optic API." That course runs only 12 minutes, and the table below appears at the 9:50 mark.

When to use which API

OPTIC SEARCH SQL SPARQL
Data Shape Multi-model Documents Relational lens Semantic data
Output Rows, Documents, Any structure Documents, parts of documents (snippet, highlight) Rows, values Solutions
Strengths Combines aspects of each query mechanism Discovery, relevance, fuzzy text, matching/stemming Joins, aggregates, summarizing large data sets, exact matches Relating entities, linking facts, inferring relationships
Sample queries Review liability terms for every Race with >1000 Runners that offered a "cash prize" What is the best holiday race for me to enter (nearest, highest rated, most relevant)? Which Races had the most evenly balanced Runners based on gender? Find Runners who ran Races in Europe

(7 vote(s))
Helpful
Not helpful

Comments (0)