際際滷

際際滷Share a Scribd company logo
GraphDB Connectors 
Nikola Petrov<nikola.petrov@ontotext.com> 
Ontotext AD 
September 8, 2014 
Nikola Petrov<nikola.petrov@ontotext.com> GraphDB Connectors
OWLIM GraphDB Family 
GRAPHDB Server - the database engine 
GRAPHDB Workbench - tool support that replaces the sesame 
workbench 
GRAPHDB Connectors - implements advanced search scenarios 
Nikola Petrov<nikola.petrov@ontotext.com> GraphDB Connectors
Why? What we are trying to solve 
Our models are really rich/complex but we still want to get the 
results fast 
Nikola Petrov<nikola.petrov@ontotext.com> GraphDB Connectors
Why? What we are trying to solve 
Our models are really rich/complex but we still want to get the 
results fast 
Most of the queries in the search space are of the form: 
SELECT < p r o j e c t i o n var iables > 
WHERE { 
{ 
. . . many t r i p l e pat terns to f i l t e r data . . . 
. . . p o t e n t i a l l y regex or f u l l  t e x t search . . . 
} 
. . . 
{ 
. . . many t r i p l e pat terns to r e t r i e v e data . . . 
. . . of ten many o p t i o n a l and aggregates . . . 
} 
} 
Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
Why? What we are trying to solve 
Our models are really rich/complex but we still want to get the 
results fast 
Most of the queries in the search space are of the form: 
SELECT  p r o j e c t i o n var iables  
WHERE { 
{ 
. . . many t r i p l e pat terns to f i l t e r data . . . 
. . . p o t e n t i a l l y regex or f u l l  t e x t search . . . 
} 
. . . 
{ 
. . . many t r i p l e pat terns to r e t r i e v e data . . . 
. . . of ten many o p t i o n a l and aggregates . . . 
} 
} 
We want to optimize the filtering part 
Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
Design philosophy 
Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
Design philosophy 
Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
How it all started 
Analyzed all major production systems projects 
Collected feedback from partners 
Reused features and know-how from multiple projects 
Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
Main Features 
Real time synchronization 
Property chains support (data denormalization) 
Full-text search and result snippets 
Facet and co-occurrence 
Visual interface for index creation 
Everything is integrated in SPARQL 
Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
Replication model 
Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
Real time synchronization 
Create a link with a special predicate and we are going to 
index/synchronize resources in the external store 
PREFIX : http://www.ontotext.com/connectors/elasticsearch# 
PREFIX inst: http://www.ontotext.com/connectors/elasticsearch/instance# 
INSERT DATA{ 
inst:my_index :createConnector  
# tell us what resources you want to index and which predicate 
# values about them. We support predicate chains if the properties of 
# the resource are not direct 
 
} 
Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
Real time synchronization 
Create a link with a special predicate and we are going to 
index/synchronize resources in the external store 
PREFIX : http://www.ontotext.com/connectors/elasticsearch# 
PREFIX inst: http://www.ontotext.com/connectors/elasticsearch/instance# 
INSERT DATA{ 
inst:my_index :createConnector  
# tell us what resources you want to index and which predicate 
# values about them. We support predicate chains if the properties of 
# the resource are not direct 
 
} 
When you add/change resources that match the criteria, we will 
automatically update the external store 
Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
Real time synchronization 
Create a link with a special predicate and we are going to 
index/synchronize resources in the external store 
PREFIX : http://www.ontotext.com/connectors/elasticsearch# 
PREFIX inst: http://www.ontotext.com/connectors/elasticsearch/instance# 
INSERT DATA{ 
inst:my_index :createConnector  
# tell us what resources you want to index and which predicate 
# values about them. We support predicate chains if the properties of 
# the resource are not direct 
 
} 
When you add/change resources that match the criteria, we will 
automatically update the external store 
Note 
This might slow your insert statements a little bit(our tests show that this time is 
negligible) 
Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
Example data with wines 
Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
Example data with wines 
Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
Example data with wines 
@prefix rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# . 
@prefix rdfs: http://www.w3.org/2000/01/rdf-schema# . 
@prefix xsd: http://www.w3.org/2001/XMLSchema# . 
@prefix : http://www.ontotext.com/example/wine# . 
:RedWine rdfs:subClassOf :Wine . 
:WhiteWine rdfs:subClassOf :Wine . 
:RoseWine rdfs:subClassOf :Wine . 
:Merlo 
rdf:type :Grape ; 
rdfs:label Merlo . 
:CabernetSauvignon 
rdf:type :Grape ; 
rdfs:label Cabernet Sauvignon . 
:CabernetFranc 
rdf:type :Grape ; 
rdfs:label Cabernet Franc . 
:PinotNoir 
rdf:type :Grape ; 
rdfs:label Pinot Noir . 
:Chardonnay 
rdf:type :Grape ; 
rdfs:label Chardonnay . 
Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
Example data with wines 
:Yoyowine 
rdf:type :RedWine ; 
:madeFromGrape :CabernetSauvignon ; 
:hasSugar dry ; 
:hasYear 2013^^xsd:integer . 
:Franvino 
rdf:type :RedWine ; 
:madeFromGrape :Merlo ; 
:madeFromGrape :CabernetFranc ; 
:hasSugar dry ; 
:hasYear 2012^^xsd:integer . 
:Noirette 
rdf:type :RedWine ; 
:madeFromGrape :PinotNoir ; 
:hasSugar medium ; 
:hasYear 2012^^xsd:integer . 
:Blanquito 
rdf:type :WhiteWine ; 
:madeFromGrape :Chardonnay ; 
:hasSugar dry ; 
:hasYear 2012^^xsd:integer . 
:Rozova 
rdf:type :RoseWine ; 
:madeFromGrape :PinotNoir ; 
:hasSugar medium ; 
:hasYear 2013^^xsd:integer . 
Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
Create our wines index 
PREFIX : http://www.ontotext.com/connectors/elasticsearch# 
PREFIX inst: http://www.ontotext.com/connectors/elasticsearch/instance# 
INSERT DATA { 
inst:wines :createConnector  
{ 
elasticsearchNode: localhost:9300, 
types: [ 
http://www.ontotext.com/example/wine#Wine 
], 
fields: [ 
{ 
fieldName: grape, 
propertyChain: [ 
http://www.ontotext.com/example/wine#madeFromGrape, 
http://www.w3.org/2000/01/rdf-schema#label 
] 
}, 
{ 
fieldName: sugar, 
propertyChain: [http://www.ontotext.com/example/wine#hasSugar], 
sort: true 
}, 
{ 
fieldName: year, 
propertyChain: [http://www.ontotext.com/example/wine#hasYear] 
} 
] 
} 
 . 
} 
Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
But wait, I dont understand all this json stuff... 
Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
But wait, I dont understand all this json stuff... 
Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
Elasticsearch index 
Given our wines small dataset, here is what will get indexed in 
elasticsearch 
wine year grape sugar 
:Yoyowine 2013 Cabernet Sauvignon dry 
:Noirette 2012 Pinot Noir medium 
:Blanquito 2012 Chardonnay dry 
:Franvino 2012 Merlo, Cabernet Franc dry 
:Rozova 2013 Pinot Noir medium 
Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
You can query the index and join the results in SPARQL 
PREFIX : http://www.ontotext.com/connectors/elasticsearch# 
PREFIX inst: http://www.ontotext.com/connectors/elasticsearch/instance# 
SELECT ?entity { 
?search a inst:index-name ; 
:query full-text-query ; 
:entities ?entity . 
# Do anything you want with the bound entity 
} 
Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
Get wines that are made from cabernet grape 
PREFIX : http://www.ontotext.com/connectors/elasticsearch# 
PREFIX inst: http://www.ontotext.com/connectors/elasticsearch/instance# 
PREFIX wine: http://www.ontotext.com/example/wine# 
SELECT ?wine ?year { 
?search a inst:wines ; 
:query grape:cabernet ; 
:entities ?wine . 
# We combine the results from elasticsearch and join them in graphdb 
?wine wine:hasYear ?year 
} 
Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
Get wines that are made from cabernet grape 
PREFIX : http://www.ontotext.com/connectors/elasticsearch# 
PREFIX inst: http://www.ontotext.com/connectors/elasticsearch/instance# 
PREFIX wine: http://www.ontotext.com/example/wine# 
SELECT ?wine ?year { 
?search a inst:wines ; 
:query grape:cabernet ; 
:entities ?wine . 
# We combine the results from elasticsearch and join them in graphdb 
?wine wine:hasYear ?year 
} 
Wine Year 
:Yoyowine 2013 
:Franvino 2012 
Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
Other things that we expose for the matches 
The matching snippet for the full-text query 
Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
Other things that we expose for the matches 
The matching snippet for the full-text query 
The score from elasticsearch for the match 
Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
Other things that we expose for the matches 
The matching snippet for the full-text query 
The score from elasticsearch for the match 
Total number of hits in the external store 
Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
Other things that we expose for the matches 
The matching snippet for the full-text query 
The score from elasticsearch for the match 
Total number of hits in the external store 
Ordering the external store results 
Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
Faceting Usecase LCIE Co-occurrence 
Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
Faceting Usecase LCIE Co-occurrence 
Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
Faceting Usecase LCIE Facets and Full-text 
Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
Faceting Usecase LCIE Facets and Full-text 
Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
Faceting Usecase Global Capital 
Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
Faceting Usecase 
PREFIX : http://www.ontotext.com/connectors/elasticsearch# 
PREFIX inst: http://www.ontotext.com/connectors/elasticsearch/instance# 
SELECT ?facetName ?facetValue ?facetCount WHERE{ 
# note empty query is allowed and will just match all documents, hence no :query 
?r a inst:wines_index ; 
:facetFields year,sugar ; 
:facets _:f . 
_:f :facetName ?facetName . 
_:f :facetValue ?facetValue . 
_:f :facetCount ?facetCount . 
} 
Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
Faceting Usecase 
PREFIX : http://www.ontotext.com/connectors/elasticsearch# 
PREFIX inst: http://www.ontotext.com/connectors/elasticsearch/instance# 
SELECT ?facetName ?facetValue ?facetCount WHERE{ 
# note empty query is allowed and will just match all documents, hence no :query 
?r a inst:wines_index ; 
:facetFields year,sugar ; 
:facets _:f . 
_:f :facetName ?facetName . 
_:f :facetValue ?facetValue . 
_:f :facetCount ?facetCount . 
} 
Facet Name Facet Value Facet Count 
year 2012 3 
year 2013 2 
sugar dry 3 
sugar medium 2 
Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
Entity filtering(Advanced topic) 
A way to filter resources that land in the external store based the 
field value 
Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
Entity filtering(Advanced topic) 
A way to filter resources that land in the external store based the 
field value 
Allows you to use the same predicate/property chain for different 
fields(based on a filter) 
Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
Entity filtering(Advanced topic) 
A way to filter resources that land in the external store based the 
field value 
Allows you to use the same predicate/property chain for different 
fields(based on a filter) 
Consider the usecase of articles that reference people, locations, 
etc 
Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
Entity filtering 
PREFIX : http://www.ontotext.com/connectors/elasticsearch# 
PREFIX inst: http://www.ontotext.com/connectors/elasticsearch/instance# 
INSERT DATA { 
inst:my_index :createConnector  
{ 
elasticsearchNode: localhost:9200, 
types: [http://www.ontotext.com/example2#Article], 
fields: [ 
{ 
fieldName: comment, 
propertyChain: [http://www.w3.org/2000/01/rdf-schema#comment] 
}, 
{ 
fieldName: taggedWithPerson, 
propertyChain: [http://www.ontotext.com/example2#taggedWith] 
}, 
{ 
fieldName: taggedWithLocation, 
propertyChain: [http://www.ontotext.com/example2#taggedWith] 
} 
], 
entityFilter: ?taggedWithPerson type in 
(http://www.ontotext.com/example2#Person)  
?taggedWithLocation type in (http://www.ontotext.com/example2#Location) 
} 
 . 
} 
Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
Things that dont work right now but will in the near future 
support for remote external stores(solr, elasticsearch) in graphdb 
cluster setup 
filtering anywhere in the property chain(we support only filtering 
the indexed value) 
filtering implicit from explicit statements 
Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
Query tree 
Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
Thank You 
https://confluence.ontotext.com/display/GraphDB6/GraphDB+Connectors 
Questions? 
Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors

More Related Content

Ontotext's GraphDB Connectors

  • 1. GraphDB Connectors Nikola Petrov<nikola.petrov@ontotext.com> Ontotext AD September 8, 2014 Nikola Petrov<nikola.petrov@ontotext.com> GraphDB Connectors
  • 2. OWLIM GraphDB Family GRAPHDB Server - the database engine GRAPHDB Workbench - tool support that replaces the sesame workbench GRAPHDB Connectors - implements advanced search scenarios Nikola Petrov<nikola.petrov@ontotext.com> GraphDB Connectors
  • 3. Why? What we are trying to solve Our models are really rich/complex but we still want to get the results fast Nikola Petrov<nikola.petrov@ontotext.com> GraphDB Connectors
  • 4. Why? What we are trying to solve Our models are really rich/complex but we still want to get the results fast Most of the queries in the search space are of the form: SELECT < p r o j e c t i o n var iables > WHERE { { . . . many t r i p l e pat terns to f i l t e r data . . . . . . p o t e n t i a l l y regex or f u l l t e x t search . . . } . . . { . . . many t r i p l e pat terns to r e t r i e v e data . . . . . . of ten many o p t i o n a l and aggregates . . . } } Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
  • 5. Why? What we are trying to solve Our models are really rich/complex but we still want to get the results fast Most of the queries in the search space are of the form: SELECT p r o j e c t i o n var iables WHERE { { . . . many t r i p l e pat terns to f i l t e r data . . . . . . p o t e n t i a l l y regex or f u l l t e x t search . . . } . . . { . . . many t r i p l e pat terns to r e t r i e v e data . . . . . . of ten many o p t i o n a l and aggregates . . . } } We want to optimize the filtering part Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
  • 6. Design philosophy Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
  • 7. Design philosophy Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
  • 8. How it all started Analyzed all major production systems projects Collected feedback from partners Reused features and know-how from multiple projects Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
  • 9. Main Features Real time synchronization Property chains support (data denormalization) Full-text search and result snippets Facet and co-occurrence Visual interface for index creation Everything is integrated in SPARQL Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
  • 10. Replication model Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
  • 11. Real time synchronization Create a link with a special predicate and we are going to index/synchronize resources in the external store PREFIX : http://www.ontotext.com/connectors/elasticsearch# PREFIX inst: http://www.ontotext.com/connectors/elasticsearch/instance# INSERT DATA{ inst:my_index :createConnector # tell us what resources you want to index and which predicate # values about them. We support predicate chains if the properties of # the resource are not direct } Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
  • 12. Real time synchronization Create a link with a special predicate and we are going to index/synchronize resources in the external store PREFIX : http://www.ontotext.com/connectors/elasticsearch# PREFIX inst: http://www.ontotext.com/connectors/elasticsearch/instance# INSERT DATA{ inst:my_index :createConnector # tell us what resources you want to index and which predicate # values about them. We support predicate chains if the properties of # the resource are not direct } When you add/change resources that match the criteria, we will automatically update the external store Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
  • 13. Real time synchronization Create a link with a special predicate and we are going to index/synchronize resources in the external store PREFIX : http://www.ontotext.com/connectors/elasticsearch# PREFIX inst: http://www.ontotext.com/connectors/elasticsearch/instance# INSERT DATA{ inst:my_index :createConnector # tell us what resources you want to index and which predicate # values about them. We support predicate chains if the properties of # the resource are not direct } When you add/change resources that match the criteria, we will automatically update the external store Note This might slow your insert statements a little bit(our tests show that this time is negligible) Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
  • 14. Example data with wines Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
  • 15. Example data with wines Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
  • 16. Example data with wines @prefix rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# . @prefix rdfs: http://www.w3.org/2000/01/rdf-schema# . @prefix xsd: http://www.w3.org/2001/XMLSchema# . @prefix : http://www.ontotext.com/example/wine# . :RedWine rdfs:subClassOf :Wine . :WhiteWine rdfs:subClassOf :Wine . :RoseWine rdfs:subClassOf :Wine . :Merlo rdf:type :Grape ; rdfs:label Merlo . :CabernetSauvignon rdf:type :Grape ; rdfs:label Cabernet Sauvignon . :CabernetFranc rdf:type :Grape ; rdfs:label Cabernet Franc . :PinotNoir rdf:type :Grape ; rdfs:label Pinot Noir . :Chardonnay rdf:type :Grape ; rdfs:label Chardonnay . Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
  • 17. Example data with wines :Yoyowine rdf:type :RedWine ; :madeFromGrape :CabernetSauvignon ; :hasSugar dry ; :hasYear 2013^^xsd:integer . :Franvino rdf:type :RedWine ; :madeFromGrape :Merlo ; :madeFromGrape :CabernetFranc ; :hasSugar dry ; :hasYear 2012^^xsd:integer . :Noirette rdf:type :RedWine ; :madeFromGrape :PinotNoir ; :hasSugar medium ; :hasYear 2012^^xsd:integer . :Blanquito rdf:type :WhiteWine ; :madeFromGrape :Chardonnay ; :hasSugar dry ; :hasYear 2012^^xsd:integer . :Rozova rdf:type :RoseWine ; :madeFromGrape :PinotNoir ; :hasSugar medium ; :hasYear 2013^^xsd:integer . Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
  • 18. Create our wines index PREFIX : http://www.ontotext.com/connectors/elasticsearch# PREFIX inst: http://www.ontotext.com/connectors/elasticsearch/instance# INSERT DATA { inst:wines :createConnector { elasticsearchNode: localhost:9300, types: [ http://www.ontotext.com/example/wine#Wine ], fields: [ { fieldName: grape, propertyChain: [ http://www.ontotext.com/example/wine#madeFromGrape, http://www.w3.org/2000/01/rdf-schema#label ] }, { fieldName: sugar, propertyChain: [http://www.ontotext.com/example/wine#hasSugar], sort: true }, { fieldName: year, propertyChain: [http://www.ontotext.com/example/wine#hasYear] } ] } . } Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
  • 19. But wait, I dont understand all this json stuff... Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
  • 20. But wait, I dont understand all this json stuff... Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
  • 21. Elasticsearch index Given our wines small dataset, here is what will get indexed in elasticsearch wine year grape sugar :Yoyowine 2013 Cabernet Sauvignon dry :Noirette 2012 Pinot Noir medium :Blanquito 2012 Chardonnay dry :Franvino 2012 Merlo, Cabernet Franc dry :Rozova 2013 Pinot Noir medium Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
  • 22. You can query the index and join the results in SPARQL PREFIX : http://www.ontotext.com/connectors/elasticsearch# PREFIX inst: http://www.ontotext.com/connectors/elasticsearch/instance# SELECT ?entity { ?search a inst:index-name ; :query full-text-query ; :entities ?entity . # Do anything you want with the bound entity } Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
  • 23. Get wines that are made from cabernet grape PREFIX : http://www.ontotext.com/connectors/elasticsearch# PREFIX inst: http://www.ontotext.com/connectors/elasticsearch/instance# PREFIX wine: http://www.ontotext.com/example/wine# SELECT ?wine ?year { ?search a inst:wines ; :query grape:cabernet ; :entities ?wine . # We combine the results from elasticsearch and join them in graphdb ?wine wine:hasYear ?year } Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
  • 24. Get wines that are made from cabernet grape PREFIX : http://www.ontotext.com/connectors/elasticsearch# PREFIX inst: http://www.ontotext.com/connectors/elasticsearch/instance# PREFIX wine: http://www.ontotext.com/example/wine# SELECT ?wine ?year { ?search a inst:wines ; :query grape:cabernet ; :entities ?wine . # We combine the results from elasticsearch and join them in graphdb ?wine wine:hasYear ?year } Wine Year :Yoyowine 2013 :Franvino 2012 Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
  • 25. Other things that we expose for the matches The matching snippet for the full-text query Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
  • 26. Other things that we expose for the matches The matching snippet for the full-text query The score from elasticsearch for the match Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
  • 27. Other things that we expose for the matches The matching snippet for the full-text query The score from elasticsearch for the match Total number of hits in the external store Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
  • 28. Other things that we expose for the matches The matching snippet for the full-text query The score from elasticsearch for the match Total number of hits in the external store Ordering the external store results Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
  • 29. Faceting Usecase LCIE Co-occurrence Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
  • 30. Faceting Usecase LCIE Co-occurrence Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
  • 31. Faceting Usecase LCIE Facets and Full-text Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
  • 32. Faceting Usecase LCIE Facets and Full-text Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
  • 33. Faceting Usecase Global Capital Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
  • 34. Faceting Usecase PREFIX : http://www.ontotext.com/connectors/elasticsearch# PREFIX inst: http://www.ontotext.com/connectors/elasticsearch/instance# SELECT ?facetName ?facetValue ?facetCount WHERE{ # note empty query is allowed and will just match all documents, hence no :query ?r a inst:wines_index ; :facetFields year,sugar ; :facets _:f . _:f :facetName ?facetName . _:f :facetValue ?facetValue . _:f :facetCount ?facetCount . } Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
  • 35. Faceting Usecase PREFIX : http://www.ontotext.com/connectors/elasticsearch# PREFIX inst: http://www.ontotext.com/connectors/elasticsearch/instance# SELECT ?facetName ?facetValue ?facetCount WHERE{ # note empty query is allowed and will just match all documents, hence no :query ?r a inst:wines_index ; :facetFields year,sugar ; :facets _:f . _:f :facetName ?facetName . _:f :facetValue ?facetValue . _:f :facetCount ?facetCount . } Facet Name Facet Value Facet Count year 2012 3 year 2013 2 sugar dry 3 sugar medium 2 Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
  • 36. Entity filtering(Advanced topic) A way to filter resources that land in the external store based the field value Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
  • 37. Entity filtering(Advanced topic) A way to filter resources that land in the external store based the field value Allows you to use the same predicate/property chain for different fields(based on a filter) Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
  • 38. Entity filtering(Advanced topic) A way to filter resources that land in the external store based the field value Allows you to use the same predicate/property chain for different fields(based on a filter) Consider the usecase of articles that reference people, locations, etc Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
  • 39. Entity filtering PREFIX : http://www.ontotext.com/connectors/elasticsearch# PREFIX inst: http://www.ontotext.com/connectors/elasticsearch/instance# INSERT DATA { inst:my_index :createConnector { elasticsearchNode: localhost:9200, types: [http://www.ontotext.com/example2#Article], fields: [ { fieldName: comment, propertyChain: [http://www.w3.org/2000/01/rdf-schema#comment] }, { fieldName: taggedWithPerson, propertyChain: [http://www.ontotext.com/example2#taggedWith] }, { fieldName: taggedWithLocation, propertyChain: [http://www.ontotext.com/example2#taggedWith] } ], entityFilter: ?taggedWithPerson type in (http://www.ontotext.com/example2#Person) ?taggedWithLocation type in (http://www.ontotext.com/example2#Location) } . } Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
  • 40. Things that dont work right now but will in the near future support for remote external stores(solr, elasticsearch) in graphdb cluster setup filtering anywhere in the property chain(we support only filtering the indexed value) filtering implicit from explicit statements Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
  • 41. Query tree Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors
  • 42. Thank You https://confluence.ontotext.com/display/GraphDB6/GraphDB+Connectors Questions? Nikola Petrovnikola.petrov@ontotext.com GraphDB Connectors