diff --git a/404.html b/404.html index 4bbc7f89a..f72b24a0f 100644 --- a/404.html +++ b/404.html @@ -6,11 +6,11 @@ Ontop - +
- + diff --git a/assets/js/11.187ca5d7.js b/assets/js/11.9c479812.js similarity index 95% rename from assets/js/11.187ca5d7.js rename to assets/js/11.9c479812.js index 56bdc5065..e8c853e3f 100644 --- a/assets/js/11.187ca5d7.js +++ b/assets/js/11.9c479812.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[11],{389:function(t,o,n){"use strict";n.r(o);var i=n(51),r=Object(i.a)({},(function(){var t=this,o=t.$createElement,n=t._self._c||o;return n("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[n("h1",{attrs:{id:"how-to-contribute"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#how-to-contribute"}},[t._v("#")]),t._v(" How to contribute")]),t._v(" "),n("p",[t._v("Contributions from the community are essential for an open-source project like Ontop and are warmly welcomed.")]),t._v(" "),n("p",[t._v("You can contribute in many differents ways, including:")]),t._v(" "),n("ul",[n("li",[n("a",{attrs:{href:"/community/contributing/bug-report"}},[t._v("Filling a bug report")])]),t._v(" "),n("li",[n("a",{attrs:{href:"/community/contributing/pull-request"}},[t._v("Proposing a pull request")])]),t._v(" "),n("li",[n("a",{attrs:{href:"/community/contributing/documentation"}},[t._v("Improving the documentation")])]),t._v(" "),n("li",[n("a",{attrs:{href:"/community/support"}},[t._v("Participating to the mailing list")])]),t._v(" "),n("li",[t._v("Posting about Ontop")]),t._v(" "),n("li",[n("a",{attrs:{href:"/community/contributing/jobs"}},[t._v("Applying to a job position related to Ontop")])])])])}),[],!1,null,null,null);o.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[11],{388:function(t,o,n){"use strict";n.r(o);var i=n(51),r=Object(i.a)({},(function(){var t=this,o=t.$createElement,n=t._self._c||o;return n("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[n("h1",{attrs:{id:"how-to-contribute"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#how-to-contribute"}},[t._v("#")]),t._v(" How to contribute")]),t._v(" "),n("p",[t._v("Contributions from the community are essential for an open-source project like Ontop and are warmly welcomed.")]),t._v(" "),n("p",[t._v("You can contribute in many differents ways, including:")]),t._v(" "),n("ul",[n("li",[n("a",{attrs:{href:"/community/contributing/bug-report"}},[t._v("Filling a bug report")])]),t._v(" "),n("li",[n("a",{attrs:{href:"/community/contributing/pull-request"}},[t._v("Proposing a pull request")])]),t._v(" "),n("li",[n("a",{attrs:{href:"/community/contributing/documentation"}},[t._v("Improving the documentation")])]),t._v(" "),n("li",[n("a",{attrs:{href:"/community/support"}},[t._v("Participating to the mailing list")])]),t._v(" "),n("li",[t._v("Posting about Ontop")]),t._v(" "),n("li",[n("a",{attrs:{href:"/community/contributing/jobs"}},[t._v("Applying to a job position related to Ontop")])])])])}),[],!1,null,null,null);o.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/12.6ee50bb8.js b/assets/js/12.473c4f1c.js similarity index 98% rename from assets/js/12.6ee50bb8.js rename to assets/js/12.473c4f1c.js index 3cc95bcd8..74ab2bf1a 100644 --- a/assets/js/12.6ee50bb8.js +++ b/assets/js/12.473c4f1c.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[12],{388:function(e,t,o){"use strict";o.r(t);var a=o(51),r=Object(a.a)({},(function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[o("h1",{attrs:{id:"bug-report"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#bug-report"}},[e._v("#")]),e._v(" Bug report")]),e._v(" "),o("p",[e._v("If you are sure you found a bug, use "),o("a",{attrs:{href:"https://github.com/ontop/ontop/issues",target:"_blank",rel:"noopener"}},[e._v("GitHub Issues"),o("OutboundLink")],1),e._v(" to submit the report; otherwise, start a discussion in the "),o("a",{attrs:{href:"https://groups.google.com/d/forum/ontop4obda",target:"_blank",rel:"noopener"}},[e._v("mailing list"),o("OutboundLink")],1),e._v(".")]),e._v(" "),o("p",[e._v("When reporting a bug, please make sure that you are using "),o("a",{attrs:{href:"/guide/getting-started"}},[e._v("the latest version of Ontop")]),e._v(" and provide a minimal reproducible example.")]),e._v(" "),o("h2",{attrs:{id:"reporting-a-possible-bug"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#reporting-a-possible-bug"}},[e._v("#")]),e._v(" Reporting a possible bug")]),e._v(" "),o("ul",[o("li",[e._v("Perform a search between current and past issues. If it is an open issue, add a comment to the existing issue instead of opening a new one.")]),e._v(" "),o("li",[e._v("Let us know which version and which setting of Ontop you are using (Protégé, SPARQL endpoint, CLI, Java API)")]),e._v(" "),o("li",[e._v("State what happened and also state what you expected to see.")]),e._v(" "),o("li",[e._v("If you have precise steps to reproduce the bug, explain each step and send us a set of ontology/mappings/query (as small as possible) so we can reproduce the problem. Otherwise send us the complete ontology, mapping and query files.")]),e._v(" "),o("li",[e._v("If you cannot reliably reproduce the test provide details about how often the problem happens and under which conditions it normally happens.")]),e._v(" "),o("li",[e._v("If the program generated an error, report what the error message was and how it occurred.")]),e._v(" "),o("li",[e._v("Add the log file in debug mode to help us to track the issue (more information follows).")])]),e._v(" "),o("h3",{attrs:{id:"how-to-generate-the-log-file"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#how-to-generate-the-log-file"}},[e._v("#")]),e._v(" How to generate the log file")]),e._v(" "),o("h4",{attrs:{id:"enable-protege-log"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#enable-protege-log"}},[e._v("#")]),e._v(" Enable Protégé log")]),e._v(" "),o("p",[e._v("You should go to the folder "),o("em",[e._v("conf")]),e._v(" of Protégé and modify the line of the "),o("em",[e._v("logback.xml")]),e._v(" file from "),o("code",[e._v('')]),e._v(" to "),o("code",[e._v('')]),e._v(".\nWhen you restart Protégé you will have more information in the command line, that can be useful to understand the problem.\nYou can send us the generated log file from Protégé starting from "),o("em",[e._v("Window -> Show log... -> Show log file -> protege.log")])]),e._v(" "),o("h4",{attrs:{id:"enable-command-line-interface-log"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#enable-command-line-interface-log"}},[e._v("#")]),e._v(" Enable Command Line Interface log")]),e._v(" "),o("p",[e._v("Go to the folder "),o("em",[e._v("log")]),e._v(" and modify the line of the "),o("em",[e._v("logback.xml")]),e._v(" file from "),o("code",[e._v('')]),e._v(" to "),o("code",[e._v('')]),e._v(".")]),e._v(" "),o("h4",{attrs:{id:"enable-logging-in-the-docker-image"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#enable-logging-in-the-docker-image"}},[e._v("#")]),e._v(" Enable logging in the Docker image")]),e._v(" "),o("p",[e._v("Define the environment variable "),o("a",{attrs:{href:"https://hub.docker.com/r/ontop/ontop",target:"_blank",rel:"noopener"}},[o("code",[e._v("ONTOP_DEBUG")]),o("OutboundLink")],1),e._v(" ("),o("code",[e._v('ONTOP_DEBUG = "true"')]),e._v(").")]),e._v(" "),o("h2",{attrs:{id:"asking-for-help-or-information"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#asking-for-help-or-information"}},[e._v("#")]),e._v(" Asking for help or information")]),e._v(" "),o("p",[e._v("See "),o("a",{attrs:{href:"/community/support"}},[e._v("the support page")]),e._v(".")])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[12],{389:function(e,t,o){"use strict";o.r(t);var a=o(51),r=Object(a.a)({},(function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[o("h1",{attrs:{id:"bug-report"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#bug-report"}},[e._v("#")]),e._v(" Bug report")]),e._v(" "),o("p",[e._v("If you are sure you found a bug, use "),o("a",{attrs:{href:"https://github.com/ontop/ontop/issues",target:"_blank",rel:"noopener"}},[e._v("GitHub Issues"),o("OutboundLink")],1),e._v(" to submit the report; otherwise, start a discussion in the "),o("a",{attrs:{href:"https://groups.google.com/d/forum/ontop4obda",target:"_blank",rel:"noopener"}},[e._v("mailing list"),o("OutboundLink")],1),e._v(".")]),e._v(" "),o("p",[e._v("When reporting a bug, please make sure that you are using "),o("a",{attrs:{href:"/guide/getting-started"}},[e._v("the latest version of Ontop")]),e._v(" and provide a minimal reproducible example.")]),e._v(" "),o("h2",{attrs:{id:"reporting-a-possible-bug"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#reporting-a-possible-bug"}},[e._v("#")]),e._v(" Reporting a possible bug")]),e._v(" "),o("ul",[o("li",[e._v("Perform a search between current and past issues. If it is an open issue, add a comment to the existing issue instead of opening a new one.")]),e._v(" "),o("li",[e._v("Let us know which version and which setting of Ontop you are using (Protégé, SPARQL endpoint, CLI, Java API)")]),e._v(" "),o("li",[e._v("State what happened and also state what you expected to see.")]),e._v(" "),o("li",[e._v("If you have precise steps to reproduce the bug, explain each step and send us a set of ontology/mappings/query (as small as possible) so we can reproduce the problem. Otherwise send us the complete ontology, mapping and query files.")]),e._v(" "),o("li",[e._v("If you cannot reliably reproduce the test provide details about how often the problem happens and under which conditions it normally happens.")]),e._v(" "),o("li",[e._v("If the program generated an error, report what the error message was and how it occurred.")]),e._v(" "),o("li",[e._v("Add the log file in debug mode to help us to track the issue (more information follows).")])]),e._v(" "),o("h3",{attrs:{id:"how-to-generate-the-log-file"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#how-to-generate-the-log-file"}},[e._v("#")]),e._v(" How to generate the log file")]),e._v(" "),o("h4",{attrs:{id:"enable-protege-log"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#enable-protege-log"}},[e._v("#")]),e._v(" Enable Protégé log")]),e._v(" "),o("p",[e._v("You should go to the folder "),o("em",[e._v("conf")]),e._v(" of Protégé and modify the line of the "),o("em",[e._v("logback.xml")]),e._v(" file from "),o("code",[e._v('')]),e._v(" to "),o("code",[e._v('')]),e._v(".\nWhen you restart Protégé you will have more information in the command line, that can be useful to understand the problem.\nYou can send us the generated log file from Protégé starting from "),o("em",[e._v("Window -> Show log... -> Show log file -> protege.log")])]),e._v(" "),o("h4",{attrs:{id:"enable-command-line-interface-log"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#enable-command-line-interface-log"}},[e._v("#")]),e._v(" Enable Command Line Interface log")]),e._v(" "),o("p",[e._v("Go to the folder "),o("em",[e._v("log")]),e._v(" and modify the line of the "),o("em",[e._v("logback.xml")]),e._v(" file from "),o("code",[e._v('')]),e._v(" to "),o("code",[e._v('')]),e._v(".")]),e._v(" "),o("h4",{attrs:{id:"enable-logging-in-the-docker-image"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#enable-logging-in-the-docker-image"}},[e._v("#")]),e._v(" Enable logging in the Docker image")]),e._v(" "),o("p",[e._v("Define the environment variable "),o("a",{attrs:{href:"https://hub.docker.com/r/ontop/ontop",target:"_blank",rel:"noopener"}},[o("code",[e._v("ONTOP_DEBUG")]),o("OutboundLink")],1),e._v(" ("),o("code",[e._v('ONTOP_DEBUG = "true"')]),e._v(").")]),e._v(" "),o("h2",{attrs:{id:"asking-for-help-or-information"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#asking-for-help-or-information"}},[e._v("#")]),e._v(" Asking for help or information")]),e._v(" "),o("p",[e._v("See "),o("a",{attrs:{href:"/community/support"}},[e._v("the support page")]),e._v(".")])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/14.3e333554.js b/assets/js/14.cabf7cc1.js similarity index 97% rename from assets/js/14.3e333554.js rename to assets/js/14.cabf7cc1.js index f9bda29ca..21094e725 100644 --- a/assets/js/14.3e333554.js +++ b/assets/js/14.cabf7cc1.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[14],{392:function(e,t,o){"use strict";o.r(t);var r=o(51),n=Object(r.a)({},(function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[o("h1",{attrs:{id:"pull-request"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#pull-request"}},[e._v("#")]),e._v(" Pull request")]),e._v(" "),o("p",[e._v("Contributions to the project are welcome and encouraged. You can propose some Pull Requests (PR) on Github. By making a PR on the Github platform, you declare to agree with the standard "),o("em",[e._v('"inbound = outbound"')]),e._v(" licensing practice, as foreseen by the "),o("a",{attrs:{href:"https://help.github.com/en/github/site-policy/github-terms-of-service#6-contributions-under-repository-license",target:"_blank",rel:"noopener"}},[e._v("Github terms"),o("OutboundLink")],1),e._v(". There is no need anymore for regular contributors to sign a CLA.")]),e._v(" "),o("p",[e._v("If you are thinking about implementing a new feature, feel free to engage a discussion with the team through the mailing list or through another medium.")]),e._v(" "),o("h2",{attrs:{id:"contribution-license-agreement-for-core-developers"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#contribution-license-agreement-for-core-developers"}},[e._v("#")]),e._v(" Contribution License Agreement (for core developers)")]),e._v(" "),o("p",[e._v("Core developers should sign a Contribution License Agreement (CLA) that allows FUB and the Ontop team to redistribute their work under the terms of the Apache 2.0 license. If the contributor works for an institution that owns the work being contributed by the contributor, then a corporate CLA must be additionally signed. The CLAs are available for download below, once signed please email a scanned copy of them.")]),e._v(" "),o("ul",[o("li",[o("a",{attrs:{href:"https://raw.github.com/ontop/ontop/master/documentation/ontop-cla-2013-11-04.txt",target:"_blank",rel:"noopener"}},[e._v("Individual Contributor License Agreement (CLA)"),o("OutboundLink")],1)]),e._v(" "),o("li",[o("a",{attrs:{href:"https://raw.github.com/ontop/ontop/master/documentation/ontop-cla-corporate-2013-11-04.txt",target:"_blank",rel:"noopener"}},[e._v("Corporate License Agreement"),o("OutboundLink")],1)])])])}),[],!1,null,null,null);t.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[14],{391:function(e,t,o){"use strict";o.r(t);var r=o(51),n=Object(r.a)({},(function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[o("h1",{attrs:{id:"pull-request"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#pull-request"}},[e._v("#")]),e._v(" Pull request")]),e._v(" "),o("p",[e._v("Contributions to the project are welcome and encouraged. You can propose some Pull Requests (PR) on Github. By making a PR on the Github platform, you declare to agree with the standard "),o("em",[e._v('"inbound = outbound"')]),e._v(" licensing practice, as foreseen by the "),o("a",{attrs:{href:"https://help.github.com/en/github/site-policy/github-terms-of-service#6-contributions-under-repository-license",target:"_blank",rel:"noopener"}},[e._v("Github terms"),o("OutboundLink")],1),e._v(". There is no need anymore for regular contributors to sign a CLA.")]),e._v(" "),o("p",[e._v("If you are thinking about implementing a new feature, feel free to engage a discussion with the team through the mailing list or through another medium.")]),e._v(" "),o("h2",{attrs:{id:"contribution-license-agreement-for-core-developers"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#contribution-license-agreement-for-core-developers"}},[e._v("#")]),e._v(" Contribution License Agreement (for core developers)")]),e._v(" "),o("p",[e._v("Core developers should sign a Contribution License Agreement (CLA) that allows FUB and the Ontop team to redistribute their work under the terms of the Apache 2.0 license. If the contributor works for an institution that owns the work being contributed by the contributor, then a corporate CLA must be additionally signed. The CLAs are available for download below, once signed please email a scanned copy of them.")]),e._v(" "),o("ul",[o("li",[o("a",{attrs:{href:"https://raw.github.com/ontop/ontop/master/documentation/ontop-cla-2013-11-04.txt",target:"_blank",rel:"noopener"}},[e._v("Individual Contributor License Agreement (CLA)"),o("OutboundLink")],1)]),e._v(" "),o("li",[o("a",{attrs:{href:"https://raw.github.com/ontop/ontop/master/documentation/ontop-cla-corporate-2013-11-04.txt",target:"_blank",rel:"noopener"}},[e._v("Corporate License Agreement"),o("OutboundLink")],1)])])])}),[],!1,null,null,null);t.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/15.186ec000.js b/assets/js/15.8ec0d624.js similarity index 97% rename from assets/js/15.186ec000.js rename to assets/js/15.8ec0d624.js index 332818ff4..dbf8351bf 100644 --- a/assets/js/15.186ec000.js +++ b/assets/js/15.8ec0d624.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[15],{391:function(e,t,n){"use strict";n.r(t);var o=n(51),a=Object(o.a)({},(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[n("h1",{attrs:{id:"organizations"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#organizations"}},[e._v("#")]),e._v(" Organizations")]),e._v(" "),n("p",[e._v("Here we mention some of the organizations actively involved into the development of Ontop.")]),e._v(" "),n("h2",{attrs:{id:"free-university-of-bozen-bolzano"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#free-university-of-bozen-bolzano"}},[e._v("#")]),e._v(" Free University of Bozen-Bolzano")]),e._v(" "),n("p",[e._v("The "),n("a",{attrs:{href:"https://www.inf.unibz.it/krdb/in2data/",target:"_blank",rel:"noopener"}},[e._v("In2Data research group"),n("OutboundLink")],1),e._v(" initiated and continues to lead the development of Ontop.")]),e._v(" "),n("h2",{attrs:{id:"ontopic-s-r-l"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#ontopic-s-r-l"}},[e._v("#")]),e._v(" Ontopic s.r.l.")]),e._v(" "),n("p",[n("a",{attrs:{href:"https://ontopic.ai/",target:"_blank",rel:"noopener"}},[e._v("Ontopic"),n("OutboundLink")],1),e._v(" is the first spin-off of Free University of Bozen-Bolzano and has been co-founded by some members of the In2Data research group.\nIts mission is to help Ontop and the Virtual Knowledge Graph to become mainstream.\nOntopic provides a "),n("a",{attrs:{href:"https://ontopic.ai/en/ontopic-studio/",target:"_blank",rel:"noopener"}},[e._v("no-code mapping editor, Ontopic Studio,"),n("OutboundLink")],1),e._v(" and professional services.")]),e._v(" "),n("h2",{attrs:{id:"birkbeck-university-of-london"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#birkbeck-university-of-london"}},[e._v("#")]),e._v(" Birkbeck, University of London")]),e._v(" "),n("p",[e._v("The "),n("a",{attrs:{href:"http://www.dcs.bbk.ac.uk/",target:"_blank",rel:"noopener"}},[e._v("Birkbeck"),n("OutboundLink")],1),e._v(" group have been\nextensively involved in the development of Ontop since 2012. They have\nworked on the theoretical foundations of the VKG approach, including\nquery rewriting and optimisation, and contributed to the code base.")])])}),[],!1,null,null,null);t.default=a.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[15],{392:function(e,t,n){"use strict";n.r(t);var o=n(51),a=Object(o.a)({},(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[n("h1",{attrs:{id:"organizations"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#organizations"}},[e._v("#")]),e._v(" Organizations")]),e._v(" "),n("p",[e._v("Here we mention some of the organizations actively involved into the development of Ontop.")]),e._v(" "),n("h2",{attrs:{id:"free-university-of-bozen-bolzano"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#free-university-of-bozen-bolzano"}},[e._v("#")]),e._v(" Free University of Bozen-Bolzano")]),e._v(" "),n("p",[e._v("The "),n("a",{attrs:{href:"https://www.inf.unibz.it/krdb/in2data/",target:"_blank",rel:"noopener"}},[e._v("In2Data research group"),n("OutboundLink")],1),e._v(" initiated and continues to lead the development of Ontop.")]),e._v(" "),n("h2",{attrs:{id:"ontopic-s-r-l"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#ontopic-s-r-l"}},[e._v("#")]),e._v(" Ontopic s.r.l.")]),e._v(" "),n("p",[n("a",{attrs:{href:"https://ontopic.ai/",target:"_blank",rel:"noopener"}},[e._v("Ontopic"),n("OutboundLink")],1),e._v(" is the first spin-off of Free University of Bozen-Bolzano and has been co-founded by some members of the In2Data research group.\nIts mission is to help Ontop and the Virtual Knowledge Graph to become mainstream.\nOntopic provides a "),n("a",{attrs:{href:"https://ontopic.ai/en/ontopic-studio/",target:"_blank",rel:"noopener"}},[e._v("no-code mapping editor, Ontopic Studio,"),n("OutboundLink")],1),e._v(" and professional services.")]),e._v(" "),n("h2",{attrs:{id:"birkbeck-university-of-london"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#birkbeck-university-of-london"}},[e._v("#")]),e._v(" Birkbeck, University of London")]),e._v(" "),n("p",[e._v("The "),n("a",{attrs:{href:"http://www.dcs.bbk.ac.uk/",target:"_blank",rel:"noopener"}},[e._v("Birkbeck"),n("OutboundLink")],1),e._v(" group have been\nextensively involved in the development of Ontop since 2012. They have\nworked on the theoretical foundations of the VKG approach, including\nquery rewriting and optimisation, and contributed to the code base.")])])}),[],!1,null,null,null);t.default=a.exports}}]); \ No newline at end of file diff --git a/assets/js/17.23c168f3.js b/assets/js/17.b6df6df1.js similarity index 96% rename from assets/js/17.23c168f3.js rename to assets/js/17.b6df6df1.js index 2e925a253..c1ffb17b8 100644 --- a/assets/js/17.23c168f3.js +++ b/assets/js/17.b6df6df1.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[17],{394:function(t,e,a){"use strict";a.r(e);var r=a(51),s=Object(r.a)({},(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"overview"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[t._v("#")]),t._v(" Overview")]),t._v(" "),a("p",[t._v("The development chapter is targeted to those interested in the development of the Ontop framework.")]),t._v(" "),a("h2",{attrs:{id:"how-tos"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#how-tos"}},[t._v("#")]),t._v(" How-tos")]),t._v(" "),a("ul",[a("li",[a("a",{attrs:{href:"/dev/git"}},[t._v("Conventions for Git")])]),t._v(" "),a("li",[a("a",{attrs:{href:"/dev/build"}},[t._v("Build Ontop")])]),t._v(" "),a("li",[a("a",{attrs:{href:"/dev/new-release"}},[t._v("Make a new release")])]),t._v(" "),a("li",[a("a",{attrs:{href:"/dev/db-adapter"}},[t._v("Extend Ontop to support a new database system")])]),t._v(" "),a("li",[t._v("Debug:\n"),a("ul",[a("li",[a("a",{attrs:{href:"/dev/debug-protege"}},[t._v("Protégé")])]),t._v(" "),a("li",[a("a",{attrs:{href:"/dev/debug-jetty"}},[t._v("Jetty with RDF4J workbench")])])])])]),t._v(" "),a("h2",{attrs:{id:"internals"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#internals"}},[t._v("#")]),t._v(" Internals")]),t._v(" "),a("p",[t._v("Information about the internals of Ontop")]),t._v(" "),a("ul",[a("li",[a("a",{attrs:{href:"/dev/internals/iq"}},[t._v("Intermediate Query")]),t._v(" data structure")]),t._v(" "),a("li",[a("a",{attrs:{href:"/dev/internals/guice"}},[t._v("Guice Conventions")])])])])}),[],!1,null,null,null);e.default=s.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[17],{396:function(t,e,a){"use strict";a.r(e);var r=a(51),s=Object(r.a)({},(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"overview"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[t._v("#")]),t._v(" Overview")]),t._v(" "),a("p",[t._v("The development chapter is targeted to those interested in the development of the Ontop framework.")]),t._v(" "),a("h2",{attrs:{id:"how-tos"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#how-tos"}},[t._v("#")]),t._v(" How-tos")]),t._v(" "),a("ul",[a("li",[a("a",{attrs:{href:"/dev/git"}},[t._v("Conventions for Git")])]),t._v(" "),a("li",[a("a",{attrs:{href:"/dev/build"}},[t._v("Build Ontop")])]),t._v(" "),a("li",[a("a",{attrs:{href:"/dev/new-release"}},[t._v("Make a new release")])]),t._v(" "),a("li",[a("a",{attrs:{href:"/dev/db-adapter"}},[t._v("Extend Ontop to support a new database system")])]),t._v(" "),a("li",[t._v("Debug:\n"),a("ul",[a("li",[a("a",{attrs:{href:"/dev/debug-protege"}},[t._v("Protégé")])]),t._v(" "),a("li",[a("a",{attrs:{href:"/dev/debug-jetty"}},[t._v("Jetty with RDF4J workbench")])])])])]),t._v(" "),a("h2",{attrs:{id:"internals"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#internals"}},[t._v("#")]),t._v(" Internals")]),t._v(" "),a("p",[t._v("Information about the internals of Ontop")]),t._v(" "),a("ul",[a("li",[a("a",{attrs:{href:"/dev/internals/iq"}},[t._v("Intermediate Query")]),t._v(" data structure")]),t._v(" "),a("li",[a("a",{attrs:{href:"/dev/internals/guice"}},[t._v("Guice Conventions")])])])])}),[],!1,null,null,null);e.default=s.exports}}]); \ No newline at end of file diff --git a/assets/js/18.1de16b6c.js b/assets/js/18.fd0e0bcf.js similarity index 99% rename from assets/js/18.1de16b6c.js rename to assets/js/18.fd0e0bcf.js index a64909e47..68cea562b 100644 --- a/assets/js/18.1de16b6c.js +++ b/assets/js/18.fd0e0bcf.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[18],{395:function(e,o,t){"use strict";t.r(o);var n=t(51),i=Object(n.a)({},(function(){var e=this,o=e.$createElement,t=e._self._c||o;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"build-ontop-bundles"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#build-ontop-bundles"}},[e._v("#")]),e._v(" Build Ontop Bundles")]),e._v(" "),t("h3",{attrs:{id:"requirements"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#requirements"}},[e._v("#")]),e._v(" Requirements")]),e._v(" "),t("ul",[t("li",[t("p",[e._v("a Linux, Mac OS X or Windows machine;")])]),e._v(" "),t("li",[t("p",[e._v("git, for checking out Ontop code (refer to installation instructions for your OS/distribution);")])]),e._v(" "),t("li",[t("p",[e._v("Java 11 (JDK, not JRE, refer to installation instructions for your OS/distribution);")])]),e._v(" "),t("li",[t("p",[e._v("JAVA_HOME environment variable correctly set up and pointing to a Java 11 JDK.\nRun "),t("code",[e._v("echo $JAVA_HOME")]),e._v(" (on Windows: "),t("code",[e._v("echo %JAVA_HOME%")]),e._v(") and check the path printed (if any).\nIf the variable is unset, you can set it temporarily in the terminal session using "),t("code",[e._v("export JAVA_HOME=[path]")]),e._v(" (on Windows: "),t("code",[e._v('setx JAVA_HOME -m "[path]"')]),e._v("), where [path] points to the JDK installation (the directory containing bin, lib, etc).\nThis setting may be made persistent by editing your "),t("code",[e._v("~/.bash_profile")]),e._v(" (on Windows, edit System and Security > System > Advanced System Settings > Environment Variables). In particular, for Mac OS X")]),e._v(" "),t("div",{staticClass:"language-console extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("$ vim ~/.bash_profile\nAdd this line: export JAVA_HOME=$(/usr/libexec/java_home)\n$ source ~/.bash_profile\n")])])])]),e._v(" "),t("li",[t("p",[e._v("Maven 3.6.0 or later, with "),t("code",[e._v("mvn")]),e._v(" command available on "),t("code",[e._v("PATH")]),e._v(". Run")]),e._v(" "),t("div",{staticClass:"language-console extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('$ mvn -v\nApache Maven 3.9.0 (9b58d2bad23a66be161c4664ef21ce219c2c8584)\nMaven home: /opt/maven/current\nJava version: 11.0.17, vendor: Debian, runtime: /usr/lib/jvm/java-11-openjdk-amd64\nDefault locale: en_US, platform encoding: UTF-8\nOS name: "linux", version: "6.1.0-3-amd64", arch: "amd64", family: "unix"\n')])])]),t("p",[e._v("Check the versions of Maven (3.9.0 > 3.6.0 in the example) and Java (11.0.17, i.e. Java 11).")])])]),e._v(" "),t("h3",{attrs:{id:"checkout-ontop-source-code"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#checkout-ontop-source-code"}},[e._v("#")]),e._v(" Checkout Ontop source code")]),e._v(" "),t("p",[e._v("In a terminal, move to the parent directory where you want to checkout Ontop, and run")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("$ git clone https://github.com/ontop/ontop.git\n$ cd ontop\n")])])]),t("h3",{attrs:{id:"build-all-bundles"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#build-all-bundles"}},[e._v("#")]),e._v(" Build all bundles")]),e._v(" "),t("p",[e._v("Starting from Ontop 4.1, from the root directory of Ontop source code tree, run")]),e._v(" "),t("div",{staticClass:"language-console extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("$ mvn -Dmaven.test.skip -Prelease\n")])])]),t("p",[e._v("The command compiles Ontop modules and generates the Ontop bundles distributed on GitHub, whose files are written in two directories.")]),e._v(" "),t("p",[e._v("Under "),t("code",[e._v("build/distribution/target/")]),e._v(":")]),e._v(" "),t("ul",[t("li",[t("strong",[t("code",[e._v("ontop-cli-[ontop-version].zip")])]),e._v(" - libraries/scripts to use ontop from the command line and setup a SPARQL endpoint;")])]),e._v(" "),t("p",[e._v("Under "),t("code",[e._v("protege/distribution/target/")]),e._v(":")]),e._v(" "),t("ul",[t("li",[t("strong",[t("code",[e._v("it.unibz.inf.ontop.protege-[ontop-version].jar")])]),e._v(" - plugin for Protégé 5.x installation files (drop it in Protégé’s plugins folder);")]),e._v(" "),t("li",[t("strong",[t("code",[e._v("ontop-protege-bundle-platform-independent-[ontop-version].zip")])]),e._v(" - Protégé 5.x bundled with Ontop plugin and ready to run (just unzip and use the "),t("code",[e._v("run.sh")]),e._v(" or "),t("code",[e._v("run.bat")]),e._v(" scripts);")]),e._v(" "),t("li",[t("strong",[t("code",[e._v("ontop-protege-bundle-linux-[ontop-version].zip")])]),e._v(" - as above, for Linux;")]),e._v(" "),t("li",[t("strong",[t("code",[e._v("ontop-protege-bundle-os-x-[ontop-version].zip")])]),e._v(" - as above, for Mac OS X;")]),e._v(" "),t("li",[t("strong",[t("code",[e._v("ontop-protege-bundle-win-[ontop-version].zip")])]),e._v(" - as above, for Windows.")])]),e._v(" "),t("p",[e._v("Notes:")]),e._v(" "),t("ul",[t("li",[e._v("profile activation "),t("code",[e._v("-Prelease")]),e._v(" enables the generation of all the Ontop bundles as well as source code and Javadoc JARs needed for publishing on Maven Central (if this profile is omitted, only JAR files for Ontop binaries are created);")]),e._v(" "),t("li",[e._v("option "),t("code",[e._v("-Dmaven.test.skip")]),e._v(" disables the compiling and execution of unit and integration tests (generally performed at release time) to speed up the process - omit it to enable tests, e.g., for testing changes to source code (note: may also use "),t("code",[e._v("-DskipTests")]),e._v(" that disables executing tests, but still compiles them);")]),e._v(" "),t("li",[e._v("the build may be performed also by running script "),t("code",[e._v("build-release.sh")]),e._v(" ("),t("code",[e._v("build-release.cmd")]),e._v(" on Windows), which works also in older Ontop versions (4.0.3 or earlier). In these older versions, the script generates bundles in sub-directories "),t("code",[e._v("ontop-cli")]),e._v(", "),t("code",[e._v("ontop-protege")]),e._v(", and "),t("code",[e._v("ontop-webapps")]),e._v(" of directory "),t("code",[e._v("build/distribution")]),e._v(", and also generates bundles for Jetty 9 + RDF4J workbench + Ontop and for Tomcat 8 + RDF4J workbench + Ontop. These bundles have been "),t("a",{attrs:{href:"https://ontop-vkg.org/guide/releases.html#_4-0-0-rc-1-july-8-2020",target:"_blank",rel:"noopener"}},[e._v("deprecated in Ontop 4"),t("OutboundLink")],1),e._v(" and "),t("a",{attrs:{href:"https://ontop-vkg.org/guide/releases.html#_5-0-0-december-31-2022",target:"_blank",rel:"noopener"}},[e._v("completely removed since Ontop 5"),t("OutboundLink")],1),e._v(".")])]),e._v(" "),t("h3",{attrs:{id:"build-specific-bundles"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#build-specific-bundles"}},[e._v("#")]),e._v(" Build specific bundles")]),e._v(" "),t("p",[e._v("Starting from version "),t("code",[e._v("4.1")]),e._v(" and further revised in version "),t("code",[e._v("5.0.2")]),e._v(", we provide Maven profiles to build specific Ontop bundles as quickly as possible (with respect to using the above 'build all' command), which may come in handy when modifying Ontop source code. Specifically:")]),e._v(" "),t("ul",[t("li",[t("p",[e._v("to build the Ontop command line tool only, i.e., "),t("code",[e._v("ontop-cli-[ontop-version].zip")]),e._v(" (note: up to version "),t("code",[e._v("5.0.1")]),e._v(", "),t("code",[e._v("asset-cli")]),e._v(" was "),t("code",[e._v("cli")]),e._v(" and tests were disabled by default)")]),e._v(" "),t("div",{staticClass:"language-console extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("$ mvn -Dmaven.test.skip -Passet-cli\n")])])])]),e._v(" "),t("li",[t("p",[e._v("to build the Ontop Protégé plugin, i.e., "),t("code",[e._v("it.unibz.inf.ontop.protege-[ontop-version].jar")]),e._v(" (profile available since version "),t("code",[e._v("5.0.2")]),e._v(")")]),e._v(" "),t("div",{staticClass:"language-console extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("$ mvn -Dmaven.test.skip -Passet-plugin\n")])])])]),e._v(" "),t("li",[t("p",[e._v("to build the Ontop Protégé plugin "),t("code",[e._v("it.unibz.inf.ontop.protege-[ontop-version].jar")]),e._v(" as well as the "),t("code",[e._v("ontop-protege-bundle-[platform]-[ontop-version].zip")]),e._v(" Protégé bundles including it (note: up to version "),t("code",[e._v("5.0.1")]),e._v(", "),t("code",[e._v("asset-protege")]),e._v(" was "),t("code",[e._v("protege")]),e._v(" and tests were disabled by default)")]),e._v(" "),t("div",{staticClass:"language-console extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("$ mvn -Dmaven.test.skip -Passet-protege\n")])])])])]),e._v(" "),t("p",[e._v("The Maven profiles "),t("code",[e._v("asset-cli")]),e._v(", "),t("code",[e._v("asset-plugin")]),e._v(", "),t("code",[e._v("asset-protege")]),e._v(" employed in the commands above exclude unneeded artifacts from the build, which is thus faster. These profiles can be arbitrarily combined to produce multiple bundles, e.g., "),t("code",[e._v("mvn -Passet-cli,asset-protege")]),e._v(" to generate both command line tool and Protégé bundles (from version 4.1 up to version 5 excluded, it was possible to build the RDF4 workbench + Ontop files by enabling profile "),t("code",[e._v("webapps")]),e._v(", now removed).")]),e._v(" "),t("h3",{attrs:{id:"compiling-the-ontop-protege-plugin"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#compiling-the-ontop-protege-plugin"}},[e._v("#")]),e._v(" Compiling the Ontop Protégé plugin")]),e._v(" "),t("p",[e._v("Starting from version "),t("code",[e._v("5.0.2")]),e._v(", it is necessary to enable profile "),t("code",[e._v("plugin")]),e._v(" (or a profile depending on it, such as "),t("code",[e._v("asset-plugin")]),e._v(", "),t("code",[e._v("asset-protege")]),e._v(", or "),t("code",[e._v("release")]),e._v(") in order to compile "),t("code",[e._v("ontop-protege-plugin")]),e._v(". Note that "),t("strong",[e._v("commands "),t("code",[e._v("mvn compile")]),e._v(" and "),t("code",[e._v("mvn test")]),e._v(" will not work with profile "),t("code",[e._v("plugin")])]),e._v(" (or a depending profile) since compiling/testing "),t("code",[e._v("ontop-protege-plugin")]),e._v(" requires building "),t("code",[e._v("ontop-protege-dependencies:shaded")]),e._v(" first to "),t("a",{attrs:{href:"https://maven.apache.org/plugins/maven-shade-plugin/examples/class-relocation.html",target:"_blank",rel:"noopener"}},[e._v("relocate Guava via the Maven shade plugin"),t("OutboundLink")],1),e._v(", but this happens only during the "),t("code",[e._v("package")]),e._v(" lifecycle phase of Maven, i.e., starting from "),t("code",[e._v("mvn package")]),e._v(" or later phase. Unfortunately, relocating Guava is needed to avoid conflicts with the older Guava version used in Protégé and cannot be avoided, and doing that before the "),t("code",[e._v("package")]),e._v(" phase is not feasible. Therefore, developers should "),t("strong",[e._v("always use "),t("code",[e._v("mvn package -Pplugin")]),e._v(" or later phase when working with "),t("code",[e._v("ontop-protege-plugin")])]),e._v(", even when just compiling or testing is intended.")]),e._v(" "),t("h3",{attrs:{id:"other-useful-maven-commands"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#other-useful-maven-commands"}},[e._v("#")]),e._v(" Other useful Maven commands")]),e._v(" "),t("p",[e._v("The following Maven commands can be used to facilitate some build-related development tasks, the involved plugins (e.g., "),t("code",[e._v("license-maven-plugin")]),e._v(") being already configured in Ontop root "),t("code",[e._v("pom.xml")]),e._v(" file:")]),e._v(" "),t("ul",[t("li",[t("code",[e._v("mvn license:add-third-party")]),e._v(" - produces a report file "),t("code",[e._v("build/distribution/THIRD-PARTY.txt")]),e._v(" useful to verify the use of Java libraries with compatible licenses")]),e._v(" "),t("li",[t("code",[e._v("mvn org.codehaus.mojo:versions-maven-plugin:display-plugin-updates")]),e._v(" - check for Maven plugins that can be updated")]),e._v(" "),t("li",[t("code",[e._v("mvn org.codehaus.mojo:versions-maven-plugin:display-dependency-updates")]),e._v(" - check for dependencies that can be updated")]),e._v(" "),t("li",[t("code",[e._v("mvn dependency:analyze-duplicate")]),e._v(" - check there are no duplicate dependencies declared in "),t("code",[e._v("pom.xml")]),e._v(" files")]),e._v(" "),t("li",[t("code",[e._v("mvn dependency:analyze-dep-mgt")]),e._v(" - check that dependency versions under centralized "),t("code",[e._v("")]),e._v(" sections are not overridden in child "),t("code",[e._v("pom.xml")]),e._v(" files")]),e._v(" "),t("li",[t("code",[e._v("mvn dependency:analyze")]),e._v(" - check for "),t("em",[e._v("used and undeclared")]),e._v(" dependencies and for "),t("em",[e._v("unused and declared")]),e._v(" dependencies (both situations that should be avoided)")]),e._v(" "),t("li",[t("code",[e._v("mvn com.github.ekryd.sortpom:sortpom-maven-plugin:sort")]),e._v(" - sorts section of "),t("code",[e._v("pom.xml")]),e._v(" files, to improve consistency")]),e._v(" "),t("li",[t("code",[e._v("mvn net.revelc.code.formatter:formatter-maven-plugin:format")]),e._v(" - auto-formats the "),t("code",[e._v("pom.xml")]),e._v(" files, to improve consistency")])])])}),[],!1,null,null,null);o.default=i.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[18],{394:function(e,o,t){"use strict";t.r(o);var n=t(51),i=Object(n.a)({},(function(){var e=this,o=e.$createElement,t=e._self._c||o;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"build-ontop-bundles"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#build-ontop-bundles"}},[e._v("#")]),e._v(" Build Ontop Bundles")]),e._v(" "),t("h3",{attrs:{id:"requirements"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#requirements"}},[e._v("#")]),e._v(" Requirements")]),e._v(" "),t("ul",[t("li",[t("p",[e._v("a Linux, Mac OS X or Windows machine;")])]),e._v(" "),t("li",[t("p",[e._v("git, for checking out Ontop code (refer to installation instructions for your OS/distribution);")])]),e._v(" "),t("li",[t("p",[e._v("Java 11 (JDK, not JRE, refer to installation instructions for your OS/distribution);")])]),e._v(" "),t("li",[t("p",[e._v("JAVA_HOME environment variable correctly set up and pointing to a Java 11 JDK.\nRun "),t("code",[e._v("echo $JAVA_HOME")]),e._v(" (on Windows: "),t("code",[e._v("echo %JAVA_HOME%")]),e._v(") and check the path printed (if any).\nIf the variable is unset, you can set it temporarily in the terminal session using "),t("code",[e._v("export JAVA_HOME=[path]")]),e._v(" (on Windows: "),t("code",[e._v('setx JAVA_HOME -m "[path]"')]),e._v("), where [path] points to the JDK installation (the directory containing bin, lib, etc).\nThis setting may be made persistent by editing your "),t("code",[e._v("~/.bash_profile")]),e._v(" (on Windows, edit System and Security > System > Advanced System Settings > Environment Variables). In particular, for Mac OS X")]),e._v(" "),t("div",{staticClass:"language-console extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("$ vim ~/.bash_profile\nAdd this line: export JAVA_HOME=$(/usr/libexec/java_home)\n$ source ~/.bash_profile\n")])])])]),e._v(" "),t("li",[t("p",[e._v("Maven 3.6.0 or later, with "),t("code",[e._v("mvn")]),e._v(" command available on "),t("code",[e._v("PATH")]),e._v(". Run")]),e._v(" "),t("div",{staticClass:"language-console extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('$ mvn -v\nApache Maven 3.9.0 (9b58d2bad23a66be161c4664ef21ce219c2c8584)\nMaven home: /opt/maven/current\nJava version: 11.0.17, vendor: Debian, runtime: /usr/lib/jvm/java-11-openjdk-amd64\nDefault locale: en_US, platform encoding: UTF-8\nOS name: "linux", version: "6.1.0-3-amd64", arch: "amd64", family: "unix"\n')])])]),t("p",[e._v("Check the versions of Maven (3.9.0 > 3.6.0 in the example) and Java (11.0.17, i.e. Java 11).")])])]),e._v(" "),t("h3",{attrs:{id:"checkout-ontop-source-code"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#checkout-ontop-source-code"}},[e._v("#")]),e._v(" Checkout Ontop source code")]),e._v(" "),t("p",[e._v("In a terminal, move to the parent directory where you want to checkout Ontop, and run")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("$ git clone https://github.com/ontop/ontop.git\n$ cd ontop\n")])])]),t("h3",{attrs:{id:"build-all-bundles"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#build-all-bundles"}},[e._v("#")]),e._v(" Build all bundles")]),e._v(" "),t("p",[e._v("Starting from Ontop 4.1, from the root directory of Ontop source code tree, run")]),e._v(" "),t("div",{staticClass:"language-console extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("$ mvn -Dmaven.test.skip -Prelease\n")])])]),t("p",[e._v("The command compiles Ontop modules and generates the Ontop bundles distributed on GitHub, whose files are written in two directories.")]),e._v(" "),t("p",[e._v("Under "),t("code",[e._v("build/distribution/target/")]),e._v(":")]),e._v(" "),t("ul",[t("li",[t("strong",[t("code",[e._v("ontop-cli-[ontop-version].zip")])]),e._v(" - libraries/scripts to use ontop from the command line and setup a SPARQL endpoint;")])]),e._v(" "),t("p",[e._v("Under "),t("code",[e._v("protege/distribution/target/")]),e._v(":")]),e._v(" "),t("ul",[t("li",[t("strong",[t("code",[e._v("it.unibz.inf.ontop.protege-[ontop-version].jar")])]),e._v(" - plugin for Protégé 5.x installation files (drop it in Protégé’s plugins folder);")]),e._v(" "),t("li",[t("strong",[t("code",[e._v("ontop-protege-bundle-platform-independent-[ontop-version].zip")])]),e._v(" - Protégé 5.x bundled with Ontop plugin and ready to run (just unzip and use the "),t("code",[e._v("run.sh")]),e._v(" or "),t("code",[e._v("run.bat")]),e._v(" scripts);")]),e._v(" "),t("li",[t("strong",[t("code",[e._v("ontop-protege-bundle-linux-[ontop-version].zip")])]),e._v(" - as above, for Linux;")]),e._v(" "),t("li",[t("strong",[t("code",[e._v("ontop-protege-bundle-os-x-[ontop-version].zip")])]),e._v(" - as above, for Mac OS X;")]),e._v(" "),t("li",[t("strong",[t("code",[e._v("ontop-protege-bundle-win-[ontop-version].zip")])]),e._v(" - as above, for Windows.")])]),e._v(" "),t("p",[e._v("Notes:")]),e._v(" "),t("ul",[t("li",[e._v("profile activation "),t("code",[e._v("-Prelease")]),e._v(" enables the generation of all the Ontop bundles as well as source code and Javadoc JARs needed for publishing on Maven Central (if this profile is omitted, only JAR files for Ontop binaries are created);")]),e._v(" "),t("li",[e._v("option "),t("code",[e._v("-Dmaven.test.skip")]),e._v(" disables the compiling and execution of unit and integration tests (generally performed at release time) to speed up the process - omit it to enable tests, e.g., for testing changes to source code (note: may also use "),t("code",[e._v("-DskipTests")]),e._v(" that disables executing tests, but still compiles them);")]),e._v(" "),t("li",[e._v("the build may be performed also by running script "),t("code",[e._v("build-release.sh")]),e._v(" ("),t("code",[e._v("build-release.cmd")]),e._v(" on Windows), which works also in older Ontop versions (4.0.3 or earlier). In these older versions, the script generates bundles in sub-directories "),t("code",[e._v("ontop-cli")]),e._v(", "),t("code",[e._v("ontop-protege")]),e._v(", and "),t("code",[e._v("ontop-webapps")]),e._v(" of directory "),t("code",[e._v("build/distribution")]),e._v(", and also generates bundles for Jetty 9 + RDF4J workbench + Ontop and for Tomcat 8 + RDF4J workbench + Ontop. These bundles have been "),t("a",{attrs:{href:"https://ontop-vkg.org/guide/releases.html#_4-0-0-rc-1-july-8-2020",target:"_blank",rel:"noopener"}},[e._v("deprecated in Ontop 4"),t("OutboundLink")],1),e._v(" and "),t("a",{attrs:{href:"https://ontop-vkg.org/guide/releases.html#_5-0-0-december-31-2022",target:"_blank",rel:"noopener"}},[e._v("completely removed since Ontop 5"),t("OutboundLink")],1),e._v(".")])]),e._v(" "),t("h3",{attrs:{id:"build-specific-bundles"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#build-specific-bundles"}},[e._v("#")]),e._v(" Build specific bundles")]),e._v(" "),t("p",[e._v("Starting from version "),t("code",[e._v("4.1")]),e._v(" and further revised in version "),t("code",[e._v("5.0.2")]),e._v(", we provide Maven profiles to build specific Ontop bundles as quickly as possible (with respect to using the above 'build all' command), which may come in handy when modifying Ontop source code. Specifically:")]),e._v(" "),t("ul",[t("li",[t("p",[e._v("to build the Ontop command line tool only, i.e., "),t("code",[e._v("ontop-cli-[ontop-version].zip")]),e._v(" (note: up to version "),t("code",[e._v("5.0.1")]),e._v(", "),t("code",[e._v("asset-cli")]),e._v(" was "),t("code",[e._v("cli")]),e._v(" and tests were disabled by default)")]),e._v(" "),t("div",{staticClass:"language-console extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("$ mvn -Dmaven.test.skip -Passet-cli\n")])])])]),e._v(" "),t("li",[t("p",[e._v("to build the Ontop Protégé plugin, i.e., "),t("code",[e._v("it.unibz.inf.ontop.protege-[ontop-version].jar")]),e._v(" (profile available since version "),t("code",[e._v("5.0.2")]),e._v(")")]),e._v(" "),t("div",{staticClass:"language-console extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("$ mvn -Dmaven.test.skip -Passet-plugin\n")])])])]),e._v(" "),t("li",[t("p",[e._v("to build the Ontop Protégé plugin "),t("code",[e._v("it.unibz.inf.ontop.protege-[ontop-version].jar")]),e._v(" as well as the "),t("code",[e._v("ontop-protege-bundle-[platform]-[ontop-version].zip")]),e._v(" Protégé bundles including it (note: up to version "),t("code",[e._v("5.0.1")]),e._v(", "),t("code",[e._v("asset-protege")]),e._v(" was "),t("code",[e._v("protege")]),e._v(" and tests were disabled by default)")]),e._v(" "),t("div",{staticClass:"language-console extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("$ mvn -Dmaven.test.skip -Passet-protege\n")])])])])]),e._v(" "),t("p",[e._v("The Maven profiles "),t("code",[e._v("asset-cli")]),e._v(", "),t("code",[e._v("asset-plugin")]),e._v(", "),t("code",[e._v("asset-protege")]),e._v(" employed in the commands above exclude unneeded artifacts from the build, which is thus faster. These profiles can be arbitrarily combined to produce multiple bundles, e.g., "),t("code",[e._v("mvn -Passet-cli,asset-protege")]),e._v(" to generate both command line tool and Protégé bundles (from version 4.1 up to version 5 excluded, it was possible to build the RDF4 workbench + Ontop files by enabling profile "),t("code",[e._v("webapps")]),e._v(", now removed).")]),e._v(" "),t("h3",{attrs:{id:"compiling-the-ontop-protege-plugin"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#compiling-the-ontop-protege-plugin"}},[e._v("#")]),e._v(" Compiling the Ontop Protégé plugin")]),e._v(" "),t("p",[e._v("Starting from version "),t("code",[e._v("5.0.2")]),e._v(", it is necessary to enable profile "),t("code",[e._v("plugin")]),e._v(" (or a profile depending on it, such as "),t("code",[e._v("asset-plugin")]),e._v(", "),t("code",[e._v("asset-protege")]),e._v(", or "),t("code",[e._v("release")]),e._v(") in order to compile "),t("code",[e._v("ontop-protege-plugin")]),e._v(". Note that "),t("strong",[e._v("commands "),t("code",[e._v("mvn compile")]),e._v(" and "),t("code",[e._v("mvn test")]),e._v(" will not work with profile "),t("code",[e._v("plugin")])]),e._v(" (or a depending profile) since compiling/testing "),t("code",[e._v("ontop-protege-plugin")]),e._v(" requires building "),t("code",[e._v("ontop-protege-dependencies:shaded")]),e._v(" first to "),t("a",{attrs:{href:"https://maven.apache.org/plugins/maven-shade-plugin/examples/class-relocation.html",target:"_blank",rel:"noopener"}},[e._v("relocate Guava via the Maven shade plugin"),t("OutboundLink")],1),e._v(", but this happens only during the "),t("code",[e._v("package")]),e._v(" lifecycle phase of Maven, i.e., starting from "),t("code",[e._v("mvn package")]),e._v(" or later phase. Unfortunately, relocating Guava is needed to avoid conflicts with the older Guava version used in Protégé and cannot be avoided, and doing that before the "),t("code",[e._v("package")]),e._v(" phase is not feasible. Therefore, developers should "),t("strong",[e._v("always use "),t("code",[e._v("mvn package -Pplugin")]),e._v(" or later phase when working with "),t("code",[e._v("ontop-protege-plugin")])]),e._v(", even when just compiling or testing is intended.")]),e._v(" "),t("h3",{attrs:{id:"other-useful-maven-commands"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#other-useful-maven-commands"}},[e._v("#")]),e._v(" Other useful Maven commands")]),e._v(" "),t("p",[e._v("The following Maven commands can be used to facilitate some build-related development tasks, the involved plugins (e.g., "),t("code",[e._v("license-maven-plugin")]),e._v(") being already configured in Ontop root "),t("code",[e._v("pom.xml")]),e._v(" file:")]),e._v(" "),t("ul",[t("li",[t("code",[e._v("mvn license:add-third-party")]),e._v(" - produces a report file "),t("code",[e._v("build/distribution/THIRD-PARTY.txt")]),e._v(" useful to verify the use of Java libraries with compatible licenses")]),e._v(" "),t("li",[t("code",[e._v("mvn org.codehaus.mojo:versions-maven-plugin:display-plugin-updates")]),e._v(" - check for Maven plugins that can be updated")]),e._v(" "),t("li",[t("code",[e._v("mvn org.codehaus.mojo:versions-maven-plugin:display-dependency-updates")]),e._v(" - check for dependencies that can be updated")]),e._v(" "),t("li",[t("code",[e._v("mvn dependency:analyze-duplicate")]),e._v(" - check there are no duplicate dependencies declared in "),t("code",[e._v("pom.xml")]),e._v(" files")]),e._v(" "),t("li",[t("code",[e._v("mvn dependency:analyze-dep-mgt")]),e._v(" - check that dependency versions under centralized "),t("code",[e._v("")]),e._v(" sections are not overridden in child "),t("code",[e._v("pom.xml")]),e._v(" files")]),e._v(" "),t("li",[t("code",[e._v("mvn dependency:analyze")]),e._v(" - check for "),t("em",[e._v("used and undeclared")]),e._v(" dependencies and for "),t("em",[e._v("unused and declared")]),e._v(" dependencies (both situations that should be avoided)")]),e._v(" "),t("li",[t("code",[e._v("mvn com.github.ekryd.sortpom:sortpom-maven-plugin:sort")]),e._v(" - sorts section of "),t("code",[e._v("pom.xml")]),e._v(" files, to improve consistency")]),e._v(" "),t("li",[t("code",[e._v("mvn net.revelc.code.formatter:formatter-maven-plugin:format")]),e._v(" - auto-formats the "),t("code",[e._v("pom.xml")]),e._v(" files, to improve consistency")])])])}),[],!1,null,null,null);o.default=i.exports}}]); \ No newline at end of file diff --git a/assets/js/19.864fd591.js b/assets/js/19.319c82ab.js similarity index 99% rename from assets/js/19.864fd591.js rename to assets/js/19.319c82ab.js index 9084e8099..2de9d57cd 100644 --- a/assets/js/19.864fd591.js +++ b/assets/js/19.319c82ab.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[19],{397:function(t,a,s){"use strict";s.r(a);var e=s(51),n=Object(e.a)({},(function(){var t=this,a=t.$createElement,s=t._self._c||a;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"support-a-new-database-system"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#support-a-new-database-system"}},[t._v("#")]),t._v(" Support a new database system")]),t._v(" "),s("p",[t._v("This page describes how Ontop can be extended to support a novel relational database system (RDBMS).")]),t._v(" "),s("p",[t._v("The following RDBMSs are currently supported:")]),t._v(" "),s("ul",[s("li",[t._v("DB2")]),t._v(" "),s("li",[t._v("MySQL / MariaDB")]),t._v(" "),s("li",[t._v("Oracle")]),t._v(" "),s("li",[t._v("PostgreSQL")]),t._v(" "),s("li",[t._v("SQL server")]),t._v(" "),s("li",[t._v("H2")]),t._v(" "),s("li",[t._v("Denodo")]),t._v(" "),s("li",[t._v("Dremio")]),t._v(" "),s("li",[t._v("Apache Spark SQL & Databricks")]),t._v(" "),s("li",[t._v("Teiid")]),t._v(" "),s("li",[t._v("Snowflake")]),t._v(" "),s("li",[t._v("Trino")]),t._v(" "),s("li",[t._v("Presto")]),t._v(" "),s("li",[t._v("Athena")]),t._v(" "),s("li",[t._v("Redshift")]),t._v(" "),s("li",[t._v("DuckDB")])]),t._v(" "),s("p",[t._v("It is relatively easy though to extend Ontop's source code in order to support an additional RDBMS, thanks to dependency injection.")]),t._v(" "),s("div",{staticClass:"custom-block tip"},[s("p",{staticClass:"custom-block-title"},[t._v("New: Guided Implementation")]),t._v(" "),s("p",[t._v("Ontop also provides a "),s("a",{attrs:{href:"https://github.com/ontop/dialect-factory-scaffolding",target:"_blank",rel:"noopener"}},[t._v("python tool"),s("OutboundLink")],1),t._v(" that automatically generates a large part of the required code end simplifies the process of developing support for new SQL dialects.")]),t._v(" "),s("p",[t._v("Using it minimizes the overhead for the implementation of new dialect support and allows you to test your code easily right away.")])]),t._v(" "),s("p",[s("em",[t._v("This page provides a detailed explanation of the key concepts that need to be implemented, and was updated with Ontop 5.0.2. For newer versions of Ontop, it may no longer be up-to-date.")])]),t._v(" "),s("h2",{attrs:{id:"required-implementations"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#required-implementations"}},[t._v("#")]),t._v(" Required implementations")]),t._v(" "),s("p",[t._v("Two implementations must be provided, each for a different interface that already has a default (abstract) implementation.")]),t._v(" "),s("p",[t._v("These implementations dictate what the datatypes of the RDBMS are and how certain function symbols can be translated into the SQL dialect supported by the RDBMS.")]),t._v(" "),s("p",[t._v("The default implementation of each of these interfaces is often sufficient to handle many query operators and functions. As a result, only a few methods generally need to be overwritten,\nto account for specificities of the new SQL dialect.")]),t._v(" "),s("p",[t._v("The 2 required implementations are the DB function symbol factory and the DB datatype factory.")]),t._v(" "),s("h3",{attrs:{id:"db-function-symbol-factory"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#db-function-symbol-factory"}},[t._v("#")]),t._v(" DB function symbol factory")]),t._v(" "),s("p",[t._v("The "),s("em",[t._v("DB function symbol factory")]),t._v(" provides function symbols\nwhich can be directly serialized into the target SQL dialect (e.g. "),s("code",[t._v("LENGTH")]),t._v(" or "),s("code",[t._v("CURRENT_TIMESTAMP")]),t._v("). This factory has methods for common operations with precise semantics (e.g. concatenating 3 string arguments in a null-rejecting manner).")]),t._v(" "),s("p",[t._v("The interface to implement is "),s("code",[t._v("DBFunctionSymbolFactory")]),t._v("."),s("br"),t._v("\nAnd the default implementation is "),s("code",[t._v("AbstractSQLDBFunctionSymbolFactory")]),t._v(".")]),t._v(" "),s("p",[t._v("For instance, the DB function symbol factory for PostgreSQL within Ontop is the class "),s("code",[t._v("PostgreSQLDBFunctionSymbolFactory")]),t._v(".")]),t._v(" "),s("div",{staticClass:"custom-block warning"},[s("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),s("p",[t._v("This interface should not be confused with the "),s("code",[t._v("FunctionSymbolFactory")]),t._v(", which is in charge of constructing\nSPARQL function symbols and other function symbols that cannot be directly serialized into SQL.")])]),t._v(" "),s("p",[t._v("A basic template for this implementation is provided here:")]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("NewDialectDBFunctionSymbolFactory")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("AbstractSQLDBFunctionSymbolFactory")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Inject")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DuckDBDBFunctionSymbolFactory")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TypeFactory")]),t._v(" typeFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("super")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createNewDialectRegularFunctionTable")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("typeFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" typeFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableTable")]),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Integer")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DBFunctionSymbol")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createNewDialectRegularFunctionTable")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TypeFactory")]),t._v(" typeFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DBTypeFactory")]),t._v(" dbTypeFactory "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" typeFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getDBTypeFactory")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DBTermType")]),t._v(" abstractRootDBType "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" dbTypeFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getAbstractRootDBType")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Table")]),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Integer")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DBFunctionSymbol")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" table "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("HashBasedTable")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("create")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createDefaultRegularFunctionTable")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("typeFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/*\n ------------------------------------------\n - Changed Function Symbols -\n ------------------------------------------\n */")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableTable")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("copyOf")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("table"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/*\n ------------------------------------------\n - Implementations -\n ------------------------------------------\n */")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("In the template above, two code blocks are commented out. We will now look at each of them individually.")]),t._v(" "),s("h4",{attrs:{id:"changed-function-symbols"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#changed-function-symbols"}},[t._v("#")]),t._v(" "),s("strong",[t._v("Changed Function Symbols")])]),t._v(" "),s("p",[t._v("The "),s("em",[t._v("regular function table")]),t._v(" is a dictionary, that maps from function names to the function symbol instance it corresponds to. The abstract base classes we inherit from already define a default function symbol table that includes all commonly used SQL functions. In some cases, however, some of these default function symbols need to be changed. For these cases, new entries can be created in this block, to override existing, bad entries.")]),t._v(" "),s("p",[t._v("A popular example is the "),s("code",[t._v("CURRENT_TIMESTAMP")]),t._v(" function symbol. By default, it is created as a simple function with arity 0 of the form "),s("code",[t._v("CURRENT_TIMESTAMP()")]),t._v(". In some dialects, however, the current time is called without parentheses, simply in the form "),s("code",[t._v("CURRENT_TIMESTAMP")]),t._v(". In this case, we need to override the function symbol created by the default implementation, to not include parentheses:")]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DBFunctionSymbol")]),t._v(" nowFunctionSymbol "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("WithoutParenthesesSimpleTypedDBFunctionSymbolImpl")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n CURRENT_TIMESTAMP_STR"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" dbTypeFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getDBDateTimestampType")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" abstractRootDBType"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ntable"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("put")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("CURRENT_TIMESTAMP_STR"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" nowFunctionSymbol"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[t._v("The "),s("code",[t._v("CURRENT_TIMESTAMP")]),t._v(" function is now a "),s("code",[t._v("WithoutParenthesesSimpleTypedDBFunctionSymbol")]),t._v(", so when generating SQL queries, ontop will not include the parentheses. By putting this new function symbol into the table at the key "),s("code",[t._v("CURRENT_TIMESTAMP_STR")]),t._v(", we override the default behaviour that was put into the table by the default method.")]),t._v(" "),s("h4",{attrs:{id:"implementations"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#implementations"}},[t._v("#")]),t._v(" "),s("strong",[t._v("Implementations")])]),t._v(" "),s("p",[t._v("A set of serialization methods have been left abstract by the base classes. These "),s("em",[t._v("always")]),t._v(" have to be implemented for each new dialect.")]),t._v(" "),s("p",[t._v("All such methods share the same structure:")]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" serialize"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("FUNCTION_NAME"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableList")]),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableTerm")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" terms"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Function")]),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableTerm")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" termConverter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TermFactory")]),t._v(" termFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("Here, "),s("code",[t._v("terms")]),t._v(" is the list of arguments that were passed to the function, "),s("code",[t._v("termConverter")]),t._v(" ist a function that can be used to transform any given term into its SQL equivalent, and termFactory can be used to generate new terms that may be required for some functions.")]),t._v(" "),s("p",[t._v("We will now go through each of them and provide example implementations.")]),t._v(" "),s("p",[s("em",[s("strong",[t._v("Contains")])]),t._v(":")]),t._v(" "),s("p",[t._v("This function returns a boolean value, indicating whether a given string (argument 2) is included in a different string (argument 1). While some dialects have their own "),s("code",[t._v("CONTAINS")]),t._v(" functions, for others it may have to be implemented through a string search, like in this example:")]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("serializeContains")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableList")]),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableTerm")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" terms"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Function")]),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableTerm")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" termConverter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TermFactory")]),t._v(" termFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("format")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"(POSITION(%s IN %s) > 0)"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n termConverter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("apply")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("terms"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n termConverter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("apply")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("terms"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[s("em",[s("strong",[t._v("StrBefore")])]),t._v(":")]),t._v(" "),s("p",[t._v("This function returns the section of a given string (argument 1) before the first appearance of a given search string (argument 2). If the searched string is not contained in the base string, an empty string is returned instead. In many languages, this can be implemented using string search and substring methods.")]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("serializeStrBefore")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableList")]),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableTerm")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" terms"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Function")]),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableTerm")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" termConverter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TermFactory")]),t._v(" termFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" str "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" termConverter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("apply")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("terms"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" before "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" termConverter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("apply")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("terms"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("format")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"SUBSTRING(%s,1,POSITION(%s IN %s)-1)"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" str"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" before"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" str"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[s("em",[s("strong",[t._v("StrAfter")])]),t._v(":")]),t._v(" "),s("p",[t._v("The opposite of "),s("code",[t._v("STRBEFORE")]),t._v(", this function returns the section of a given string (argument 1) "),s("em",[t._v("after")]),t._v(" the first appearance of a search string (argument 2). This function can be implemented similarly:")]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("serializeStrBefore")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableList")]),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableTerm")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" terms"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Function")]),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableTerm")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" termConverter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TermFactory")]),t._v(" termFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" str "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" termConverter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("apply")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("terms"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" before "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" termConverter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("apply")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("terms"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("format")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"SUBSTRING(%s, IF(POSITION(%s IN %s) != 0, POSITION(%s IN %s) + LENGTH(%s), 0))"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" str"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" after"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" str"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" after"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" str"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" after"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[s("em",[s("strong",[t._v("Tz")])]),t._v(":\nThis function extracts the timezone part of a given timestamp. An example implementation may look like this:")]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("serializeTz")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableList")]),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableTerm")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" terms"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Function")]),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableTerm")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" termConverter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TermFactory")]),t._v(" termFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" str "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" termConverter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("apply")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("terms"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("format")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("\"(LPAD(EXTRACT(TIMEZONE_HOUR FROM %s)::text,2,'0') || ':' || LPAD(EXTRACT(TIMEZONE_MINUTE FROM %s)::text,2,'0'))\"")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" str"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" str"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[s("em",[s("strong",[t._v("DateTimeNorm")])]),t._v(":\nThis function converts a given timestamp to the standardized "),s("code",[t._v("ISO 8601")]),t._v(" format. An example implementation may look like this:")]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("serializeDateTimeNorm")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableList")]),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableTerm")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" terms"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Function")]),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableTerm")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" termConverter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TermFactory")]),t._v(" termFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("format")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"TO_ISO8601(%s)"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" termConverter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("apply")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("terms"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[s("em",[s("strong",[t._v("Hashing Functions")])]),t._v(":")]),t._v(" "),s("p",[t._v("Ontop supports a set of hasing functions:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("MD5")])]),t._v(" "),s("li",[s("code",[t._v("SHA1")])]),t._v(" "),s("li",[s("code",[t._v("SHA256")])]),t._v(" "),s("li",[s("code",[t._v("SHA384")])]),t._v(" "),s("li",[s("code",[t._v("SHA512")])])]),t._v(" "),s("p",[t._v("For each of them, the implementation of a serialization method is required. An example implementation of the "),s("code",[t._v("MD5")]),t._v(" function may look like this:")]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("serializeMD5")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableList")]),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableTerm")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" terms"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Function")]),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableTerm")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" termConverter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TermFactory")]),t._v(" termFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("format")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"MD5(%s)"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" termConverter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("apply")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("terms"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p"),t._v(" "),s("p",[t._v("Other than the serialization methods, four additional methods must be implemented by the subclass:")]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getUUIDNameInDialect")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"[UUID_FUNCTION_NAME]"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("returns the string that represents the name of the UUID in the SQL dialect.")]),t._v(" "),s("p",[t._v("The methods "),s("code",[t._v("createNullRejectingDBConcat(int arity)")]),t._v(", "),s("code",[t._v("createDBConcatOperator(int arity)")]),t._v(", and "),s("code",[t._v("createRegularDBConcat(int arity)")]),t._v(" need to be implemented to define the concat function symbols. The "),s("code",[t._v("DBConcat")]),t._v(" methods define function symbols that represent "),s("code",[t._v("CONCAT")]),t._v(" function calls of a given arity. Sample implementations for them may look like this:")]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DBConcatFunctionSymbol")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createRegularDBConcat")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" arity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("NullToleratingDBConcatFunctionSymbol")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"CONCAT"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" arity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" dbStringType"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" abstractRootDBType"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DBConcatFunctionSymbol")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createNullRejectingDBConcat")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" arity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("NullRejectingDBConcatFunctionSymbol")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"CONCAT_NO_NULL"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" arity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" dbStringType"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" abstractRootDBType"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("The "),s("code",[t._v("createDBConcatOperator(int arity)")]),t._v(" method represents a concat operation executed through a concat operator (often "),s("code",[t._v("+")]),t._v(" or "),s("code",[t._v("||")]),t._v("). It may be implemented like this:")]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DBConcatFunctionSymbol")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createDBConcatOperator")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" arity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("NullRejectingDBConcatFunctionSymbol")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"||"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" arity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" dbStringType"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" abstractRootDBType"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Serializers")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getOperatorSerializer")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"||"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h3",{attrs:{id:"db-datatype-factory"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#db-datatype-factory"}},[t._v("#")]),t._v(" DB Datatype factory")]),t._v(" "),s("p",[t._v("The "),s("em",[t._v("DB datatype factory")]),t._v(" declares the hierarchy of DB datatypes used by the DBMS, and specifies their correspondence with datatypes used in the RDF graphs (such as xsd datatypes).")]),t._v(" "),s("p",[t._v("The interface to implement (for SQL dialects) is "),s("code",[t._v("SQLDBTypeFactory")]),t._v("."),s("br"),t._v("\nAnd the default implementation is "),s("code",[t._v("DefaultSQLDBTypeFactory")]),t._v(" .")]),t._v(" "),s("p",[t._v("For instance, the datatype factory for PostgreSQL within Ontop is the class "),s("code",[t._v("PostgreSQLDBTypeFactory")]),t._v(".")]),t._v(" "),s("p",[t._v("A basic template for this implementation is provided here:")]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("NewDialectDBTypeFactory")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DefaultSQLDBTypeFactory")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/*\n ------------------------------------------\n - Type Definitions -\n ------------------------------------------\n */")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@AssistedInject")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("NewDialectDBTypeFactory")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Assisted")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TermType")]),t._v(" rootTermType"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Assisted")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TypeFactory")]),t._v(" typeFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("super")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createNewDialectTypeMap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("rootTermType"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" typeFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createNewDialectCodeMap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Map")]),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DBTermType")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createNewDialectTypeMap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TermType")]),t._v(" rootTermType"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TypeFactory")]),t._v(" typeFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/*\n ------------------------------------------\n - Type Map -\n ------------------------------------------\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableMap")]),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DefaultTypeCode")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createNewDialectCodeMap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/*\n ------------------------------------------\n - Code Map -\n ------------------------------------------\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/*\n ------------------------------------------\n - Support Flags -\n ------------------------------------------\n */")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("In the template above, four code blocks are commented out. We will now look at each of them individually.")]),t._v(" "),s("h4",{attrs:{id:"type-definitions"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#type-definitions"}},[t._v("#")]),t._v(" "),s("strong",[t._v("Type Definitions")])]),t._v(" "),s("p",[t._v("In this section, we define a set of "),s("code",[t._v("String")]),t._v(" constants that represent the names of datatypes in our SQL dialect. These constants are then used in other code blocks. An excerpt of the "),s("em",[t._v("type definitions")]),t._v(" part in an implementation may look like this:")]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" BIT_STR "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"BIT"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" INT2_STR "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"INT2"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" INT4_STR "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"INT4"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" INT8_STR "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"INT8"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" FLOAT4_STR "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"FLOAT4"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" FLOAT8_STR "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"FLOAT8"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h4",{attrs:{id:"type-map"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#type-map"}},[t._v("#")]),t._v(" "),s("strong",[t._v("TYPE MAP")])]),t._v(" "),s("p",[t._v("In this method, we define the contents of the type map for our dialect. We create "),s("code",[t._v("DBTermType")]),t._v(" instances for each supported type and store them in a "),s("code",[t._v("Map")]),t._v(" object, that matches their identifiers to the "),s("code",[t._v("DBTermType")]),t._v(". The base class we extend from already generates an extensive type map for many popular types, such as "),s("code",[t._v("VARCHAR")]),t._v(", "),s("code",[t._v("INTEGER")]),t._v(", "),s("code",[t._v("REAL")]),t._v(", "),s("code",[t._v("DOUBLE")]),t._v(", and more in the method "),s("code",[t._v("createDefaultSQLTypeMap(...)")]),t._v(". New types can be added to the map in the subclass, and, alternatively, we can override existing entries in the map here. An example implementation of this method may look like this:")]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Map")]),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DBTermType")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createNewDialectTypeMap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TermType")]),t._v(" rootTermType"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TypeFactory")]),t._v(" typeFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TermTypeAncestry")]),t._v(" rootAncestry "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" rootTermType"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getAncestry")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Map")]),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DBTermType")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" map "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createDefaultSQLTypeMap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("rootTermType"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" typeFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" map"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h4",{attrs:{id:"code-map"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#code-map"}},[t._v("#")]),t._v(" "),s("strong",[t._v("CODE MAP")])]),t._v(" "),s("p",[t._v('The code map is a dictionary, that maps different type codes to their "default type" for the SQL dialect. This includes the following type codes:')]),t._v(" "),s("ul",[s("li",[s("code",[t._v("STRING")])]),t._v(" "),s("li",[s("code",[t._v("HEXBINARY")])]),t._v(" "),s("li",[s("code",[t._v("LARGE_INTEGER")])]),t._v(" "),s("li",[s("code",[t._v("DECIMAL")])]),t._v(" "),s("li",[s("code",[t._v("DOUBLE")])]),t._v(" "),s("li",[s("code",[t._v("BOOLEAN")])]),t._v(" "),s("li",[s("code",[t._v("DATE")])]),t._v(" "),s("li",[s("code",[t._v("TIME")])]),t._v(" "),s("li",[s("code",[t._v("DATETIMESTAMP")])]),t._v(" "),s("li",[s("code",[t._v("GEOMETRY")])]),t._v(" "),s("li",[s("code",[t._v("GEOGRAPHY")])]),t._v(" "),s("li",[s("code",[t._v("ARRAY")])]),t._v(" "),s("li",[s("code",[t._v("JSON")])])]),t._v(" "),s("p",[t._v("The default implementation already maps many of these to the name of the corresponding data type. To support additional ones, or to override existing mappings, this method can be implemented. An example implementation may look like this:")]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableMap")]),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DefaultTypeCode")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createNewDialectCodeMap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Map")]),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DefaultTypeCode")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" map "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createDefaultSQLCodeMap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n map"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("put")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DefaultTypeCode")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("JSON"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" JSONB_STR"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableMap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("copyOf")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("map"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h4",{attrs:{id:"support-flags"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#support-flags"}},[t._v("#")]),t._v(" "),s("strong",[t._v("Support Flags")])]),t._v(" "),s("p",[t._v("An instance of "),s("code",[t._v("DBTypeFactory")]),t._v(" supports a set of methods that, when called, return a flag indicating if a certain SQL feature is supported by the dialect. These methods are")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("supportsDBGeometryType()")])]),t._v(" "),s("li",[s("code",[t._v("supportsDBGeographyType()")])]),t._v(" "),s("li",[s("code",[t._v("supportsDBDistanceSphere()")])]),t._v(" "),s("li",[s("code",[t._v("supportsJson()")])]),t._v(" "),s("li",[s("code",[t._v("supportsArrayType()")])])]),t._v(" "),s("p",[t._v("Any of these functions can be overridden by the "),s("code",[t._v("DBTypeFactory")]),t._v(" sub-class to return a boolean constant indicating if the type is supported.")]),t._v(" "),s("h4",{attrs:{id:"other-implementations"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#other-implementations"}},[t._v("#")]),t._v(" "),s("strong",[t._v("Other Implementations")])]),t._v(" "),s("p",[t._v("The "),s("code",[t._v("DBTypeFactory")]),t._v(" base-class supports further methods that can be included in sub-classes for fine-tuning. One popular set of such methods are the "),s("code",[t._v("LexicalValue")]),t._v(" methods. These return a "),s("code",[t._v("String")]),t._v(" constant that represents the lexical value the corresponding literal may assume. For instance, by default, the method "),s("code",[t._v("getDBFalseLexicalValue()")]),t._v(" returns the string "),s("code",[t._v('"FALSE"')]),t._v(", as this is a common representation of the boolean "),s("code",[t._v("false")]),t._v(" value in many SQL dialects. To implement the "),s("code",[t._v("DBTypeFactory")]),t._v(" for a dialect that instead uses the digit "),s("code",[t._v("0")]),t._v(" for "),s("code",[t._v("false")]),t._v(" literals, we could override the method like so:")]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getDBFalseLexicalValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h2",{attrs:{id:"optional-implementations"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#optional-implementations"}},[t._v("#")]),t._v(" Optional implementations")]),t._v(" "),s("p",[t._v("Additional implementations can be optionally provided in replacement of the default implementation.")]),t._v(" "),s("h3",{attrs:{id:"serializer"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#serializer"}},[t._v("#")]),t._v(" Serializer")]),t._v(" "),s("p",[t._v("The "),s("em",[t._v("serializer")]),t._v(" dictates the general shape (SELECT-FROM-WHERE) of the SQL query.")]),t._v(" "),s("p",[t._v("The interface to implement is "),s("code",[t._v("SelectFromWhereSerializer")]),t._v("."),s("br"),t._v("\nAnd the default implementation is "),s("code",[t._v("DefaultSelectFromWhereSerializer")]),t._v(".")]),t._v(" "),s("p",[t._v("For instance, the serializer for PostgreSQL within Ontop is the class "),s("code",[t._v("PostgresSelectFromWhereSerializer")]),t._v(".")]),t._v(" "),s("h3",{attrs:{id:"normalizer"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#normalizer"}},[t._v("#")]),t._v(" Normalizer")]),t._v(" "),s("p",[t._v("The "),s("em",[t._v("normalizer")]),t._v(" addresses limitations of certain DBMSs (such as a non-canonical evaluation of the ORDER BY clause).")]),t._v(" "),s("p",[t._v("The interface to implement is "),s("code",[t._v("DialectExtraNormalizer")]),t._v("."),s("br"),t._v("\nAnd several implementations are already available, some of which are used by several DBMS.")]),t._v(" "),s("p",[t._v("For instance, the normalizer associated to PostgreSQL within Ontop is "),s("code",[t._v("OnlyInPresenceOfDistinctProjectOrderByTermsNormalizer")]),t._v(".")]),t._v(" "),s("h3",{attrs:{id:"metadata-provider"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#metadata-provider"}},[t._v("#")]),t._v(" Metadata provider")]),t._v(" "),s("p",[t._v("The "),s("em",[t._v("metadata provider")]),t._v(" specifies how schema and integrity constraints (for instance primary keys) are retrieved from the DBMS.")]),t._v(" "),s("p",[t._v("The interface to implement is "),s("code",[t._v("MetadataProvider")]),t._v("."),s("br"),t._v("\nAnd the default implementation is "),s("code",[t._v("DefaultDBMetadataProvider")]),t._v(".")]),t._v(" "),s("p",[t._v("For instance, the metadata provider for PostgreSQL within Ontop is "),s("code",[t._v("PostgreSQLDBMetadataProvider")]),t._v(".")]),t._v(" "),s("h2",{attrs:{id:"declaring-an-implementation"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#declaring-an-implementation"}},[t._v("#")]),t._v(" Declaring an implementation")]),t._v(" "),s("p",[t._v("All the implementations mentioned above can be declared in the property file "),s("code",[t._v("sql-default.properties")]),t._v(" (which can be found in the directory "),s("code",[t._v("it/unibz/inf/ontop/injection/")]),t._v(" of the "),s("code",[t._v("ontop-rdb")]),t._v(" module).")]),t._v(" "),s("p",[t._v("A key-value pair must be added for each of these implementations, where the key indicates the type of the implementation (serializer, function symbol factory, etc.), and the value is the implementation.")]),t._v(" "),s("p",[t._v("The naming scheme for the keys is the following."),s("br"),t._v("\nLet "),s("code",[t._v("")]),t._v(" be the name of the JDBC driver for the RDBMS (for instance, the JDBC driver for PostgreSQL is "),s("code",[t._v("org.postgresql.Driver")]),t._v("."),s("br"),t._v("\nThen the keys are:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("-serializer")]),t._v(" for a serializer")]),t._v(" "),s("li",[s("code",[t._v("-symbolFactory")]),t._v(" for a DB function symbol factory")]),t._v(" "),s("li",[s("code",[t._v("-typeFactory")]),t._v(" for a DB datatype factory")]),t._v(" "),s("li",[s("code",[t._v("-normalizer")]),t._v(" for a normalizer")]),t._v(" "),s("li",[s("code",[t._v("-metadataProvider")]),t._v(" for a metadata provider")])]),t._v(" "),s("p",[t._v("For instance, the key-value pairs declared for PostgreSQL are:")]),t._v(" "),s("div",{staticClass:"language-properties extra-class"},[s("pre",{pre:!0,attrs:{class:"language-properties"}},[s("code",[s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("org.postgresql.Driver-serializer")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-value"}},[t._v("it.unibz.inf.ontop.generation.serializer.impl.PostgresSelectFromWhereSerializer")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("org.postgresql.Driver-symbolFactory")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-value"}},[t._v("it.unibz.inf.ontop.model.term.functionsymbol.db.impl.PostgreSQLDBFunctionSymbolFactory")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("org.postgresql.Driver-typeFactory")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-value"}},[t._v("it.unibz.inf.ontop.model.type.impl.PostgreSQLDBTypeFactory")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("org.postgresql.Driver-normalizer")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-value"}},[t._v("it.unibz.inf.ontop.generation.normalization.impl.OnlyInPresenceOfDistinctProjectOrderByTermsNormalizer")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("org.postgresql.Driver-metadataProvider")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-value"}},[t._v("it.unibz.inf.ontop.dbschema.impl.PostgreSQLDBMetadataProvider")]),t._v("\n")])])]),s("p",[t._v("A basic set of key-value pairs may be:")]),t._v(" "),s("div",{staticClass:"language-properties extra-class"},[s("pre",{pre:!0,attrs:{class:"language-properties"}},[s("code",[s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("name.of.jdbc.Driver-serializer")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-value"}},[t._v("it.unibz.inf.ontop.generation.serializer.impl.DefaultSelectFromWhereSerializer")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("name.of.jdbc.Driver-symbolFactory")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-value"}},[t._v("it.unibz.inf.ontop.model.term.functionsymbol.db.impl.NewDialectDBFunctionSymbolFactory")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("name.of.jdbc.Driver-typeFactory")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-value"}},[t._v("it.unibz.inf.ontop.model.type.impl.NewDialectDBTypeFactory")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("name.of.jdbc.Driver-normalizer")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-value"}},[t._v("it.unibz.inf.ontop.generation.normalization.impl.OnlyInPresenceOfDistinctProjectOrderByTermsNormalizer")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("name.of.jdbc.Driver-metadataProvider")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-value"}},[t._v("it.unibz.inf.ontop.dbschema.impl.DefaultSchemaCatalogDBMetadataProvider")]),t._v("\n")])])]),s("h2",{attrs:{id:"preparing-and-running-the-testcases"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#preparing-and-running-the-testcases"}},[t._v("#")]),t._v(" Preparing and Running the Testcases")]),t._v(" "),s("p",[t._v("Ontop currently uses a set of tests called "),s("code",[t._v("lightweight-tests")]),t._v(" to test all main ontop language support features on minimal databases. A simple way of testing the correctness of newly implemented dialect support is to run the same tests a database that uses the corresponding dialect.")]),t._v(" "),s("p",[t._v("This consists of the following steps:")]),t._v(" "),s("ol",[s("li",[t._v("Set up a database with the required testing conditions")]),t._v(" "),s("li",[t._v("Prepare files that assist the connection to the database")]),t._v(" "),s("li",[t._v("Implement sub-classes of the abstract lightweight test classes and run them")])]),t._v(" "),s("p",[t._v("In the following sections, we will discuss each of these steps.")]),t._v(" "),s("h3",{attrs:{id:"setting-up-the-database"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#setting-up-the-database"}},[t._v("#")]),t._v(" Setting up the Database")]),t._v(" "),s("p",[t._v("The exact procedure of the database preparation depends on the database system. In ontop, we generally use docker images that reproduce the exact same database state for each test run so we can test the different dialects automatically.")]),t._v(" "),s("p",[t._v("Each directory inside "),s("code",[t._v("test/lightweight-tests/lightweight-db-test-images/")]),t._v(" corresponds to one docker image, and many of them contain table definitions in "),s("code",[t._v(".sql")]),t._v(" file. For instance, the "),s("code",[t._v("mysql")]),t._v(" directory contains the exact definitions of the three databases that are used for testing, "),s("code",[t._v("books")]),t._v(", "),s("code",[t._v("dbconstraints")]),t._v(", and "),s("code",[t._v("university")]),t._v(".")]),t._v(" "),s("p",[t._v("To prepare the required testing conditions, you can take these "),s("code",[t._v(".sql")]),t._v(" files and run their queries on your database. Should any of the features not be supported, you will be required to either use alternative equivalent features to reach the same final database state, or disable the corresponding test cases.")]),t._v(" "),s("h3",{attrs:{id:"preparing-connection-files"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#preparing-connection-files"}},[t._v("#")]),t._v(" Preparing Connection Files")]),t._v(" "),s("p",[t._v("The directory "),s("code",[t._v("test/lightweight-tests/src/test/resources/")]),t._v(" contains files that are used for setting up an ontop connection with different databases, including "),s("code",[t._v(".obda")]),t._v(" files for the VKG creation and "),s("code",[t._v(".property")]),t._v(" files for JDBC connections. While the "),s("code",[t._v(".obda")]),t._v(" files can usually be reused for different systems, the "),s("code",[t._v(".property")]),t._v(" files must be included for each database system. The directories "),s("code",[t._v("books")]),t._v(" and "),s("code",[t._v("prof")]),t._v(" inside the test resources contain one sub directory for each dialect, where each sub directory in turn includes one "),s("code",[t._v(".properties")]),t._v(" file for the JDBC connection. The "),s("code",[t._v("dbconstraints")]),t._v(" and "),s("code",[t._v("university")]),t._v(" directories, on the other hand, directly contain "),s("code",[t._v(".property")]),t._v(" files for each dialect.")]),t._v(" "),s("p",[t._v("To run all lightweight tests for a new dialect, the corresponding files and directories have to be creates for its JDBC connection. In particular, the connection files should be created in such a way, that the corresponding database/schema of the test is selected as the default database/schema, as the "),s("code",[t._v(".obda")]),t._v(" files access the tables through relative paths.")]),t._v(" "),s("h3",{attrs:{id:"implementing-the-lightweight-test-classes"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#implementing-the-lightweight-test-classes"}},[t._v("#")]),t._v(" Implementing the Lightweight Test Classes")]),t._v(" "),s("p",[t._v("The directory "),s("code",[t._v("test/lightweight-tests/src/test/java/")]),t._v(" contains the test cases that have to run successfully for each new dialect. They are defined in the four abstract classes "),s("code",[t._v("AbstractBindTestWithFunctions")]),t._v(", "),s("code",[t._v("AbstractConstraintTest")]),t._v(", "),s("code",[t._v("AbstractDistinctInAggregateTest")]),t._v(", and "),s("code",[t._v("AbstractLeftJoinProfTest")]),t._v(".")]),t._v(" "),s("p",[t._v("For each new dialect, a new package has to be created at this location, containing the implementations of sub-classes for each of these abstract base classes.")]),t._v(" "),s("h4",{attrs:{id:"bindtestwithfunctions"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#bindtestwithfunctions"}},[t._v("#")]),t._v(" "),s("strong",[s("code",[t._v("BindTestWithFunctions")])])]),t._v(" "),s("p",[t._v("This test class tests all main SQL functions that are supported by ontop. It uses the "),s("code",[t._v("books")]),t._v(" database, as well as directly generated data through the SPARQL "),s("code",[t._v("BIND")]),t._v(" function. An example implementation of this class may look like this:")]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@NewDialectLightweightTest")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BindWithFunctionsNewDialectTest")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("AbstractBindTestWithFunctions")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" PROPERTIES_FILE "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/books/new-dialect/books-new-dialect.properties"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@BeforeAll")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("before")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("throws")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("IOException")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SQLException")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("initOBDA")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("OBDA_FILE"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" OWL_FILE"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" PROPERTIES_FILE"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@AfterAll")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("after")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("throws")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SQLException")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("release")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/*\n ------------------------------------------\n - Result Definitions -\n ------------------------------------------\n */")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("div",{staticClass:"custom-block tip"},[s("p",{staticClass:"custom-block-title"},[t._v("NOTE")]),t._v(" "),s("p",[t._v("Using the "),s("code",[t._v("@NewDialectLightweightTest")]),t._v(" annotation requires the definition of the annotation in the same package, similarly to how it was defined for other dialects.")])]),t._v(" "),s("p",[t._v('The code block "Result Definitions" is commented out in the above example. This code block may contain redefinitions of expected results that are tested in the base class. To do this, override the '),s("code",[t._v("get[TEST-NAME]ExpectedValues()")]),t._v(" method here. An example implementation may look like this:")]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableList")]),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getConstantIntegerDivideExpectedResults")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableList")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("of")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"\\"0.500\\"^^xsd:decimal"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("Should any of the functionalities not be supported by the SQL dialect, then the corresponding test case may simply be disabled with an exaplanation as to why it is not supported. An example for that may look like this:")]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Disabled")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"New Dialect does not support SHA384"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Test")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("testHashSHA384")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("super")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("testHashSHA384")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("Some test cases are disabled by default.")]),t._v(" "),s("h4",{attrs:{id:"constraint"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#constraint"}},[t._v("#")]),t._v(" "),s("strong",[s("code",[t._v("Constraint")])])]),t._v(" "),s("p",[t._v("This set of test cases tests for the correct interpretation of integrity constraints in the data. It uses the "),s("code",[t._v("dbconstraints")]),t._v(" database. An example implementation may look like this:")]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@NewDialectLightweightTest")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ConstraintNewDialectTest")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("AbstractConstraintTest")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" PROPERTIES_FILE "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/dbconstraints/dbconstraints-new-dialect.properties"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ConstraintNewDialectTest")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" method"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("super")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("method"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" PROPERTIES_FILE"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("Once again, specific tests may be disabled if they are not supported. For database systems that do not support integrity constraints, this class can be ignored.")]),t._v(" "),s("h4",{attrs:{id:"distinctinaggregate"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#distinctinaggregate"}},[t._v("#")]),t._v(" "),s("strong",[s("code",[t._v("DistinctInAggregate")])])]),t._v(" "),s("p",[t._v("This set of test cases runs queries containing aggregate functions that include the "),s("code",[t._v("DISTINCT")]),t._v(" keyword. It can be implemented analogously to the "),s("code",[t._v("BindWithFunctions")]),t._v(" test class.")]),t._v(" "),s("h4",{attrs:{id:"leftjoinprof"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#leftjoinprof"}},[t._v("#")]),t._v(" "),s("strong",[s("code",[t._v("LeftJoinProf")])])]),t._v(" "),s("p",[t._v("This set of test cases runs on the "),s("code",[t._v("university")]),t._v(" database. It accesses items that have to be taken from the database through "),s("code",[t._v("JOIN")]),t._v("s. Furthermore, it tests the optimization procedures employed by ontop to minimize the required number of joins. Once again, it can be implemented analogously to the "),s("code",[t._v("BindWithFunctions")]),t._v(" test class.")]),t._v(" "),s("p",[t._v("If the database management system does not support integrity constraints, many of these test cases will fail because the optimizations will not be performed.")]),t._v(" "),s("h2",{attrs:{id:"further-implementations-and-troubleshooting"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#further-implementations-and-troubleshooting"}},[t._v("#")]),t._v(" Further Implementations and Troubleshooting")]),t._v(" "),s("p",[t._v("Once the basic features and lightweight test cases have been implemented for a dialect, the tests can be run to determine which features still do not work correctly.")]),t._v(" "),s("p",[t._v("If a test case fails, its corresponding feature is likely not yet supported by the current implementation. In these cases, changes need to be applied to the implemented "),s("code",[t._v("DBTypeFactory")]),t._v(" or "),s("code",[t._v("DBFunctionSymbolFactory")]),t._v(" to solve the issue.")]),t._v(" "),s("p",[t._v("In some situations, however, issues may be caused by problems not related to database types or functions. In these cases, one of the following default implementations may also be extended for the new dialect.")]),t._v(" "),s("div",{staticClass:"custom-block tip"},[s("p",{staticClass:"custom-block-title"},[t._v("NOTE")]),t._v(" "),s("p",[t._v("New implementations of these classes have to be linked to the driver through the "),s("code",[t._v("sql-default.properties")]),t._v(" file.")])]),t._v(" "),s("h3",{attrs:{id:"defaultschemacatalogdbmetadataprovider-defaultschemadbmetadataprovider-or-defaultdbmetadataprovider"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#defaultschemacatalogdbmetadataprovider-defaultschemadbmetadataprovider-or-defaultdbmetadataprovider"}},[t._v("#")]),t._v(" "),s("strong",[s("code",[t._v("DefaultSchemaCatalogDBMetadataProvider")])]),t._v(", "),s("strong",[s("code",[t._v("DefaultSchemaDBMetadataProvider")])]),t._v(", or "),s("strong",[s("code",[t._v("DefaultDBMetadataProvider")])])]),t._v(" "),s("p",[t._v("If the "),s("code",[t._v("DBMetadataProvider")]),t._v(" assigned to the dialect is not able to perform its expected actions through its default implementation, it may have to be extended with a new sub-class that is particularly tailored for this dialect.")]),t._v(" "),s("p",[t._v("In that case, its methods may be overridden to change the default behavious. Commong targets include:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("insertIntegrityConstraints(...)")]),t._v(" if the dialect does not support integrity constraints.")]),t._v(" "),s("li",[s("code",[t._v("getRelationId(...)")]),t._v(" to return the ID of a given relation.")])]),t._v(" "),s("p",[t._v("Additionally, the constructor may be implemented to determine the default schema or default catalog names if they cannot be accessed directly throug the JDBC, or a different "),s("code",[t._v("QuotedIDFactory")]),t._v(" instance can be passed to the super-class to force ontop to generate quoted identifiers in a specific way.")]),t._v(" "),s("h3",{attrs:{id:"selectfromwhereserializer"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#selectfromwhereserializer"}},[t._v("#")]),t._v(" "),s("strong",[s("code",[t._v("SelectFromWhereSerializer")])])]),t._v(" "),s("p",[t._v("This class is responsible for the serialization of the SQL query frame. Different SQL dialects have different rules as to how the general shape of an SQL query have to be defined. For instance, some dialects allow users to combine "),s("code",[t._v("LIMIT")]),t._v(" and "),s("code",[t._v("OFFSET")]),t._v(" clauses as "),s("code",[t._v("LIMIT ,")]),t._v(", while others require the form "),s("code",[t._v("OFFSET LIMIT ")]),t._v(". The following shows a default implementation of a "),s("code",[t._v("SelectFromWhereSerializer")]),t._v(" to achieve the latter behaviour:")]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Singleton")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("NewDialectSelectFromWhereSerializer")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DefaultSelectFromWhereSerializer")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("implements")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SelectFromWhereSerializer")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Inject")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("NewDialectSelectFromWhereSerializer")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TermFactory")]),t._v(" termFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("super")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DefaultSQLTermSerializer")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("termFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("QuerySerialization")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("serialize")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SelectFromWhereWithModifiers")]),t._v(" selectFromWhere"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DBParameters")]),t._v(" dbParameters"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" selectFromWhere"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("acceptVisitor")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DefaultRelationVisitingSerializer")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("dbParameters"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getQuotedIDFactory")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("serializeLimitOffset")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" limit"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" offset"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" noSortCondition"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("format")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"OFFSET %d LIMIT %d"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" offset"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" limit"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])])}),[],!1,null,null,null);a.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[19],{395:function(t,a,s){"use strict";s.r(a);var e=s(51),n=Object(e.a)({},(function(){var t=this,a=t.$createElement,s=t._self._c||a;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"support-a-new-database-system"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#support-a-new-database-system"}},[t._v("#")]),t._v(" Support a new database system")]),t._v(" "),s("p",[t._v("This page describes how Ontop can be extended to support a novel relational database system (RDBMS).")]),t._v(" "),s("p",[t._v("The following RDBMSs are currently supported:")]),t._v(" "),s("ul",[s("li",[t._v("DB2")]),t._v(" "),s("li",[t._v("MySQL / MariaDB")]),t._v(" "),s("li",[t._v("Oracle")]),t._v(" "),s("li",[t._v("PostgreSQL")]),t._v(" "),s("li",[t._v("SQL server")]),t._v(" "),s("li",[t._v("H2")]),t._v(" "),s("li",[t._v("Denodo")]),t._v(" "),s("li",[t._v("Dremio")]),t._v(" "),s("li",[t._v("Apache Spark SQL & Databricks")]),t._v(" "),s("li",[t._v("Teiid")]),t._v(" "),s("li",[t._v("Snowflake")]),t._v(" "),s("li",[t._v("Trino")]),t._v(" "),s("li",[t._v("Presto")]),t._v(" "),s("li",[t._v("Athena")]),t._v(" "),s("li",[t._v("Redshift")]),t._v(" "),s("li",[t._v("DuckDB")])]),t._v(" "),s("p",[t._v("It is relatively easy though to extend Ontop's source code in order to support an additional RDBMS, thanks to dependency injection.")]),t._v(" "),s("div",{staticClass:"custom-block tip"},[s("p",{staticClass:"custom-block-title"},[t._v("New: Guided Implementation")]),t._v(" "),s("p",[t._v("Ontop also provides a "),s("a",{attrs:{href:"https://github.com/ontop/dialect-factory-scaffolding",target:"_blank",rel:"noopener"}},[t._v("python tool"),s("OutboundLink")],1),t._v(" that automatically generates a large part of the required code end simplifies the process of developing support for new SQL dialects.")]),t._v(" "),s("p",[t._v("Using it minimizes the overhead for the implementation of new dialect support and allows you to test your code easily right away.")])]),t._v(" "),s("p",[s("em",[t._v("This page provides a detailed explanation of the key concepts that need to be implemented, and was updated with Ontop 5.0.2. For newer versions of Ontop, it may no longer be up-to-date.")])]),t._v(" "),s("h2",{attrs:{id:"required-implementations"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#required-implementations"}},[t._v("#")]),t._v(" Required implementations")]),t._v(" "),s("p",[t._v("Two implementations must be provided, each for a different interface that already has a default (abstract) implementation.")]),t._v(" "),s("p",[t._v("These implementations dictate what the datatypes of the RDBMS are and how certain function symbols can be translated into the SQL dialect supported by the RDBMS.")]),t._v(" "),s("p",[t._v("The default implementation of each of these interfaces is often sufficient to handle many query operators and functions. As a result, only a few methods generally need to be overwritten,\nto account for specificities of the new SQL dialect.")]),t._v(" "),s("p",[t._v("The 2 required implementations are the DB function symbol factory and the DB datatype factory.")]),t._v(" "),s("h3",{attrs:{id:"db-function-symbol-factory"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#db-function-symbol-factory"}},[t._v("#")]),t._v(" DB function symbol factory")]),t._v(" "),s("p",[t._v("The "),s("em",[t._v("DB function symbol factory")]),t._v(" provides function symbols\nwhich can be directly serialized into the target SQL dialect (e.g. "),s("code",[t._v("LENGTH")]),t._v(" or "),s("code",[t._v("CURRENT_TIMESTAMP")]),t._v("). This factory has methods for common operations with precise semantics (e.g. concatenating 3 string arguments in a null-rejecting manner).")]),t._v(" "),s("p",[t._v("The interface to implement is "),s("code",[t._v("DBFunctionSymbolFactory")]),t._v("."),s("br"),t._v("\nAnd the default implementation is "),s("code",[t._v("AbstractSQLDBFunctionSymbolFactory")]),t._v(".")]),t._v(" "),s("p",[t._v("For instance, the DB function symbol factory for PostgreSQL within Ontop is the class "),s("code",[t._v("PostgreSQLDBFunctionSymbolFactory")]),t._v(".")]),t._v(" "),s("div",{staticClass:"custom-block warning"},[s("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),s("p",[t._v("This interface should not be confused with the "),s("code",[t._v("FunctionSymbolFactory")]),t._v(", which is in charge of constructing\nSPARQL function symbols and other function symbols that cannot be directly serialized into SQL.")])]),t._v(" "),s("p",[t._v("A basic template for this implementation is provided here:")]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("NewDialectDBFunctionSymbolFactory")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("AbstractSQLDBFunctionSymbolFactory")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Inject")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DuckDBDBFunctionSymbolFactory")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TypeFactory")]),t._v(" typeFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("super")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createNewDialectRegularFunctionTable")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("typeFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" typeFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableTable")]),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Integer")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DBFunctionSymbol")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createNewDialectRegularFunctionTable")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TypeFactory")]),t._v(" typeFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DBTypeFactory")]),t._v(" dbTypeFactory "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" typeFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getDBTypeFactory")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DBTermType")]),t._v(" abstractRootDBType "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" dbTypeFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getAbstractRootDBType")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Table")]),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Integer")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DBFunctionSymbol")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" table "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("HashBasedTable")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("create")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createDefaultRegularFunctionTable")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("typeFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/*\n ------------------------------------------\n - Changed Function Symbols -\n ------------------------------------------\n */")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableTable")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("copyOf")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("table"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/*\n ------------------------------------------\n - Implementations -\n ------------------------------------------\n */")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("In the template above, two code blocks are commented out. We will now look at each of them individually.")]),t._v(" "),s("h4",{attrs:{id:"changed-function-symbols"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#changed-function-symbols"}},[t._v("#")]),t._v(" "),s("strong",[t._v("Changed Function Symbols")])]),t._v(" "),s("p",[t._v("The "),s("em",[t._v("regular function table")]),t._v(" is a dictionary, that maps from function names to the function symbol instance it corresponds to. The abstract base classes we inherit from already define a default function symbol table that includes all commonly used SQL functions. In some cases, however, some of these default function symbols need to be changed. For these cases, new entries can be created in this block, to override existing, bad entries.")]),t._v(" "),s("p",[t._v("A popular example is the "),s("code",[t._v("CURRENT_TIMESTAMP")]),t._v(" function symbol. By default, it is created as a simple function with arity 0 of the form "),s("code",[t._v("CURRENT_TIMESTAMP()")]),t._v(". In some dialects, however, the current time is called without parentheses, simply in the form "),s("code",[t._v("CURRENT_TIMESTAMP")]),t._v(". In this case, we need to override the function symbol created by the default implementation, to not include parentheses:")]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DBFunctionSymbol")]),t._v(" nowFunctionSymbol "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("WithoutParenthesesSimpleTypedDBFunctionSymbolImpl")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n CURRENT_TIMESTAMP_STR"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" dbTypeFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getDBDateTimestampType")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" abstractRootDBType"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ntable"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("put")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("CURRENT_TIMESTAMP_STR"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" nowFunctionSymbol"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[t._v("The "),s("code",[t._v("CURRENT_TIMESTAMP")]),t._v(" function is now a "),s("code",[t._v("WithoutParenthesesSimpleTypedDBFunctionSymbol")]),t._v(", so when generating SQL queries, ontop will not include the parentheses. By putting this new function symbol into the table at the key "),s("code",[t._v("CURRENT_TIMESTAMP_STR")]),t._v(", we override the default behaviour that was put into the table by the default method.")]),t._v(" "),s("h4",{attrs:{id:"implementations"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#implementations"}},[t._v("#")]),t._v(" "),s("strong",[t._v("Implementations")])]),t._v(" "),s("p",[t._v("A set of serialization methods have been left abstract by the base classes. These "),s("em",[t._v("always")]),t._v(" have to be implemented for each new dialect.")]),t._v(" "),s("p",[t._v("All such methods share the same structure:")]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" serialize"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("FUNCTION_NAME"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableList")]),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableTerm")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" terms"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Function")]),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableTerm")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" termConverter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TermFactory")]),t._v(" termFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("Here, "),s("code",[t._v("terms")]),t._v(" is the list of arguments that were passed to the function, "),s("code",[t._v("termConverter")]),t._v(" ist a function that can be used to transform any given term into its SQL equivalent, and termFactory can be used to generate new terms that may be required for some functions.")]),t._v(" "),s("p",[t._v("We will now go through each of them and provide example implementations.")]),t._v(" "),s("p",[s("em",[s("strong",[t._v("Contains")])]),t._v(":")]),t._v(" "),s("p",[t._v("This function returns a boolean value, indicating whether a given string (argument 2) is included in a different string (argument 1). While some dialects have their own "),s("code",[t._v("CONTAINS")]),t._v(" functions, for others it may have to be implemented through a string search, like in this example:")]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("serializeContains")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableList")]),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableTerm")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" terms"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Function")]),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableTerm")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" termConverter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TermFactory")]),t._v(" termFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("format")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"(POSITION(%s IN %s) > 0)"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n termConverter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("apply")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("terms"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n termConverter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("apply")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("terms"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[s("em",[s("strong",[t._v("StrBefore")])]),t._v(":")]),t._v(" "),s("p",[t._v("This function returns the section of a given string (argument 1) before the first appearance of a given search string (argument 2). If the searched string is not contained in the base string, an empty string is returned instead. In many languages, this can be implemented using string search and substring methods.")]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("serializeStrBefore")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableList")]),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableTerm")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" terms"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Function")]),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableTerm")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" termConverter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TermFactory")]),t._v(" termFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" str "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" termConverter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("apply")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("terms"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" before "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" termConverter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("apply")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("terms"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("format")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"SUBSTRING(%s,1,POSITION(%s IN %s)-1)"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" str"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" before"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" str"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[s("em",[s("strong",[t._v("StrAfter")])]),t._v(":")]),t._v(" "),s("p",[t._v("The opposite of "),s("code",[t._v("STRBEFORE")]),t._v(", this function returns the section of a given string (argument 1) "),s("em",[t._v("after")]),t._v(" the first appearance of a search string (argument 2). This function can be implemented similarly:")]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("serializeStrBefore")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableList")]),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableTerm")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" terms"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Function")]),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableTerm")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" termConverter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TermFactory")]),t._v(" termFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" str "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" termConverter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("apply")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("terms"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" before "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" termConverter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("apply")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("terms"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("format")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"SUBSTRING(%s, IF(POSITION(%s IN %s) != 0, POSITION(%s IN %s) + LENGTH(%s), 0))"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" str"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" after"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" str"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" after"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" str"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" after"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[s("em",[s("strong",[t._v("Tz")])]),t._v(":\nThis function extracts the timezone part of a given timestamp. An example implementation may look like this:")]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("serializeTz")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableList")]),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableTerm")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" terms"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Function")]),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableTerm")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" termConverter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TermFactory")]),t._v(" termFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" str "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" termConverter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("apply")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("terms"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("format")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("\"(LPAD(EXTRACT(TIMEZONE_HOUR FROM %s)::text,2,'0') || ':' || LPAD(EXTRACT(TIMEZONE_MINUTE FROM %s)::text,2,'0'))\"")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" str"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" str"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[s("em",[s("strong",[t._v("DateTimeNorm")])]),t._v(":\nThis function converts a given timestamp to the standardized "),s("code",[t._v("ISO 8601")]),t._v(" format. An example implementation may look like this:")]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("serializeDateTimeNorm")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableList")]),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableTerm")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" terms"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Function")]),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableTerm")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" termConverter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TermFactory")]),t._v(" termFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("format")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"TO_ISO8601(%s)"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" termConverter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("apply")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("terms"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[s("em",[s("strong",[t._v("Hashing Functions")])]),t._v(":")]),t._v(" "),s("p",[t._v("Ontop supports a set of hasing functions:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("MD5")])]),t._v(" "),s("li",[s("code",[t._v("SHA1")])]),t._v(" "),s("li",[s("code",[t._v("SHA256")])]),t._v(" "),s("li",[s("code",[t._v("SHA384")])]),t._v(" "),s("li",[s("code",[t._v("SHA512")])])]),t._v(" "),s("p",[t._v("For each of them, the implementation of a serialization method is required. An example implementation of the "),s("code",[t._v("MD5")]),t._v(" function may look like this:")]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("serializeMD5")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableList")]),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableTerm")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" terms"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Function")]),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableTerm")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" termConverter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TermFactory")]),t._v(" termFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("format")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"MD5(%s)"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" termConverter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("apply")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("terms"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p"),t._v(" "),s("p",[t._v("Other than the serialization methods, four additional methods must be implemented by the subclass:")]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getUUIDNameInDialect")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"[UUID_FUNCTION_NAME]"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("returns the string that represents the name of the UUID in the SQL dialect.")]),t._v(" "),s("p",[t._v("The methods "),s("code",[t._v("createNullRejectingDBConcat(int arity)")]),t._v(", "),s("code",[t._v("createDBConcatOperator(int arity)")]),t._v(", and "),s("code",[t._v("createRegularDBConcat(int arity)")]),t._v(" need to be implemented to define the concat function symbols. The "),s("code",[t._v("DBConcat")]),t._v(" methods define function symbols that represent "),s("code",[t._v("CONCAT")]),t._v(" function calls of a given arity. Sample implementations for them may look like this:")]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DBConcatFunctionSymbol")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createRegularDBConcat")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" arity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("NullToleratingDBConcatFunctionSymbol")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"CONCAT"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" arity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" dbStringType"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" abstractRootDBType"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DBConcatFunctionSymbol")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createNullRejectingDBConcat")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" arity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("NullRejectingDBConcatFunctionSymbol")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"CONCAT_NO_NULL"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" arity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" dbStringType"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" abstractRootDBType"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("The "),s("code",[t._v("createDBConcatOperator(int arity)")]),t._v(" method represents a concat operation executed through a concat operator (often "),s("code",[t._v("+")]),t._v(" or "),s("code",[t._v("||")]),t._v("). It may be implemented like this:")]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DBConcatFunctionSymbol")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createDBConcatOperator")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" arity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("NullRejectingDBConcatFunctionSymbol")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"||"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" arity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" dbStringType"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" abstractRootDBType"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Serializers")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getOperatorSerializer")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"||"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h3",{attrs:{id:"db-datatype-factory"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#db-datatype-factory"}},[t._v("#")]),t._v(" DB Datatype factory")]),t._v(" "),s("p",[t._v("The "),s("em",[t._v("DB datatype factory")]),t._v(" declares the hierarchy of DB datatypes used by the DBMS, and specifies their correspondence with datatypes used in the RDF graphs (such as xsd datatypes).")]),t._v(" "),s("p",[t._v("The interface to implement (for SQL dialects) is "),s("code",[t._v("SQLDBTypeFactory")]),t._v("."),s("br"),t._v("\nAnd the default implementation is "),s("code",[t._v("DefaultSQLDBTypeFactory")]),t._v(" .")]),t._v(" "),s("p",[t._v("For instance, the datatype factory for PostgreSQL within Ontop is the class "),s("code",[t._v("PostgreSQLDBTypeFactory")]),t._v(".")]),t._v(" "),s("p",[t._v("A basic template for this implementation is provided here:")]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("NewDialectDBTypeFactory")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DefaultSQLDBTypeFactory")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/*\n ------------------------------------------\n - Type Definitions -\n ------------------------------------------\n */")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@AssistedInject")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("NewDialectDBTypeFactory")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Assisted")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TermType")]),t._v(" rootTermType"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Assisted")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TypeFactory")]),t._v(" typeFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("super")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createNewDialectTypeMap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("rootTermType"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" typeFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createNewDialectCodeMap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Map")]),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DBTermType")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createNewDialectTypeMap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TermType")]),t._v(" rootTermType"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TypeFactory")]),t._v(" typeFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/*\n ------------------------------------------\n - Type Map -\n ------------------------------------------\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableMap")]),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DefaultTypeCode")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createNewDialectCodeMap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/*\n ------------------------------------------\n - Code Map -\n ------------------------------------------\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/*\n ------------------------------------------\n - Support Flags -\n ------------------------------------------\n */")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("In the template above, four code blocks are commented out. We will now look at each of them individually.")]),t._v(" "),s("h4",{attrs:{id:"type-definitions"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#type-definitions"}},[t._v("#")]),t._v(" "),s("strong",[t._v("Type Definitions")])]),t._v(" "),s("p",[t._v("In this section, we define a set of "),s("code",[t._v("String")]),t._v(" constants that represent the names of datatypes in our SQL dialect. These constants are then used in other code blocks. An excerpt of the "),s("em",[t._v("type definitions")]),t._v(" part in an implementation may look like this:")]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" BIT_STR "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"BIT"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" INT2_STR "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"INT2"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" INT4_STR "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"INT4"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" INT8_STR "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"INT8"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" FLOAT4_STR "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"FLOAT4"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" FLOAT8_STR "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"FLOAT8"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h4",{attrs:{id:"type-map"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#type-map"}},[t._v("#")]),t._v(" "),s("strong",[t._v("TYPE MAP")])]),t._v(" "),s("p",[t._v("In this method, we define the contents of the type map for our dialect. We create "),s("code",[t._v("DBTermType")]),t._v(" instances for each supported type and store them in a "),s("code",[t._v("Map")]),t._v(" object, that matches their identifiers to the "),s("code",[t._v("DBTermType")]),t._v(". The base class we extend from already generates an extensive type map for many popular types, such as "),s("code",[t._v("VARCHAR")]),t._v(", "),s("code",[t._v("INTEGER")]),t._v(", "),s("code",[t._v("REAL")]),t._v(", "),s("code",[t._v("DOUBLE")]),t._v(", and more in the method "),s("code",[t._v("createDefaultSQLTypeMap(...)")]),t._v(". New types can be added to the map in the subclass, and, alternatively, we can override existing entries in the map here. An example implementation of this method may look like this:")]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Map")]),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DBTermType")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createNewDialectTypeMap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TermType")]),t._v(" rootTermType"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TypeFactory")]),t._v(" typeFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TermTypeAncestry")]),t._v(" rootAncestry "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" rootTermType"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getAncestry")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Map")]),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DBTermType")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" map "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createDefaultSQLTypeMap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("rootTermType"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" typeFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" map"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h4",{attrs:{id:"code-map"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#code-map"}},[t._v("#")]),t._v(" "),s("strong",[t._v("CODE MAP")])]),t._v(" "),s("p",[t._v('The code map is a dictionary, that maps different type codes to their "default type" for the SQL dialect. This includes the following type codes:')]),t._v(" "),s("ul",[s("li",[s("code",[t._v("STRING")])]),t._v(" "),s("li",[s("code",[t._v("HEXBINARY")])]),t._v(" "),s("li",[s("code",[t._v("LARGE_INTEGER")])]),t._v(" "),s("li",[s("code",[t._v("DECIMAL")])]),t._v(" "),s("li",[s("code",[t._v("DOUBLE")])]),t._v(" "),s("li",[s("code",[t._v("BOOLEAN")])]),t._v(" "),s("li",[s("code",[t._v("DATE")])]),t._v(" "),s("li",[s("code",[t._v("TIME")])]),t._v(" "),s("li",[s("code",[t._v("DATETIMESTAMP")])]),t._v(" "),s("li",[s("code",[t._v("GEOMETRY")])]),t._v(" "),s("li",[s("code",[t._v("GEOGRAPHY")])]),t._v(" "),s("li",[s("code",[t._v("ARRAY")])]),t._v(" "),s("li",[s("code",[t._v("JSON")])])]),t._v(" "),s("p",[t._v("The default implementation already maps many of these to the name of the corresponding data type. To support additional ones, or to override existing mappings, this method can be implemented. An example implementation may look like this:")]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableMap")]),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DefaultTypeCode")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createNewDialectCodeMap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Map")]),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DefaultTypeCode")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" map "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createDefaultSQLCodeMap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n map"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("put")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DefaultTypeCode")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("JSON"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" JSONB_STR"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableMap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("copyOf")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("map"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h4",{attrs:{id:"support-flags"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#support-flags"}},[t._v("#")]),t._v(" "),s("strong",[t._v("Support Flags")])]),t._v(" "),s("p",[t._v("An instance of "),s("code",[t._v("DBTypeFactory")]),t._v(" supports a set of methods that, when called, return a flag indicating if a certain SQL feature is supported by the dialect. These methods are")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("supportsDBGeometryType()")])]),t._v(" "),s("li",[s("code",[t._v("supportsDBGeographyType()")])]),t._v(" "),s("li",[s("code",[t._v("supportsDBDistanceSphere()")])]),t._v(" "),s("li",[s("code",[t._v("supportsJson()")])]),t._v(" "),s("li",[s("code",[t._v("supportsArrayType()")])])]),t._v(" "),s("p",[t._v("Any of these functions can be overridden by the "),s("code",[t._v("DBTypeFactory")]),t._v(" sub-class to return a boolean constant indicating if the type is supported.")]),t._v(" "),s("h4",{attrs:{id:"other-implementations"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#other-implementations"}},[t._v("#")]),t._v(" "),s("strong",[t._v("Other Implementations")])]),t._v(" "),s("p",[t._v("The "),s("code",[t._v("DBTypeFactory")]),t._v(" base-class supports further methods that can be included in sub-classes for fine-tuning. One popular set of such methods are the "),s("code",[t._v("LexicalValue")]),t._v(" methods. These return a "),s("code",[t._v("String")]),t._v(" constant that represents the lexical value the corresponding literal may assume. For instance, by default, the method "),s("code",[t._v("getDBFalseLexicalValue()")]),t._v(" returns the string "),s("code",[t._v('"FALSE"')]),t._v(", as this is a common representation of the boolean "),s("code",[t._v("false")]),t._v(" value in many SQL dialects. To implement the "),s("code",[t._v("DBTypeFactory")]),t._v(" for a dialect that instead uses the digit "),s("code",[t._v("0")]),t._v(" for "),s("code",[t._v("false")]),t._v(" literals, we could override the method like so:")]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getDBFalseLexicalValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h2",{attrs:{id:"optional-implementations"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#optional-implementations"}},[t._v("#")]),t._v(" Optional implementations")]),t._v(" "),s("p",[t._v("Additional implementations can be optionally provided in replacement of the default implementation.")]),t._v(" "),s("h3",{attrs:{id:"serializer"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#serializer"}},[t._v("#")]),t._v(" Serializer")]),t._v(" "),s("p",[t._v("The "),s("em",[t._v("serializer")]),t._v(" dictates the general shape (SELECT-FROM-WHERE) of the SQL query.")]),t._v(" "),s("p",[t._v("The interface to implement is "),s("code",[t._v("SelectFromWhereSerializer")]),t._v("."),s("br"),t._v("\nAnd the default implementation is "),s("code",[t._v("DefaultSelectFromWhereSerializer")]),t._v(".")]),t._v(" "),s("p",[t._v("For instance, the serializer for PostgreSQL within Ontop is the class "),s("code",[t._v("PostgresSelectFromWhereSerializer")]),t._v(".")]),t._v(" "),s("h3",{attrs:{id:"normalizer"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#normalizer"}},[t._v("#")]),t._v(" Normalizer")]),t._v(" "),s("p",[t._v("The "),s("em",[t._v("normalizer")]),t._v(" addresses limitations of certain DBMSs (such as a non-canonical evaluation of the ORDER BY clause).")]),t._v(" "),s("p",[t._v("The interface to implement is "),s("code",[t._v("DialectExtraNormalizer")]),t._v("."),s("br"),t._v("\nAnd several implementations are already available, some of which are used by several DBMS.")]),t._v(" "),s("p",[t._v("For instance, the normalizer associated to PostgreSQL within Ontop is "),s("code",[t._v("OnlyInPresenceOfDistinctProjectOrderByTermsNormalizer")]),t._v(".")]),t._v(" "),s("h3",{attrs:{id:"metadata-provider"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#metadata-provider"}},[t._v("#")]),t._v(" Metadata provider")]),t._v(" "),s("p",[t._v("The "),s("em",[t._v("metadata provider")]),t._v(" specifies how schema and integrity constraints (for instance primary keys) are retrieved from the DBMS.")]),t._v(" "),s("p",[t._v("The interface to implement is "),s("code",[t._v("MetadataProvider")]),t._v("."),s("br"),t._v("\nAnd the default implementation is "),s("code",[t._v("DefaultDBMetadataProvider")]),t._v(".")]),t._v(" "),s("p",[t._v("For instance, the metadata provider for PostgreSQL within Ontop is "),s("code",[t._v("PostgreSQLDBMetadataProvider")]),t._v(".")]),t._v(" "),s("h2",{attrs:{id:"declaring-an-implementation"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#declaring-an-implementation"}},[t._v("#")]),t._v(" Declaring an implementation")]),t._v(" "),s("p",[t._v("All the implementations mentioned above can be declared in the property file "),s("code",[t._v("sql-default.properties")]),t._v(" (which can be found in the directory "),s("code",[t._v("it/unibz/inf/ontop/injection/")]),t._v(" of the "),s("code",[t._v("ontop-rdb")]),t._v(" module).")]),t._v(" "),s("p",[t._v("A key-value pair must be added for each of these implementations, where the key indicates the type of the implementation (serializer, function symbol factory, etc.), and the value is the implementation.")]),t._v(" "),s("p",[t._v("The naming scheme for the keys is the following."),s("br"),t._v("\nLet "),s("code",[t._v("")]),t._v(" be the name of the JDBC driver for the RDBMS (for instance, the JDBC driver for PostgreSQL is "),s("code",[t._v("org.postgresql.Driver")]),t._v("."),s("br"),t._v("\nThen the keys are:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("-serializer")]),t._v(" for a serializer")]),t._v(" "),s("li",[s("code",[t._v("-symbolFactory")]),t._v(" for a DB function symbol factory")]),t._v(" "),s("li",[s("code",[t._v("-typeFactory")]),t._v(" for a DB datatype factory")]),t._v(" "),s("li",[s("code",[t._v("-normalizer")]),t._v(" for a normalizer")]),t._v(" "),s("li",[s("code",[t._v("-metadataProvider")]),t._v(" for a metadata provider")])]),t._v(" "),s("p",[t._v("For instance, the key-value pairs declared for PostgreSQL are:")]),t._v(" "),s("div",{staticClass:"language-properties extra-class"},[s("pre",{pre:!0,attrs:{class:"language-properties"}},[s("code",[s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("org.postgresql.Driver-serializer")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-value"}},[t._v("it.unibz.inf.ontop.generation.serializer.impl.PostgresSelectFromWhereSerializer")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("org.postgresql.Driver-symbolFactory")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-value"}},[t._v("it.unibz.inf.ontop.model.term.functionsymbol.db.impl.PostgreSQLDBFunctionSymbolFactory")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("org.postgresql.Driver-typeFactory")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-value"}},[t._v("it.unibz.inf.ontop.model.type.impl.PostgreSQLDBTypeFactory")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("org.postgresql.Driver-normalizer")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-value"}},[t._v("it.unibz.inf.ontop.generation.normalization.impl.OnlyInPresenceOfDistinctProjectOrderByTermsNormalizer")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("org.postgresql.Driver-metadataProvider")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-value"}},[t._v("it.unibz.inf.ontop.dbschema.impl.PostgreSQLDBMetadataProvider")]),t._v("\n")])])]),s("p",[t._v("A basic set of key-value pairs may be:")]),t._v(" "),s("div",{staticClass:"language-properties extra-class"},[s("pre",{pre:!0,attrs:{class:"language-properties"}},[s("code",[s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("name.of.jdbc.Driver-serializer")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-value"}},[t._v("it.unibz.inf.ontop.generation.serializer.impl.DefaultSelectFromWhereSerializer")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("name.of.jdbc.Driver-symbolFactory")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-value"}},[t._v("it.unibz.inf.ontop.model.term.functionsymbol.db.impl.NewDialectDBFunctionSymbolFactory")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("name.of.jdbc.Driver-typeFactory")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-value"}},[t._v("it.unibz.inf.ontop.model.type.impl.NewDialectDBTypeFactory")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("name.of.jdbc.Driver-normalizer")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-value"}},[t._v("it.unibz.inf.ontop.generation.normalization.impl.OnlyInPresenceOfDistinctProjectOrderByTermsNormalizer")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("name.of.jdbc.Driver-metadataProvider")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-value"}},[t._v("it.unibz.inf.ontop.dbschema.impl.DefaultSchemaCatalogDBMetadataProvider")]),t._v("\n")])])]),s("h2",{attrs:{id:"preparing-and-running-the-testcases"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#preparing-and-running-the-testcases"}},[t._v("#")]),t._v(" Preparing and Running the Testcases")]),t._v(" "),s("p",[t._v("Ontop currently uses a set of tests called "),s("code",[t._v("lightweight-tests")]),t._v(" to test all main ontop language support features on minimal databases. A simple way of testing the correctness of newly implemented dialect support is to run the same tests a database that uses the corresponding dialect.")]),t._v(" "),s("p",[t._v("This consists of the following steps:")]),t._v(" "),s("ol",[s("li",[t._v("Set up a database with the required testing conditions")]),t._v(" "),s("li",[t._v("Prepare files that assist the connection to the database")]),t._v(" "),s("li",[t._v("Implement sub-classes of the abstract lightweight test classes and run them")])]),t._v(" "),s("p",[t._v("In the following sections, we will discuss each of these steps.")]),t._v(" "),s("h3",{attrs:{id:"setting-up-the-database"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#setting-up-the-database"}},[t._v("#")]),t._v(" Setting up the Database")]),t._v(" "),s("p",[t._v("The exact procedure of the database preparation depends on the database system. In ontop, we generally use docker images that reproduce the exact same database state for each test run so we can test the different dialects automatically.")]),t._v(" "),s("p",[t._v("Each directory inside "),s("code",[t._v("test/lightweight-tests/lightweight-db-test-images/")]),t._v(" corresponds to one docker image, and many of them contain table definitions in "),s("code",[t._v(".sql")]),t._v(" file. For instance, the "),s("code",[t._v("mysql")]),t._v(" directory contains the exact definitions of the three databases that are used for testing, "),s("code",[t._v("books")]),t._v(", "),s("code",[t._v("dbconstraints")]),t._v(", and "),s("code",[t._v("university")]),t._v(".")]),t._v(" "),s("p",[t._v("To prepare the required testing conditions, you can take these "),s("code",[t._v(".sql")]),t._v(" files and run their queries on your database. Should any of the features not be supported, you will be required to either use alternative equivalent features to reach the same final database state, or disable the corresponding test cases.")]),t._v(" "),s("h3",{attrs:{id:"preparing-connection-files"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#preparing-connection-files"}},[t._v("#")]),t._v(" Preparing Connection Files")]),t._v(" "),s("p",[t._v("The directory "),s("code",[t._v("test/lightweight-tests/src/test/resources/")]),t._v(" contains files that are used for setting up an ontop connection with different databases, including "),s("code",[t._v(".obda")]),t._v(" files for the VKG creation and "),s("code",[t._v(".property")]),t._v(" files for JDBC connections. While the "),s("code",[t._v(".obda")]),t._v(" files can usually be reused for different systems, the "),s("code",[t._v(".property")]),t._v(" files must be included for each database system. The directories "),s("code",[t._v("books")]),t._v(" and "),s("code",[t._v("prof")]),t._v(" inside the test resources contain one sub directory for each dialect, where each sub directory in turn includes one "),s("code",[t._v(".properties")]),t._v(" file for the JDBC connection. The "),s("code",[t._v("dbconstraints")]),t._v(" and "),s("code",[t._v("university")]),t._v(" directories, on the other hand, directly contain "),s("code",[t._v(".property")]),t._v(" files for each dialect.")]),t._v(" "),s("p",[t._v("To run all lightweight tests for a new dialect, the corresponding files and directories have to be creates for its JDBC connection. In particular, the connection files should be created in such a way, that the corresponding database/schema of the test is selected as the default database/schema, as the "),s("code",[t._v(".obda")]),t._v(" files access the tables through relative paths.")]),t._v(" "),s("h3",{attrs:{id:"implementing-the-lightweight-test-classes"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#implementing-the-lightweight-test-classes"}},[t._v("#")]),t._v(" Implementing the Lightweight Test Classes")]),t._v(" "),s("p",[t._v("The directory "),s("code",[t._v("test/lightweight-tests/src/test/java/")]),t._v(" contains the test cases that have to run successfully for each new dialect. They are defined in the four abstract classes "),s("code",[t._v("AbstractBindTestWithFunctions")]),t._v(", "),s("code",[t._v("AbstractConstraintTest")]),t._v(", "),s("code",[t._v("AbstractDistinctInAggregateTest")]),t._v(", and "),s("code",[t._v("AbstractLeftJoinProfTest")]),t._v(".")]),t._v(" "),s("p",[t._v("For each new dialect, a new package has to be created at this location, containing the implementations of sub-classes for each of these abstract base classes.")]),t._v(" "),s("h4",{attrs:{id:"bindtestwithfunctions"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#bindtestwithfunctions"}},[t._v("#")]),t._v(" "),s("strong",[s("code",[t._v("BindTestWithFunctions")])])]),t._v(" "),s("p",[t._v("This test class tests all main SQL functions that are supported by ontop. It uses the "),s("code",[t._v("books")]),t._v(" database, as well as directly generated data through the SPARQL "),s("code",[t._v("BIND")]),t._v(" function. An example implementation of this class may look like this:")]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@NewDialectLightweightTest")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BindWithFunctionsNewDialectTest")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("AbstractBindTestWithFunctions")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" PROPERTIES_FILE "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/books/new-dialect/books-new-dialect.properties"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@BeforeAll")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("before")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("throws")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("IOException")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SQLException")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("initOBDA")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("OBDA_FILE"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" OWL_FILE"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" PROPERTIES_FILE"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@AfterAll")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("after")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("throws")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SQLException")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("release")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/*\n ------------------------------------------\n - Result Definitions -\n ------------------------------------------\n */")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("div",{staticClass:"custom-block tip"},[s("p",{staticClass:"custom-block-title"},[t._v("NOTE")]),t._v(" "),s("p",[t._v("Using the "),s("code",[t._v("@NewDialectLightweightTest")]),t._v(" annotation requires the definition of the annotation in the same package, similarly to how it was defined for other dialects.")])]),t._v(" "),s("p",[t._v('The code block "Result Definitions" is commented out in the above example. This code block may contain redefinitions of expected results that are tested in the base class. To do this, override the '),s("code",[t._v("get[TEST-NAME]ExpectedValues()")]),t._v(" method here. An example implementation may look like this:")]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableList")]),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getConstantIntegerDivideExpectedResults")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ImmutableList")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("of")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"\\"0.500\\"^^xsd:decimal"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("Should any of the functionalities not be supported by the SQL dialect, then the corresponding test case may simply be disabled with an exaplanation as to why it is not supported. An example for that may look like this:")]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Disabled")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"New Dialect does not support SHA384"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Test")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("testHashSHA384")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("super")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("testHashSHA384")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("Some test cases are disabled by default.")]),t._v(" "),s("h4",{attrs:{id:"constraint"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#constraint"}},[t._v("#")]),t._v(" "),s("strong",[s("code",[t._v("Constraint")])])]),t._v(" "),s("p",[t._v("This set of test cases tests for the correct interpretation of integrity constraints in the data. It uses the "),s("code",[t._v("dbconstraints")]),t._v(" database. An example implementation may look like this:")]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@NewDialectLightweightTest")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ConstraintNewDialectTest")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("AbstractConstraintTest")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" PROPERTIES_FILE "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/dbconstraints/dbconstraints-new-dialect.properties"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ConstraintNewDialectTest")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" method"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("super")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("method"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" PROPERTIES_FILE"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("Once again, specific tests may be disabled if they are not supported. For database systems that do not support integrity constraints, this class can be ignored.")]),t._v(" "),s("h4",{attrs:{id:"distinctinaggregate"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#distinctinaggregate"}},[t._v("#")]),t._v(" "),s("strong",[s("code",[t._v("DistinctInAggregate")])])]),t._v(" "),s("p",[t._v("This set of test cases runs queries containing aggregate functions that include the "),s("code",[t._v("DISTINCT")]),t._v(" keyword. It can be implemented analogously to the "),s("code",[t._v("BindWithFunctions")]),t._v(" test class.")]),t._v(" "),s("h4",{attrs:{id:"leftjoinprof"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#leftjoinprof"}},[t._v("#")]),t._v(" "),s("strong",[s("code",[t._v("LeftJoinProf")])])]),t._v(" "),s("p",[t._v("This set of test cases runs on the "),s("code",[t._v("university")]),t._v(" database. It accesses items that have to be taken from the database through "),s("code",[t._v("JOIN")]),t._v("s. Furthermore, it tests the optimization procedures employed by ontop to minimize the required number of joins. Once again, it can be implemented analogously to the "),s("code",[t._v("BindWithFunctions")]),t._v(" test class.")]),t._v(" "),s("p",[t._v("If the database management system does not support integrity constraints, many of these test cases will fail because the optimizations will not be performed.")]),t._v(" "),s("h2",{attrs:{id:"further-implementations-and-troubleshooting"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#further-implementations-and-troubleshooting"}},[t._v("#")]),t._v(" Further Implementations and Troubleshooting")]),t._v(" "),s("p",[t._v("Once the basic features and lightweight test cases have been implemented for a dialect, the tests can be run to determine which features still do not work correctly.")]),t._v(" "),s("p",[t._v("If a test case fails, its corresponding feature is likely not yet supported by the current implementation. In these cases, changes need to be applied to the implemented "),s("code",[t._v("DBTypeFactory")]),t._v(" or "),s("code",[t._v("DBFunctionSymbolFactory")]),t._v(" to solve the issue.")]),t._v(" "),s("p",[t._v("In some situations, however, issues may be caused by problems not related to database types or functions. In these cases, one of the following default implementations may also be extended for the new dialect.")]),t._v(" "),s("div",{staticClass:"custom-block tip"},[s("p",{staticClass:"custom-block-title"},[t._v("NOTE")]),t._v(" "),s("p",[t._v("New implementations of these classes have to be linked to the driver through the "),s("code",[t._v("sql-default.properties")]),t._v(" file.")])]),t._v(" "),s("h3",{attrs:{id:"defaultschemacatalogdbmetadataprovider-defaultschemadbmetadataprovider-or-defaultdbmetadataprovider"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#defaultschemacatalogdbmetadataprovider-defaultschemadbmetadataprovider-or-defaultdbmetadataprovider"}},[t._v("#")]),t._v(" "),s("strong",[s("code",[t._v("DefaultSchemaCatalogDBMetadataProvider")])]),t._v(", "),s("strong",[s("code",[t._v("DefaultSchemaDBMetadataProvider")])]),t._v(", or "),s("strong",[s("code",[t._v("DefaultDBMetadataProvider")])])]),t._v(" "),s("p",[t._v("If the "),s("code",[t._v("DBMetadataProvider")]),t._v(" assigned to the dialect is not able to perform its expected actions through its default implementation, it may have to be extended with a new sub-class that is particularly tailored for this dialect.")]),t._v(" "),s("p",[t._v("In that case, its methods may be overridden to change the default behavious. Commong targets include:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("insertIntegrityConstraints(...)")]),t._v(" if the dialect does not support integrity constraints.")]),t._v(" "),s("li",[s("code",[t._v("getRelationId(...)")]),t._v(" to return the ID of a given relation.")])]),t._v(" "),s("p",[t._v("Additionally, the constructor may be implemented to determine the default schema or default catalog names if they cannot be accessed directly throug the JDBC, or a different "),s("code",[t._v("QuotedIDFactory")]),t._v(" instance can be passed to the super-class to force ontop to generate quoted identifiers in a specific way.")]),t._v(" "),s("h3",{attrs:{id:"selectfromwhereserializer"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#selectfromwhereserializer"}},[t._v("#")]),t._v(" "),s("strong",[s("code",[t._v("SelectFromWhereSerializer")])])]),t._v(" "),s("p",[t._v("This class is responsible for the serialization of the SQL query frame. Different SQL dialects have different rules as to how the general shape of an SQL query have to be defined. For instance, some dialects allow users to combine "),s("code",[t._v("LIMIT")]),t._v(" and "),s("code",[t._v("OFFSET")]),t._v(" clauses as "),s("code",[t._v("LIMIT ,")]),t._v(", while others require the form "),s("code",[t._v("OFFSET LIMIT ")]),t._v(". The following shows a default implementation of a "),s("code",[t._v("SelectFromWhereSerializer")]),t._v(" to achieve the latter behaviour:")]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Singleton")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("NewDialectSelectFromWhereSerializer")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DefaultSelectFromWhereSerializer")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("implements")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SelectFromWhereSerializer")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Inject")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("NewDialectSelectFromWhereSerializer")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TermFactory")]),t._v(" termFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("super")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DefaultSQLTermSerializer")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("termFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("QuerySerialization")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("serialize")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SelectFromWhereWithModifiers")]),t._v(" selectFromWhere"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DBParameters")]),t._v(" dbParameters"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" selectFromWhere"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("acceptVisitor")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DefaultRelationVisitingSerializer")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("dbParameters"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getQuotedIDFactory")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("protected")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("serializeLimitOffset")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" limit"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" offset"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" noSortCondition"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("format")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"OFFSET %d LIMIT %d"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" offset"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" limit"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])])}),[],!1,null,null,null);a.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/20.e0fa11bb.js b/assets/js/20.8c67cb7d.js similarity index 97% rename from assets/js/20.e0fa11bb.js rename to assets/js/20.8c67cb7d.js index 334039905..2d042127c 100644 --- a/assets/js/20.e0fa11bb.js +++ b/assets/js/20.8c67cb7d.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[20],{396:function(e,t,n){"use strict";n.r(t);var i=n(51),r=Object(i.a)({},(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[n("h1",{attrs:{id:"debug-jetty"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#debug-jetty"}},[e._v("#")]),e._v(" Debug Jetty")]),e._v(" "),n("p",[e._v("This page describe debug Jetty with RDF4J workbench plugin in IntelliJ Idea")]),e._v(" "),n("h2",{attrs:{id:"start-the-jetty-in-debug-mode"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#start-the-jetty-in-debug-mode"}},[e._v("#")]),e._v(" Start the Jetty in Debug mode")]),e._v(" "),n("div",{staticClass:"language- extra-class"},[n("pre",{pre:!0,attrs:{class:"language-text"}},[n("code",[e._v("$ java -Xdebug -agentlib:jdwp=transport=dt_socket,address=9999,server=y,suspend=n -jar start.jar\n")])])]),n("h2",{attrs:{id:"linking-with-intellij"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#linking-with-intellij"}},[e._v("#")]),e._v(" Linking with IntelliJ")]),e._v(" "),n("p",[e._v("Next we need to link the IntelliJ project with the deployed webapp.")]),e._v(" "),n("ol",[n("li",[n("p",[e._v('Within IntelliJ, open the project containing the webapp deployed into jetty that you want to debug. SelectRun -> Edit Configurations. Add a new configuration by clicking the "+" icon. Choose Remote. Make sure the port you choose is the same as the one you added in Enable remote debugging.')])]),e._v(" "),n("li",[n("p",[e._v("Next in your webapp you can set a breakpoint within a servlet which when it is tripped will halt the remote jvm's processing thread to await for debugging commands from your IntelliJ instance. To set a breakpoint, simply open the servlet or any other class you want to debug and click left to the line you want to set the breakpoint at (where the red dot is on the next screenshot). The red dot and red background on the line mark the breakpoint.")])]),e._v(" "),n("li",[n("p",[e._v("Accessing that servlet within your browser, pointed at your remote debug configurated jetty-distribution, should transition your IntelliJ instance to the standard debugger view.")])])]),e._v(" "),n("h2",{attrs:{id:"references"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#references"}},[e._v("#")]),e._v(" References")]),e._v(" "),n("ol",[n("li",[n("a",{attrs:{href:"http://www.eclipse.org/jetty/documentation/current/enable-remote-debugging.html",target:"_blank",rel:"noopener"}},[e._v("http://www.eclipse.org/jetty/documentation/current/enable-remote-debugging.html"),n("OutboundLink")],1)]),e._v(" "),n("li",[n("a",{attrs:{href:"http://www.eclipse.org/jetty/documentation/current/debugging-with-intellij.html",target:"_blank",rel:"noopener"}},[e._v("http://www.eclipse.org/jetty/documentation/current/debugging-with-intellij.html"),n("OutboundLink")],1)])])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[20],{397:function(e,t,n){"use strict";n.r(t);var i=n(51),r=Object(i.a)({},(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[n("h1",{attrs:{id:"debug-jetty"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#debug-jetty"}},[e._v("#")]),e._v(" Debug Jetty")]),e._v(" "),n("p",[e._v("This page describe debug Jetty with RDF4J workbench plugin in IntelliJ Idea")]),e._v(" "),n("h2",{attrs:{id:"start-the-jetty-in-debug-mode"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#start-the-jetty-in-debug-mode"}},[e._v("#")]),e._v(" Start the Jetty in Debug mode")]),e._v(" "),n("div",{staticClass:"language- extra-class"},[n("pre",{pre:!0,attrs:{class:"language-text"}},[n("code",[e._v("$ java -Xdebug -agentlib:jdwp=transport=dt_socket,address=9999,server=y,suspend=n -jar start.jar\n")])])]),n("h2",{attrs:{id:"linking-with-intellij"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#linking-with-intellij"}},[e._v("#")]),e._v(" Linking with IntelliJ")]),e._v(" "),n("p",[e._v("Next we need to link the IntelliJ project with the deployed webapp.")]),e._v(" "),n("ol",[n("li",[n("p",[e._v('Within IntelliJ, open the project containing the webapp deployed into jetty that you want to debug. SelectRun -> Edit Configurations. Add a new configuration by clicking the "+" icon. Choose Remote. Make sure the port you choose is the same as the one you added in Enable remote debugging.')])]),e._v(" "),n("li",[n("p",[e._v("Next in your webapp you can set a breakpoint within a servlet which when it is tripped will halt the remote jvm's processing thread to await for debugging commands from your IntelliJ instance. To set a breakpoint, simply open the servlet or any other class you want to debug and click left to the line you want to set the breakpoint at (where the red dot is on the next screenshot). The red dot and red background on the line mark the breakpoint.")])]),e._v(" "),n("li",[n("p",[e._v("Accessing that servlet within your browser, pointed at your remote debug configurated jetty-distribution, should transition your IntelliJ instance to the standard debugger view.")])])]),e._v(" "),n("h2",{attrs:{id:"references"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#references"}},[e._v("#")]),e._v(" References")]),e._v(" "),n("ol",[n("li",[n("a",{attrs:{href:"http://www.eclipse.org/jetty/documentation/current/enable-remote-debugging.html",target:"_blank",rel:"noopener"}},[e._v("http://www.eclipse.org/jetty/documentation/current/enable-remote-debugging.html"),n("OutboundLink")],1)]),e._v(" "),n("li",[n("a",{attrs:{href:"http://www.eclipse.org/jetty/documentation/current/debugging-with-intellij.html",target:"_blank",rel:"noopener"}},[e._v("http://www.eclipse.org/jetty/documentation/current/debugging-with-intellij.html"),n("OutboundLink")],1)])])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/25.022d34d2.js b/assets/js/25.7bbe4016.js similarity index 99% rename from assets/js/25.022d34d2.js rename to assets/js/25.7bbe4016.js index 18afe8f8c..f8270db01 100644 --- a/assets/js/25.022d34d2.js +++ b/assets/js/25.7bbe4016.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[25],{402:function(e,t,a){"use strict";a.r(t);var o=a(51),s=Object(o.a)({},(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[a("h1",{attrs:{id:"make-a-new-release"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#make-a-new-release"}},[e._v("#")]),e._v(" Make a new release")]),e._v(" "),a("h2",{attrs:{id:"update-documents"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#update-documents"}},[e._v("#")]),e._v(" Update documents")]),e._v(" "),a("ul",[a("li",[a("code",[e._v("README.md")]),e._v(" in "),a("code",[e._v("build/distribution")]),e._v(". This file will be uploaded to SourceForge and Github Releases")]),e._v(" "),a("li",[a("code",[e._v("README.html")]),e._v(" in "),a("code",[e._v("protege/plugin")]),e._v(". This file will be displayed in the Protégé Plugin Update window.")]),e._v(" "),a("li",[a("code",[e._v("update.properties")]),e._v(" file in "),a("code",[e._v("protege/plugin")]),e._v(". This is the configuration file for Protégé plugin Auto Update")])]),e._v(" "),a("h2",{attrs:{id:"create-a-git-branch-for-release"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#create-a-git-branch-for-release"}},[e._v("#")]),e._v(" Create a git branch for release")]),e._v(" "),a("div",{staticClass:"language-console extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v("$ git checkout
\n$ git checkout -b releasing/\n")])])]),a("h2",{attrs:{id:"update-the-version-numbers"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#update-the-version-numbers"}},[e._v("#")]),e._v(" Update the version numbers")]),e._v(" "),a("p",[e._v("Update pom.xml files by Maven plugin to a SNAPSHOT version:")]),e._v(" "),a("div",{staticClass:"language-console extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v("$ ./mvnw versions:set -DnewVersion=5.0.0-SNAPSHOT\n")])])]),a("h2",{attrs:{id:"build-maven-packages"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#build-maven-packages"}},[e._v("#")]),e._v(" Build Maven packages")]),e._v(" "),a("div",{staticClass:"language-console extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('$ ./mvnw release:clean\n\n# Preparing the release will sign artifacts (GPG key needed), create the new tag in git and automatically push to github.\n# When 100% sure, you can skip the test by `-Darguments="-DskipTests"`\n$ ./mvnw release:prepare\n\n# stage the release\n$ ./mvnw release:perform\n\n# Or stage from a Git tag\n# ./mvnw release:perform -DconnectionUrl=scm:git:git@github.com:ontop/ontop.git -Dtag=ontop-5.0.0\n')])])]),a("h3",{attrs:{id:"stage-the-maven-artifacts"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#stage-the-maven-artifacts"}},[e._v("#")]),e._v(" Stage the Maven artifacts")]),e._v(" "),a("ul",[a("li",[e._v("URL: "),a("a",{attrs:{href:"https://oss.sonatype.org",target:"_blank",rel:"noopener"}},[e._v("https://oss.sonatype.org"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v('Navigate to "Staging Repositories" from the left panel')]),e._v(" "),a("li",[e._v("Close the repository by clicking the "),a("code",[e._v("Close")]),e._v(" button")]),e._v(" "),a("li",[e._v("Release the artifacts by clicking the "),a("code",[e._v("Release")]),e._v(" button")])]),e._v(" "),a("h2",{attrs:{id:"build-and-distribute-ontop-bundles"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#build-and-distribute-ontop-bundles"}},[e._v("#")]),e._v(" Build and distribute Ontop bundles")]),e._v(" "),a("div",{staticClass:"language-console extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v("# we can start from the `checkout` directory generated during the Maven release\n$ cd target/checkout\n$ ./build-release.sh\n")])])]),a("p",[e._v("Further info: "),a("a",{attrs:{href:"/dev/build"}},[e._v("Build Instruction")])]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Make a release in "),a("a",{attrs:{href:"https://github.com/ontop/ontop/releases",target:"_blank",rel:"noopener"}},[e._v("Github Releases"),a("OutboundLink")],1)])]),e._v(" "),a("li",[a("p",[e._v("Deploy the packages to "),a("a",{attrs:{href:"https://sourceforge.net/projects/ontop4obda/files/",target:"_blank",rel:"noopener"}},[e._v("SourceForge"),a("OutboundLink")],1),e._v(" by manual upload or sftp.")])])]),e._v(" "),a("div",{staticClass:"language-console extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v("$ sftp user,ontop4obda@frs.sourceforge.net\n$ cd /home/pfs/project/o/on/ontop4obda\n# sftp://ghxiao,ontop4obda@frs.sourceforge.net/home/pfs/project/o/on/ontop4obda\n")])])]),a("h2",{attrs:{id:"update-docker-hub"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#update-docker-hub"}},[e._v("#")]),e._v(" Update Docker Hub")]),e._v(" "),a("ul",[a("li",[e._v("Build and push the docker image of "),a("a",{attrs:{href:"https://hub.docker.com/repository/docker/ontop/ontop",target:"_blank",rel:"noopener"}},[e._v("ontop/ontop"),a("OutboundLink")],1),e._v(" to Docker Hub using the script "),a("code",[e._v("client/docker/build-image.sh")]),e._v(" "),a("ul",[a("li",[e._v("by default, the script tag the images as "),a("code",[e._v("ontop/ontop:[version]")]),e._v(" and "),a("code",[e._v("ontop/ontop:latest")]),e._v(" - use option "),a("code",[e._v("-t")]),e._v(" (one or more times) to tag differently (e.g., "),a("code",[e._v("-t ontop/ontop:xyz -t ontop/ontop:latest")]),e._v(")")]),e._v(" "),a("li",[e._v("run "),a("code",[e._v("client/docker/build-image.sh --help")]),e._v(" for available options")])])])]),e._v(" "),a("div",{staticClass:"language-console extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v("# log in to Docker Hub\n# docker login\n$ cd ontop/client/docker/\n# `-C`: multi-stage build. slow, but safe\n# `-x`: compile for both amd64 and arm64, which entails pushing to Docker hub\n$ ./build-image.sh -C -x\n")])])]),a("h2",{attrs:{id:"update-the-ontop-website"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#update-the-ontop-website"}},[e._v("#")]),e._v(" Update the Ontop Website")]),e._v(" "),a("ul",[a("li",[e._v("Update "),a("a",{attrs:{href:"/guide"}},[e._v("the guide homepage")])]),e._v(" "),a("li",[e._v("Update "),a("a",{attrs:{href:"/guide/releases"}},[e._v("the release notes")])])]),e._v(" "),a("h2",{attrs:{id:"update-the-api-example-repository"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#update-the-api-example-repository"}},[e._v("#")]),e._v(" Update the API example repository")]),e._v(" "),a("ul",[a("li",[e._v("Update the Ontop version in "),a("a",{attrs:{href:"https://github.com/ontop/ontop-api-examples",target:"_blank",rel:"noopener"}},[e._v("https://github.com/ontop/ontop-api-examples"),a("OutboundLink")],1)])]),e._v(" "),a("h2",{attrs:{id:"update-branches-for-next-development-iteration"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#update-branches-for-next-development-iteration"}},[e._v("#")]),e._v(" Update branches for next development iteration")]),e._v(" "),a("ul",[a("li",[e._v("Merge the tag for the release to master and the release branch to develop")])]),e._v(" "),a("div",{staticClass:"language-console extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v("$ git checkout develop\n$ git merge release/v-number #branch\n\n# this step is also for triggering the AutoUpdate of Protege plugin\n$ git checkout master\n$ git merge v-number # tag\n")])])]),a("h2",{attrs:{id:"time-for-celebration"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#time-for-celebration"}},[e._v("#")]),e._v(" Time for celebration!")]),e._v(" "),a("ul",[a("li",[e._v("Send release emails to several mail lists and social media")])])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[25],{404:function(e,t,a){"use strict";a.r(t);var o=a(51),s=Object(o.a)({},(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[a("h1",{attrs:{id:"make-a-new-release"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#make-a-new-release"}},[e._v("#")]),e._v(" Make a new release")]),e._v(" "),a("h2",{attrs:{id:"update-documents"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#update-documents"}},[e._v("#")]),e._v(" Update documents")]),e._v(" "),a("ul",[a("li",[a("code",[e._v("README.md")]),e._v(" in "),a("code",[e._v("build/distribution")]),e._v(". This file will be uploaded to SourceForge and Github Releases")]),e._v(" "),a("li",[a("code",[e._v("README.html")]),e._v(" in "),a("code",[e._v("protege/plugin")]),e._v(". This file will be displayed in the Protégé Plugin Update window.")]),e._v(" "),a("li",[a("code",[e._v("update.properties")]),e._v(" file in "),a("code",[e._v("protege/plugin")]),e._v(". This is the configuration file for Protégé plugin Auto Update")])]),e._v(" "),a("h2",{attrs:{id:"create-a-git-branch-for-release"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#create-a-git-branch-for-release"}},[e._v("#")]),e._v(" Create a git branch for release")]),e._v(" "),a("div",{staticClass:"language-console extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v("$ git checkout
\n$ git checkout -b releasing/\n")])])]),a("h2",{attrs:{id:"update-the-version-numbers"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#update-the-version-numbers"}},[e._v("#")]),e._v(" Update the version numbers")]),e._v(" "),a("p",[e._v("Update pom.xml files by Maven plugin to a SNAPSHOT version:")]),e._v(" "),a("div",{staticClass:"language-console extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v("$ ./mvnw versions:set -DnewVersion=5.0.0-SNAPSHOT\n")])])]),a("h2",{attrs:{id:"build-maven-packages"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#build-maven-packages"}},[e._v("#")]),e._v(" Build Maven packages")]),e._v(" "),a("div",{staticClass:"language-console extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('$ ./mvnw release:clean\n\n# Preparing the release will sign artifacts (GPG key needed), create the new tag in git and automatically push to github.\n# When 100% sure, you can skip the test by `-Darguments="-DskipTests"`\n$ ./mvnw release:prepare\n\n# stage the release\n$ ./mvnw release:perform\n\n# Or stage from a Git tag\n# ./mvnw release:perform -DconnectionUrl=scm:git:git@github.com:ontop/ontop.git -Dtag=ontop-5.0.0\n')])])]),a("h3",{attrs:{id:"stage-the-maven-artifacts"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#stage-the-maven-artifacts"}},[e._v("#")]),e._v(" Stage the Maven artifacts")]),e._v(" "),a("ul",[a("li",[e._v("URL: "),a("a",{attrs:{href:"https://oss.sonatype.org",target:"_blank",rel:"noopener"}},[e._v("https://oss.sonatype.org"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v('Navigate to "Staging Repositories" from the left panel')]),e._v(" "),a("li",[e._v("Close the repository by clicking the "),a("code",[e._v("Close")]),e._v(" button")]),e._v(" "),a("li",[e._v("Release the artifacts by clicking the "),a("code",[e._v("Release")]),e._v(" button")])]),e._v(" "),a("h2",{attrs:{id:"build-and-distribute-ontop-bundles"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#build-and-distribute-ontop-bundles"}},[e._v("#")]),e._v(" Build and distribute Ontop bundles")]),e._v(" "),a("div",{staticClass:"language-console extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v("# we can start from the `checkout` directory generated during the Maven release\n$ cd target/checkout\n$ ./build-release.sh\n")])])]),a("p",[e._v("Further info: "),a("a",{attrs:{href:"/dev/build"}},[e._v("Build Instruction")])]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Make a release in "),a("a",{attrs:{href:"https://github.com/ontop/ontop/releases",target:"_blank",rel:"noopener"}},[e._v("Github Releases"),a("OutboundLink")],1)])]),e._v(" "),a("li",[a("p",[e._v("Deploy the packages to "),a("a",{attrs:{href:"https://sourceforge.net/projects/ontop4obda/files/",target:"_blank",rel:"noopener"}},[e._v("SourceForge"),a("OutboundLink")],1),e._v(" by manual upload or sftp.")])])]),e._v(" "),a("div",{staticClass:"language-console extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v("$ sftp user,ontop4obda@frs.sourceforge.net\n$ cd /home/pfs/project/o/on/ontop4obda\n# sftp://ghxiao,ontop4obda@frs.sourceforge.net/home/pfs/project/o/on/ontop4obda\n")])])]),a("h2",{attrs:{id:"update-docker-hub"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#update-docker-hub"}},[e._v("#")]),e._v(" Update Docker Hub")]),e._v(" "),a("ul",[a("li",[e._v("Build and push the docker image of "),a("a",{attrs:{href:"https://hub.docker.com/repository/docker/ontop/ontop",target:"_blank",rel:"noopener"}},[e._v("ontop/ontop"),a("OutboundLink")],1),e._v(" to Docker Hub using the script "),a("code",[e._v("client/docker/build-image.sh")]),e._v(" "),a("ul",[a("li",[e._v("by default, the script tag the images as "),a("code",[e._v("ontop/ontop:[version]")]),e._v(" and "),a("code",[e._v("ontop/ontop:latest")]),e._v(" - use option "),a("code",[e._v("-t")]),e._v(" (one or more times) to tag differently (e.g., "),a("code",[e._v("-t ontop/ontop:xyz -t ontop/ontop:latest")]),e._v(")")]),e._v(" "),a("li",[e._v("run "),a("code",[e._v("client/docker/build-image.sh --help")]),e._v(" for available options")])])])]),e._v(" "),a("div",{staticClass:"language-console extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v("# log in to Docker Hub\n# docker login\n$ cd ontop/client/docker/\n# `-C`: multi-stage build. slow, but safe\n# `-x`: compile for both amd64 and arm64, which entails pushing to Docker hub\n$ ./build-image.sh -C -x\n")])])]),a("h2",{attrs:{id:"update-the-ontop-website"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#update-the-ontop-website"}},[e._v("#")]),e._v(" Update the Ontop Website")]),e._v(" "),a("ul",[a("li",[e._v("Update "),a("a",{attrs:{href:"/guide"}},[e._v("the guide homepage")])]),e._v(" "),a("li",[e._v("Update "),a("a",{attrs:{href:"/guide/releases"}},[e._v("the release notes")])])]),e._v(" "),a("h2",{attrs:{id:"update-the-api-example-repository"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#update-the-api-example-repository"}},[e._v("#")]),e._v(" Update the API example repository")]),e._v(" "),a("ul",[a("li",[e._v("Update the Ontop version in "),a("a",{attrs:{href:"https://github.com/ontop/ontop-api-examples",target:"_blank",rel:"noopener"}},[e._v("https://github.com/ontop/ontop-api-examples"),a("OutboundLink")],1)])]),e._v(" "),a("h2",{attrs:{id:"update-branches-for-next-development-iteration"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#update-branches-for-next-development-iteration"}},[e._v("#")]),e._v(" Update branches for next development iteration")]),e._v(" "),a("ul",[a("li",[e._v("Merge the tag for the release to master and the release branch to develop")])]),e._v(" "),a("div",{staticClass:"language-console extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v("$ git checkout develop\n$ git merge release/v-number #branch\n\n# this step is also for triggering the AutoUpdate of Protege plugin\n$ git checkout master\n$ git merge v-number # tag\n")])])]),a("h2",{attrs:{id:"time-for-celebration"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#time-for-celebration"}},[e._v("#")]),e._v(" Time for celebration!")]),e._v(" "),a("ul",[a("li",[e._v("Send release emails to several mail lists and social media")])])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file diff --git a/assets/js/26.d98cd04f.js b/assets/js/26.f2aa70fe.js similarity index 99% rename from assets/js/26.d98cd04f.js rename to assets/js/26.f2aa70fe.js index 76d644aa1..870ee4c59 100644 --- a/assets/js/26.d98cd04f.js +++ b/assets/js/26.f2aa70fe.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[26],{403:function(e,t,s){"use strict";s.r(t);var a=s(51),n=Object(a.a)({},(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[s("h1",{attrs:{id:"known-issues"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#known-issues"}},[e._v("#")]),e._v(" Known issues")]),e._v(" "),s("div",{staticClass:"custom-block danger"},[s("p",{staticClass:"custom-block-title"},[e._v("WARNING")]),e._v(" "),s("p",[e._v("THIS PAGE IS OUTDATED.")]),e._v(" "),s("p",[e._v("TODO: check these points and move them somewhere else if still relevant.")])]),e._v(" "),s("h2",{attrs:{id:"rdf"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#rdf"}},[e._v("#")]),e._v(" RDF")]),e._v(" "),s("ul",[s("li",[s("code",[e._v("GRAPH")]),e._v(" is not supported yet")])]),e._v(" "),s("h2",{attrs:{id:"sparql"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#sparql"}},[e._v("#")]),e._v(" SPARQL")]),e._v(" "),s("ul",[s("li",[s("code",[e._v("ORDER BY")]),e._v(" doesn't support functions as parameters, accepts variables only. Example:")])]),e._v(" "),s("div",{staticClass:"language-sql extra-class"},[s("pre",{pre:!0,attrs:{class:"language-sql"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("SELECT")]),e._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("ORDER")]),e._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("BY")]),e._v(" str"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),e._v("?o"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\n \n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("SELECT")]),e._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("ORDER")]),e._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("BY")]),e._v(" xsd:"),s("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("integer")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),e._v("?o"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("SELECT")]),e._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("ORDER")]),e._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("BY")]),e._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),e._v("?o1 "),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v("+")]),e._v(" ?o2"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\n")])])]),s("ul",[s("li",[s("p",[s("code",[e._v("REGEX")]),e._v(" is not supported by MsSQL and DB2, while the other databases handle it differently: see [[Regex SPARQL filter]]")])]),e._v(" "),s("li",[s("p",[s("code",[e._v("URI")]),e._v(" with a hierarchical directory path of the form directory/directory/.../name are supported if we use them without prefix or with complete prefix. Example we can query "),s("code",[e._v("")]),e._v(" using it as it is or with a complete prefix as:")])])]),e._v(" "),s("div",{staticClass:"language-sql extra-class"},[s("pre",{pre:!0,attrs:{class:"language-sql"}},[s("code",[e._v("PREFIX bmwSection: http:"),s("span",{pre:!0,attrs:{class:"token comment"}},[e._v("//en.wikipedia.org/wiki/BMW_7_Series#section/")]),e._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("SELECT")]),e._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v("*")]),e._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("WHERE")]),e._v(" {?x ?y bmwSection:help}\n")])])]),s("p",[e._v("It is not supported the form:")]),e._v(" "),s("div",{staticClass:"language-sql extra-class"},[s("pre",{pre:!0,attrs:{class:"language-sql"}},[s("code",[e._v("PREFIX bmw: http:"),s("span",{pre:!0,attrs:{class:"token comment"}},[e._v("//en.wikipedia.org/wiki/BMW_7_Series#")]),e._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("SELECT")]),e._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v("*")]),e._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("WHERE")]),e._v(" {?x ?y bmw:section"),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v("/")]),e._v("help}\n")])])]),s("ul",[s("li",[e._v("No support for cast functions (e.g. xsd:string(...), xsd:integer(...) ).")]),e._v(" "),s("li",[s("code",[e._v("REPLACE")]),e._v(" function is supported with some limitations based on the database used. See [[Replace SPARQL filter]].")]),e._v(" "),s("li",[e._v("Do not use "),s("code",[e._v("SELECT Expressions")]),e._v(" with more variable declarations, use the correspondant version with BIND. Example:\nInstead of:")])]),e._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("SELECT ?title (?p AS ?fullPrice) (?fullPrice*?discount) AS ?customerPrice)\n{ ?x ns:price ?p .\n ?x dc:title ?title . \n ?x ns:discount ?discount .\n}\n")])])]),s("p",[e._v("Use:")]),e._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("SELECT ?title (?fullPrice*?discount) AS ?customerPrice)\n{ \n ?x dc:title ?title . \n ?x ns:discount ?discount .\n BIND (?p AS ?fullPrice)\n ?x ns:price ?fullPrice .\n}\n")])])]),s("ul",[s("li",[e._v("Hash functions in oracle are supported only if DBMS_CRYPTO is enabled by the DBA.")]),e._v(" "),s("li",[s("code",[e._v("Hash")]),e._v(", "),s("code",[e._v("timezone")]),e._v(" and "),s("code",[e._v("uiid")]),e._v(" functions are supported based on the database see [[OntopSPARQLFunctions |Supported Sparql Functions]] for more information.")]),e._v(" "),s("li",[e._v("Using Oracle "),s("code",[e._v("strBefore")]),e._v(" and "),s("code",[e._v("strAfter")]),e._v(" SPARQL functions return null instead of an empty string when no result has been found.")]),e._v(" "),s("li",[s("code",[e._v("IF")]),e._v(", "),s("code",[e._v("COALESCE")]),e._v(", "),s("code",[e._v("EXISTS")]),e._v(", "),s("code",[e._v("NOT EXISTS")]),e._v(", "),s("code",[e._v("IN")]),e._v(", "),s("code",[e._v("NOT IN")]),e._v(", "),s("code",[e._v("STRDT")]),e._v(", "),s("code",[e._v("timezone")]),e._v(" and "),s("code",[e._v("SHA384")]),e._v(" functions are not supported .")])]),e._v(" "),s("h2",{attrs:{id:"mapping"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#mapping"}},[e._v("#")]),e._v(" Mapping")]),e._v(" "),s("div",{staticClass:"custom-block warning"},[s("p",{staticClass:"custom-block-title"},[e._v("WARNING")]),e._v(" "),s("p",[e._v("Are Bnodes supported in the mapping?")])]),e._v(" "),s("h2",{attrs:{id:"owl-api"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#owl-api"}},[e._v("#")]),e._v(" OWL API")]),e._v(" "),s("ul",[s("li",[s("p",[s("code",[e._v("Implementation")]),e._v(" of most OWLReasoner methods is missing.")])]),e._v(" "),s("li",[s("p",[s("code",[e._v("Symbol @")]),e._v(' When we pass a literal to the OWL API, if it finds an "@" it will interpret it as a language tag. The OWL API says:')])])]),e._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("\"If the datatype is rdf:PlainLiteral, and the lexical value contains\na language tag then the language tag will be parsed out of the lexical value. For example, \"abc@en\"^^rdf:PlainLiteral would be parsed into a lexical value of 'abc' and a language tag of 'en'. \"\n")])])]),s("p",[e._v("Thus, if one expects such symbols in an object property the best solutions are:")]),e._v(" "),s("ol",[s("li",[e._v("cast the object to string in the mapping")]),e._v(" "),s("li",[e._v("replace the @ in the query with @.")])]),e._v(" "),s("h2",{attrs:{id:"databases-and-sql"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#databases-and-sql"}},[e._v("#")]),e._v(" Databases and SQL")]),e._v(" "),s("ul",[s("li",[s("code",[e._v("Registered Keywords")]),e._v(" - when you have a column name that is also a registered DBMS keyword, you should enclose that column name in quotes. Supported common keywords are: cast, do, extract, first, following, last, materialized, nulls, partition, range, row, rows, siblings, value, xml.")]),e._v(" "),s("li",[s("code",[e._v("ORDER BY")]),e._v(" in H2: in presence of an Union, the last version of H2 (1.4.), it orders both subqueries independently of each other giving wrong results. See SPARQL-compliance test offset-1")]),e._v(" "),s("li",[s("code",[e._v("UNOPTIMIZED SQL OPERATORS/FUNCTIONS")]),e._v(": MIN/MAX, CASE, WHEN clause, DATE FUNCTIONS, NESTED SELECTS, MATCHES, RIGHT/FULL/SELF/CARTESIAN JOIN, SUBJOIN, ALL, ANY, UNION, INTERSECT, MINUM and EXCEPT: Unoptimized sql operators will be transformed in view and generate a result.")]),e._v(" "),s("li",[s("code",[e._v("UNSUPPORTED SQL OPERATORS")]),e._v(": EXISTS, UNIQUE, TOP")]),e._v(" "),s("li",[s("code",[e._v("REGEX OPERATOR")]),e._v(" is not supported by MsSQL and DB2, while the other databases handle it differently")])]),e._v(" "),s("h2",{attrs:{id:"r2rml-mappings"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#r2rml-mappings"}},[e._v("#")]),e._v(" R2RML mappings")]),e._v(" "),s("div",{staticClass:"custom-block warning"},[s("p",{staticClass:"custom-block-title"},[e._v("WARNING")]),e._v(" "),s("p",[e._v("Are Bnodes supported in the mapping?")])]),e._v(" "),s("ul",[s("li",[e._v("no support for "),s("code",[e._v("inverseExpression")])]),e._v(" "),s("li",[e._v("predicate cannot be uritemplate (column reference or template declaration)")]),e._v(" "),s("li",[e._v("object cannot be uritemplate (column reference or template declaration) when predicate is rdf:type")]),e._v(" "),s("li",[e._v("no support for "),s("code",[e._v("bnode")]),e._v(" in Ontop")]),e._v(" "),s("li",[e._v("no support for "),s("code",[e._v("sqlversion")])]),e._v(" "),s("li",[e._v("no support for "),s("code",[e._v("graphMaps")]),e._v(" (hence context graphs)")]),e._v(" "),s("li",[e._v("bnode naming is arbitrary")]),e._v(" "),s("li",[e._v('constant type objects are returned as simple literal. Constant-valued term maps are not considered as having a term type, and specifying rr:termType on these term maps has no effect.\nFor example we return "2011-01-04T00:00:00.0"\ninstead of "2011-01-04T00:00:00.0"^^xsd:dateTime')])]),e._v(" "),s("p",[e._v("The current state of the W3C R2RML compliance tests could be seen [[W3C-R2RML-Compliance| here]]")]),e._v(" "),s("h2",{attrs:{id:"ontop-bootstrapper"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#ontop-bootstrapper"}},[e._v("#")]),e._v(" Ontop Bootstrapper")]),e._v(" "),s("div",{staticClass:"custom-block warning"},[s("p",{staticClass:"custom-block-title"},[e._v("WARNING")]),e._v(" "),s("p",[e._v("Are Bnodes supported in the mapping?")])]),e._v(" "),s("ul",[s("li",[e._v("The BNode syntax generated by Ontop bootstrapper cannot be processed by Ontop")]),e._v(" "),s("li",[e._v("Foreign keys on multiple columns are not supported")])])])}),[],!1,null,null,null);t.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[26],{402:function(e,t,s){"use strict";s.r(t);var a=s(51),n=Object(a.a)({},(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[s("h1",{attrs:{id:"known-issues"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#known-issues"}},[e._v("#")]),e._v(" Known issues")]),e._v(" "),s("div",{staticClass:"custom-block danger"},[s("p",{staticClass:"custom-block-title"},[e._v("WARNING")]),e._v(" "),s("p",[e._v("THIS PAGE IS OUTDATED.")]),e._v(" "),s("p",[e._v("TODO: check these points and move them somewhere else if still relevant.")])]),e._v(" "),s("h2",{attrs:{id:"rdf"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#rdf"}},[e._v("#")]),e._v(" RDF")]),e._v(" "),s("ul",[s("li",[s("code",[e._v("GRAPH")]),e._v(" is not supported yet")])]),e._v(" "),s("h2",{attrs:{id:"sparql"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#sparql"}},[e._v("#")]),e._v(" SPARQL")]),e._v(" "),s("ul",[s("li",[s("code",[e._v("ORDER BY")]),e._v(" doesn't support functions as parameters, accepts variables only. Example:")])]),e._v(" "),s("div",{staticClass:"language-sql extra-class"},[s("pre",{pre:!0,attrs:{class:"language-sql"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("SELECT")]),e._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("ORDER")]),e._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("BY")]),e._v(" str"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),e._v("?o"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\n \n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("SELECT")]),e._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("ORDER")]),e._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("BY")]),e._v(" xsd:"),s("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("integer")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),e._v("?o"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("SELECT")]),e._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("ORDER")]),e._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("BY")]),e._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),e._v("?o1 "),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v("+")]),e._v(" ?o2"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),e._v("\n")])])]),s("ul",[s("li",[s("p",[s("code",[e._v("REGEX")]),e._v(" is not supported by MsSQL and DB2, while the other databases handle it differently: see [[Regex SPARQL filter]]")])]),e._v(" "),s("li",[s("p",[s("code",[e._v("URI")]),e._v(" with a hierarchical directory path of the form directory/directory/.../name are supported if we use them without prefix or with complete prefix. Example we can query "),s("code",[e._v("")]),e._v(" using it as it is or with a complete prefix as:")])])]),e._v(" "),s("div",{staticClass:"language-sql extra-class"},[s("pre",{pre:!0,attrs:{class:"language-sql"}},[s("code",[e._v("PREFIX bmwSection: http:"),s("span",{pre:!0,attrs:{class:"token comment"}},[e._v("//en.wikipedia.org/wiki/BMW_7_Series#section/")]),e._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("SELECT")]),e._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v("*")]),e._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("WHERE")]),e._v(" {?x ?y bmwSection:help}\n")])])]),s("p",[e._v("It is not supported the form:")]),e._v(" "),s("div",{staticClass:"language-sql extra-class"},[s("pre",{pre:!0,attrs:{class:"language-sql"}},[s("code",[e._v("PREFIX bmw: http:"),s("span",{pre:!0,attrs:{class:"token comment"}},[e._v("//en.wikipedia.org/wiki/BMW_7_Series#")]),e._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("SELECT")]),e._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v("*")]),e._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("WHERE")]),e._v(" {?x ?y bmw:section"),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v("/")]),e._v("help}\n")])])]),s("ul",[s("li",[e._v("No support for cast functions (e.g. xsd:string(...), xsd:integer(...) ).")]),e._v(" "),s("li",[s("code",[e._v("REPLACE")]),e._v(" function is supported with some limitations based on the database used. See [[Replace SPARQL filter]].")]),e._v(" "),s("li",[e._v("Do not use "),s("code",[e._v("SELECT Expressions")]),e._v(" with more variable declarations, use the correspondant version with BIND. Example:\nInstead of:")])]),e._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("SELECT ?title (?p AS ?fullPrice) (?fullPrice*?discount) AS ?customerPrice)\n{ ?x ns:price ?p .\n ?x dc:title ?title . \n ?x ns:discount ?discount .\n}\n")])])]),s("p",[e._v("Use:")]),e._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("SELECT ?title (?fullPrice*?discount) AS ?customerPrice)\n{ \n ?x dc:title ?title . \n ?x ns:discount ?discount .\n BIND (?p AS ?fullPrice)\n ?x ns:price ?fullPrice .\n}\n")])])]),s("ul",[s("li",[e._v("Hash functions in oracle are supported only if DBMS_CRYPTO is enabled by the DBA.")]),e._v(" "),s("li",[s("code",[e._v("Hash")]),e._v(", "),s("code",[e._v("timezone")]),e._v(" and "),s("code",[e._v("uiid")]),e._v(" functions are supported based on the database see [[OntopSPARQLFunctions |Supported Sparql Functions]] for more information.")]),e._v(" "),s("li",[e._v("Using Oracle "),s("code",[e._v("strBefore")]),e._v(" and "),s("code",[e._v("strAfter")]),e._v(" SPARQL functions return null instead of an empty string when no result has been found.")]),e._v(" "),s("li",[s("code",[e._v("IF")]),e._v(", "),s("code",[e._v("COALESCE")]),e._v(", "),s("code",[e._v("EXISTS")]),e._v(", "),s("code",[e._v("NOT EXISTS")]),e._v(", "),s("code",[e._v("IN")]),e._v(", "),s("code",[e._v("NOT IN")]),e._v(", "),s("code",[e._v("STRDT")]),e._v(", "),s("code",[e._v("timezone")]),e._v(" and "),s("code",[e._v("SHA384")]),e._v(" functions are not supported .")])]),e._v(" "),s("h2",{attrs:{id:"mapping"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#mapping"}},[e._v("#")]),e._v(" Mapping")]),e._v(" "),s("div",{staticClass:"custom-block warning"},[s("p",{staticClass:"custom-block-title"},[e._v("WARNING")]),e._v(" "),s("p",[e._v("Are Bnodes supported in the mapping?")])]),e._v(" "),s("h2",{attrs:{id:"owl-api"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#owl-api"}},[e._v("#")]),e._v(" OWL API")]),e._v(" "),s("ul",[s("li",[s("p",[s("code",[e._v("Implementation")]),e._v(" of most OWLReasoner methods is missing.")])]),e._v(" "),s("li",[s("p",[s("code",[e._v("Symbol @")]),e._v(' When we pass a literal to the OWL API, if it finds an "@" it will interpret it as a language tag. The OWL API says:')])])]),e._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("\"If the datatype is rdf:PlainLiteral, and the lexical value contains\na language tag then the language tag will be parsed out of the lexical value. For example, \"abc@en\"^^rdf:PlainLiteral would be parsed into a lexical value of 'abc' and a language tag of 'en'. \"\n")])])]),s("p",[e._v("Thus, if one expects such symbols in an object property the best solutions are:")]),e._v(" "),s("ol",[s("li",[e._v("cast the object to string in the mapping")]),e._v(" "),s("li",[e._v("replace the @ in the query with @.")])]),e._v(" "),s("h2",{attrs:{id:"databases-and-sql"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#databases-and-sql"}},[e._v("#")]),e._v(" Databases and SQL")]),e._v(" "),s("ul",[s("li",[s("code",[e._v("Registered Keywords")]),e._v(" - when you have a column name that is also a registered DBMS keyword, you should enclose that column name in quotes. Supported common keywords are: cast, do, extract, first, following, last, materialized, nulls, partition, range, row, rows, siblings, value, xml.")]),e._v(" "),s("li",[s("code",[e._v("ORDER BY")]),e._v(" in H2: in presence of an Union, the last version of H2 (1.4.), it orders both subqueries independently of each other giving wrong results. See SPARQL-compliance test offset-1")]),e._v(" "),s("li",[s("code",[e._v("UNOPTIMIZED SQL OPERATORS/FUNCTIONS")]),e._v(": MIN/MAX, CASE, WHEN clause, DATE FUNCTIONS, NESTED SELECTS, MATCHES, RIGHT/FULL/SELF/CARTESIAN JOIN, SUBJOIN, ALL, ANY, UNION, INTERSECT, MINUM and EXCEPT: Unoptimized sql operators will be transformed in view and generate a result.")]),e._v(" "),s("li",[s("code",[e._v("UNSUPPORTED SQL OPERATORS")]),e._v(": EXISTS, UNIQUE, TOP")]),e._v(" "),s("li",[s("code",[e._v("REGEX OPERATOR")]),e._v(" is not supported by MsSQL and DB2, while the other databases handle it differently")])]),e._v(" "),s("h2",{attrs:{id:"r2rml-mappings"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#r2rml-mappings"}},[e._v("#")]),e._v(" R2RML mappings")]),e._v(" "),s("div",{staticClass:"custom-block warning"},[s("p",{staticClass:"custom-block-title"},[e._v("WARNING")]),e._v(" "),s("p",[e._v("Are Bnodes supported in the mapping?")])]),e._v(" "),s("ul",[s("li",[e._v("no support for "),s("code",[e._v("inverseExpression")])]),e._v(" "),s("li",[e._v("predicate cannot be uritemplate (column reference or template declaration)")]),e._v(" "),s("li",[e._v("object cannot be uritemplate (column reference or template declaration) when predicate is rdf:type")]),e._v(" "),s("li",[e._v("no support for "),s("code",[e._v("bnode")]),e._v(" in Ontop")]),e._v(" "),s("li",[e._v("no support for "),s("code",[e._v("sqlversion")])]),e._v(" "),s("li",[e._v("no support for "),s("code",[e._v("graphMaps")]),e._v(" (hence context graphs)")]),e._v(" "),s("li",[e._v("bnode naming is arbitrary")]),e._v(" "),s("li",[e._v('constant type objects are returned as simple literal. Constant-valued term maps are not considered as having a term type, and specifying rr:termType on these term maps has no effect.\nFor example we return "2011-01-04T00:00:00.0"\ninstead of "2011-01-04T00:00:00.0"^^xsd:dateTime')])]),e._v(" "),s("p",[e._v("The current state of the W3C R2RML compliance tests could be seen [[W3C-R2RML-Compliance| here]]")]),e._v(" "),s("h2",{attrs:{id:"ontop-bootstrapper"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#ontop-bootstrapper"}},[e._v("#")]),e._v(" Ontop Bootstrapper")]),e._v(" "),s("div",{staticClass:"custom-block warning"},[s("p",{staticClass:"custom-block-title"},[e._v("WARNING")]),e._v(" "),s("p",[e._v("Are Bnodes supported in the mapping?")])]),e._v(" "),s("ul",[s("li",[e._v("The BNode syntax generated by Ontop bootstrapper cannot be processed by Ontop")]),e._v(" "),s("li",[e._v("Foreign keys on multiple columns are not supported")])])])}),[],!1,null,null,null);t.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/27.906526eb.js b/assets/js/27.1d29815b.js similarity index 95% rename from assets/js/27.906526eb.js rename to assets/js/27.1d29815b.js index c1a7d7e88..7f8c8ebb0 100644 --- a/assets/js/27.906526eb.js +++ b/assets/js/27.1d29815b.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[27],{404:function(t,s,a){"use strict";a.r(s);var e=a(51),r=Object(e.a)({},(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"statistics"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#statistics"}},[t._v("#")]),t._v(" Statistics")]),t._v(" "),a("h2",{attrs:{id:"downloads"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#downloads"}},[t._v("#")]),t._v(" Downloads")]),t._v(" "),a("h3",{attrs:{id:"github-releases"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#github-releases"}},[t._v("#")]),t._v(" Github releases")]),t._v(" "),a("p",[t._v("For all the versions 4.x:")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("curl")]),t._v(" -H "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Accept: application/vnd.github.v3+json"')]),t._v(" https://api.github.com/repos/ontop/ontop/releases "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" jq "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'[.[] | select((.tag_name | startswith(\"ontop-4.\"))) | .assets[] | .download_count ] | add'")]),t._v(" \n")])])])])}),[],!1,null,null,null);s.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[27],{403:function(t,s,a){"use strict";a.r(s);var e=a(51),r=Object(e.a)({},(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"statistics"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#statistics"}},[t._v("#")]),t._v(" Statistics")]),t._v(" "),a("h2",{attrs:{id:"downloads"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#downloads"}},[t._v("#")]),t._v(" Downloads")]),t._v(" "),a("h3",{attrs:{id:"github-releases"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#github-releases"}},[t._v("#")]),t._v(" Github releases")]),t._v(" "),a("p",[t._v("For all the versions 4.x:")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("curl")]),t._v(" -H "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Accept: application/vnd.github.v3+json"')]),t._v(" https://api.github.com/repos/ontop/ontop/releases "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" jq "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'[.[] | select((.tag_name | startswith(\"ontop-4.\"))) | .assets[] | .download_count ] | add'")]),t._v(" \n")])])])])}),[],!1,null,null,null);s.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/28.acec5bcd.js b/assets/js/28.435228a6.js similarity index 99% rename from assets/js/28.acec5bcd.js rename to assets/js/28.435228a6.js index 409138fde..410472068 100644 --- a/assets/js/28.acec5bcd.js +++ b/assets/js/28.435228a6.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[28],{405:function(e,a,t){"use strict";t.r(a);var r=t(51),n=Object(r.a)({},(function(){var e=this,a=e.$createElement,t=e._self._c||a;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"introduction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[e._v("#")]),e._v(" Introduction")]),e._v(" "),t("p",[e._v("Ontop is a Virtual Knowledge Graph system.\nIt exposes the content of arbitrary relational databases as knowledge graphs. These graphs are virtual, which means that data remains in the data sources instead of being moved to another database.")]),e._v(" "),t("p",[e._v("Ontop translates "),t("a",{attrs:{href:"https://www.w3.org/TR/sparql11-query/",target:"_blank",rel:"noopener"}},[e._v("SPARQL queries"),t("OutboundLink")],1),e._v(" expressed over the knowledge graphs into SQL queries executed by the relational data sources. It relies on "),t("a",{attrs:{href:"https://www.w3.org/TR/r2rml/",target:"_blank",rel:"noopener"}},[e._v("R2RML mappings"),t("OutboundLink")],1),e._v(" and can take advantage of lightweight ontologies.")]),e._v(" "),t("h2",{attrs:{id:"versions"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#versions"}},[e._v("#")]),e._v(" Versions")]),e._v(" "),t("p",[e._v("This documentation is for Ontop 3.0 and more recent versions.")]),e._v(" "),t("p",[e._v("For earlier versions, please refer to "),t("a",{attrs:{href:"https://github.com/ontop/ontop/wiki",target:"_blank",rel:"noopener"}},[e._v("our previous Wiki"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("Most recent version:")]),e._v(" "),t("ul",[t("li",[e._v("Stable: Ontop 5.1.1, released on November 22, 2023.")])]),e._v(" "),t("p",[e._v("See "),t("a",{attrs:{href:"/guide/releases"}},[e._v("release notes")]),e._v(" for more details.")]),e._v(" "),t("h2",{attrs:{id:"main-features"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#main-features"}},[e._v("#")]),e._v(" Main features")]),e._v(" "),t("ul",[t("li",[e._v("Uses "),t("a",{attrs:{href:"/guide/compliance#rdf-1-1"}},[e._v("RDF 1.1")]),e._v(" as graph data model")]),e._v(" "),t("li",[e._v("Supports RDFS and OWL 2 QL ontologies")]),e._v(" "),t("li",[e._v("Supports "),t("a",{attrs:{href:"/guide/compliance#r2rml"}},[e._v("R2RML")]),e._v(" and Ontop mappings")]),e._v(" "),t("li",[e._v("Supports "),t("a",{attrs:{href:"/guide/compliance#sparql-1-1"}},[e._v("the majority of SPARQL 1.1 features")]),e._v(", including the main SPARQL aggregation functions (since 4.0.0) and "),t("a",{attrs:{href:"/guide/compliance#geosparql-1-0"}},[e._v("GeoSPARQL functions")]),e._v(" (since 4.1.0)")]),e._v(" "),t("li",[e._v("Can be deployed as "),t("a",{attrs:{href:"/guide/cli#ontop-endpoint"}},[e._v("a SPARQL endpoint")]),e._v(" and as "),t("a",{attrs:{href:"/guide/advanced/predefined"}},[e._v("a predefined query endpoint")]),e._v(" (since 4.1.0)")]),e._v(" "),t("li",[e._v("Produces efficient SQL queries by applying many optimizations")]),e._v(" "),t("li",[e._v("Supports the main database systems: "),t("a",{attrs:{href:"/guide/databases/postgres"}},[e._v("PostgreSQL")]),e._v(", "),t("a",{attrs:{href:"/guide/databases/mysql"}},[e._v("MySQL")]),e._v(", "),t("a",{attrs:{href:"/guide/databases/mariadb"}},[e._v("MariaDB")]),e._v(" (since 5.0.0), "),t("a",{attrs:{href:"/guide/databases/mssql"}},[e._v("SQL Server")]),e._v(", "),t("a",{attrs:{href:"/guide/databases/oracle"}},[e._v("Oracle")]),e._v(", "),t("a",{attrs:{href:"/guide/databases/db2"}},[e._v("DB2")]),e._v(", "),t("a",{attrs:{href:"/guide/databases/snowflake"}},[e._v("Snowflake")]),e._v(" (since 5.0.0), "),t("a",{attrs:{href:"/guide/databases/databricks"}},[e._v("Databricks")]),e._v(" (since 5.0.0), "),t("a",{attrs:{href:"/guide/databases/bigquery"}},[e._v("Google BigQuery")]),e._v(" (since 5.0.2), "),t("a",{attrs:{href:"/guide/databases/redshift"}},[e._v("AWS Redshift")]),e._v(" (since 5.0.2), "),t("a",{attrs:{href:"/guide/databases/duckdb"}},[e._v("DuckDB")]),e._v(" (since 5.0.2), and "),t("a",{attrs:{href:"/guide/databases/dynamodb"}},[e._v("AWS DynamoDB")]),e._v(" (since 5.1.0)")]),e._v(" "),t("li",[e._v("Supports database federators such as "),t("a",{attrs:{href:"/guide/databases/denodo"}},[e._v("Denodo")]),e._v(", "),t("a",{attrs:{href:"/guide/databases/dremio"}},[e._v("Dremio")]),e._v(" (since 4.1.0), Teiid (since 4.1.1), "),t("a",{attrs:{href:"/guide/databases/spark"}},[e._v("Apache Spark")]),e._v(" (since 4.2.0) and "),t("a",{attrs:{href:"/guide/databases/trino"}},[e._v("Trino")]),e._v(" / "),t("a",{attrs:{href:"/guide/databases/presto"}},[e._v("PrestoDB")]),e._v(" / "),t("a",{attrs:{href:"/guide/databases/athena"}},[e._v("AWS Athena")]),e._v(" (since 5.0.2)")]),e._v(" "),t("li",[e._v("Supports "),t("a",{attrs:{href:"/guide/advanced/lenses"}},[e._v("lenses")]),e._v(' which are "virtual views" specified outside of the data sources (since 4.2.0)')]),e._v(" "),t("li",[e._v("Can "),t("a",{attrs:{href:"/guide/cli#ontop-materialize"}},[e._v("materialize")]),e._v(" virtual graphs into RDF files")]),e._v(" "),t("li",[e._v("Provides a plugin for editing and testing mappings in the "),t("a",{attrs:{href:"https://protege.stanford.edu/",target:"_blank",rel:"noopener"}},[e._v("Protégé ontology editor"),t("OutboundLink")],1)])]),e._v(" "),t("h2",{attrs:{id:"organizations"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#organizations"}},[e._v("#")]),e._v(" Organizations")]),e._v(" "),t("p",[e._v("Ontop is backed by the "),t("a",{attrs:{href:"https://www.inf.unibz.it/krdb/in2data/",target:"_blank",rel:"noopener"}},[e._v("Free University of Bozen-Bolzano"),t("OutboundLink")],1),e._v(" and "),t("a",{attrs:{href:"https://ontopic.ai",target:"_blank",rel:"noopener"}},[e._v("Ontopic s.r.l."),t("OutboundLink")],1),e._v(". It also receives regular important contributions from "),t("a",{attrs:{href:"https://www.uib.no",target:"_blank",rel:"noopener"}},[e._v("University of Bergen"),t("OutboundLink")],1),e._v(" and "),t("a",{attrs:{href:"http://www.bbk.ac.uk/",target:"_blank",rel:"noopener"}},[e._v("Birkbeck, University of London"),t("OutboundLink")],1),e._v(". See the "),t("a",{attrs:{href:"/community"}},[e._v("community section")]),e._v(" for more details.")]),e._v(" "),t("h2",{attrs:{id:"licenses"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#licenses"}},[e._v("#")]),e._v(" Licenses")]),e._v(" "),t("p",[e._v("Ontop is available under the "),t("a",{attrs:{href:"https://www.apache.org/licenses/LICENSE-2.0",target:"_blank",rel:"noopener"}},[e._v("Apache 2.0"),t("OutboundLink")],1),e._v(" license.")]),e._v(" "),t("p",[e._v("All the documentation is licensed under the\n"),t("a",{attrs:{href:"http://creativecommons.org/licenses/by/4.0/",target:"_blank",rel:"noopener"}},[e._v("Creative Commons (Attribution)"),t("OutboundLink")],1),e._v("\nlicense.")]),e._v(" "),t("h2",{attrs:{id:"social"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#social"}},[e._v("#")]),e._v(" Social")]),e._v(" "),t("p",[e._v("You can find us on the following social platforms:")]),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"https://twitter.com/ontop4obda",target:"_blank",rel:"noopener"}},[e._v("Twitter (ontop4obda)"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{rel:"me",href:"https://fosstodon.org/@ontop"}},[e._v("Mastodon (@ontop@fosstodon.org)")])]),e._v(" "),t("li",[t("a",{attrs:{href:"https://www.facebook.com/obdaontop/",target:"_blank",rel:"noopener"}},[e._v("Facebook (obdaontop)"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://groups.google.com/forum/#!forum/ontop4obda",target:"_blank",rel:"noopener"}},[e._v("Google Group (ontop4obda)"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://github.com/ontop/ontop/",target:"_blank",rel:"noopener"}},[e._v("GitHub (ontop/ontop)"),t("OutboundLink")],1)])]),e._v(" "),t("h2",{attrs:{id:"citations"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#citations"}},[e._v("#")]),e._v(" Citations")]),e._v(" "),t("ul",[t("li",[t("p",[e._v("If you use Ontop in your work, please cite one of the following articles describing the system.")]),e._v(" "),t("ul",[t("li",[e._v("Guohui Xiao, Davide Lanti, Roman Kontchakov, Sarah Komla-Ebri, Elem Güzel-Kalayci, Linfang Ding, Julien Corman, Benjamin Cogrel, Diego Calvanese, and Elena Botoeva. "),t("a",{attrs:{href:"https://research.bcgl.fr/pdfs/ontop-iswc20.pdf",target:"_blank",rel:"noopener"}},[e._v("The Virtual Knowledge Graph System Ontop"),t("OutboundLink")],1),e._v(". In: International Semantic Web Conference (Resource Track), 2020.")]),e._v(" "),t("li",[e._v("Diego Calvanese, Benjamin Cogrel, Sarah Komla-Ebri, Roman Kontchakov, Davide Lanti, Martin Rezk, Mariano Rodriguez-Muro, and Guohui Xiao. "),t("a",{attrs:{href:"http://www.semantic-web-journal.net/content/ontop-answering-sparql-queries-over-relational-databases-1",target:"_blank",rel:"noopener"}},[e._v("Ontop: Answering SPARQL Queries over Relational Databases"),t("OutboundLink")],1),e._v(". In: Semantic Web Journal 8.3 (2017), pp. 471–487.")])])]),e._v(" "),t("li",[t("p",[e._v("If you want to cite the techniques behind Ontop, check "),t("a",{attrs:{href:"/research/publications"}},[e._v("our publications")]),e._v(".")])])])])}),[],!1,null,null,null);a.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[28],{406:function(e,a,t){"use strict";t.r(a);var r=t(51),n=Object(r.a)({},(function(){var e=this,a=e.$createElement,t=e._self._c||a;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"introduction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[e._v("#")]),e._v(" Introduction")]),e._v(" "),t("p",[e._v("Ontop is a Virtual Knowledge Graph system.\nIt exposes the content of arbitrary relational databases as knowledge graphs. These graphs are virtual, which means that data remains in the data sources instead of being moved to another database.")]),e._v(" "),t("p",[e._v("Ontop translates "),t("a",{attrs:{href:"https://www.w3.org/TR/sparql11-query/",target:"_blank",rel:"noopener"}},[e._v("SPARQL queries"),t("OutboundLink")],1),e._v(" expressed over the knowledge graphs into SQL queries executed by the relational data sources. It relies on "),t("a",{attrs:{href:"https://www.w3.org/TR/r2rml/",target:"_blank",rel:"noopener"}},[e._v("R2RML mappings"),t("OutboundLink")],1),e._v(" and can take advantage of lightweight ontologies.")]),e._v(" "),t("h2",{attrs:{id:"versions"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#versions"}},[e._v("#")]),e._v(" Versions")]),e._v(" "),t("p",[e._v("This documentation is for Ontop 3.0 and more recent versions.")]),e._v(" "),t("p",[e._v("For earlier versions, please refer to "),t("a",{attrs:{href:"https://github.com/ontop/ontop/wiki",target:"_blank",rel:"noopener"}},[e._v("our previous Wiki"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("Most recent version:")]),e._v(" "),t("ul",[t("li",[e._v("Stable: Ontop 5.1.1, released on November 22, 2023.")])]),e._v(" "),t("p",[e._v("See "),t("a",{attrs:{href:"/guide/releases"}},[e._v("release notes")]),e._v(" for more details.")]),e._v(" "),t("h2",{attrs:{id:"main-features"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#main-features"}},[e._v("#")]),e._v(" Main features")]),e._v(" "),t("ul",[t("li",[e._v("Uses "),t("a",{attrs:{href:"/guide/compliance#rdf-1-1"}},[e._v("RDF 1.1")]),e._v(" as graph data model")]),e._v(" "),t("li",[e._v("Supports RDFS and OWL 2 QL ontologies")]),e._v(" "),t("li",[e._v("Supports "),t("a",{attrs:{href:"/guide/compliance#r2rml"}},[e._v("R2RML")]),e._v(" and Ontop mappings")]),e._v(" "),t("li",[e._v("Supports "),t("a",{attrs:{href:"/guide/compliance#sparql-1-1"}},[e._v("the majority of SPARQL 1.1 features")]),e._v(", including the main SPARQL aggregation functions (since 4.0.0) and "),t("a",{attrs:{href:"/guide/compliance#geosparql-1-0"}},[e._v("GeoSPARQL functions")]),e._v(" (since 4.1.0)")]),e._v(" "),t("li",[e._v("Can be deployed as "),t("a",{attrs:{href:"/guide/cli#ontop-endpoint"}},[e._v("a SPARQL endpoint")]),e._v(" and as "),t("a",{attrs:{href:"/guide/advanced/predefined"}},[e._v("a predefined query endpoint")]),e._v(" (since 4.1.0)")]),e._v(" "),t("li",[e._v("Produces efficient SQL queries by applying many optimizations")]),e._v(" "),t("li",[e._v("Supports the main database systems: "),t("a",{attrs:{href:"/guide/databases/postgres"}},[e._v("PostgreSQL")]),e._v(", "),t("a",{attrs:{href:"/guide/databases/mysql"}},[e._v("MySQL")]),e._v(", "),t("a",{attrs:{href:"/guide/databases/mariadb"}},[e._v("MariaDB")]),e._v(" (since 5.0.0), "),t("a",{attrs:{href:"/guide/databases/mssql"}},[e._v("SQL Server")]),e._v(", "),t("a",{attrs:{href:"/guide/databases/oracle"}},[e._v("Oracle")]),e._v(", "),t("a",{attrs:{href:"/guide/databases/db2"}},[e._v("DB2")]),e._v(", "),t("a",{attrs:{href:"/guide/databases/snowflake"}},[e._v("Snowflake")]),e._v(" (since 5.0.0), "),t("a",{attrs:{href:"/guide/databases/databricks"}},[e._v("Databricks")]),e._v(" (since 5.0.0), "),t("a",{attrs:{href:"/guide/databases/bigquery"}},[e._v("Google BigQuery")]),e._v(" (since 5.0.2), "),t("a",{attrs:{href:"/guide/databases/redshift"}},[e._v("AWS Redshift")]),e._v(" (since 5.0.2), "),t("a",{attrs:{href:"/guide/databases/duckdb"}},[e._v("DuckDB")]),e._v(" (since 5.0.2), and "),t("a",{attrs:{href:"/guide/databases/dynamodb"}},[e._v("AWS DynamoDB")]),e._v(" (since 5.1.0)")]),e._v(" "),t("li",[e._v("Supports database federators such as "),t("a",{attrs:{href:"/guide/databases/denodo"}},[e._v("Denodo")]),e._v(", "),t("a",{attrs:{href:"/guide/databases/dremio"}},[e._v("Dremio")]),e._v(" (since 4.1.0), Teiid (since 4.1.1), "),t("a",{attrs:{href:"/guide/databases/spark"}},[e._v("Apache Spark")]),e._v(" (since 4.2.0) and "),t("a",{attrs:{href:"/guide/databases/trino"}},[e._v("Trino")]),e._v(" / "),t("a",{attrs:{href:"/guide/databases/presto"}},[e._v("PrestoDB")]),e._v(" / "),t("a",{attrs:{href:"/guide/databases/athena"}},[e._v("AWS Athena")]),e._v(" (since 5.0.2)")]),e._v(" "),t("li",[e._v("Supports "),t("a",{attrs:{href:"/guide/advanced/lenses"}},[e._v("lenses")]),e._v(' which are "virtual views" specified outside of the data sources (since 4.2.0)')]),e._v(" "),t("li",[e._v("Can "),t("a",{attrs:{href:"/guide/cli#ontop-materialize"}},[e._v("materialize")]),e._v(" virtual graphs into RDF files")]),e._v(" "),t("li",[e._v("Provides a plugin for editing and testing mappings in the "),t("a",{attrs:{href:"https://protege.stanford.edu/",target:"_blank",rel:"noopener"}},[e._v("Protégé ontology editor"),t("OutboundLink")],1)])]),e._v(" "),t("h2",{attrs:{id:"organizations"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#organizations"}},[e._v("#")]),e._v(" Organizations")]),e._v(" "),t("p",[e._v("Ontop is backed by the "),t("a",{attrs:{href:"https://www.inf.unibz.it/krdb/in2data/",target:"_blank",rel:"noopener"}},[e._v("Free University of Bozen-Bolzano"),t("OutboundLink")],1),e._v(" and "),t("a",{attrs:{href:"https://ontopic.ai",target:"_blank",rel:"noopener"}},[e._v("Ontopic s.r.l."),t("OutboundLink")],1),e._v(". It also receives regular important contributions from "),t("a",{attrs:{href:"https://www.uib.no",target:"_blank",rel:"noopener"}},[e._v("University of Bergen"),t("OutboundLink")],1),e._v(" and "),t("a",{attrs:{href:"http://www.bbk.ac.uk/",target:"_blank",rel:"noopener"}},[e._v("Birkbeck, University of London"),t("OutboundLink")],1),e._v(". See the "),t("a",{attrs:{href:"/community"}},[e._v("community section")]),e._v(" for more details.")]),e._v(" "),t("h2",{attrs:{id:"licenses"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#licenses"}},[e._v("#")]),e._v(" Licenses")]),e._v(" "),t("p",[e._v("Ontop is available under the "),t("a",{attrs:{href:"https://www.apache.org/licenses/LICENSE-2.0",target:"_blank",rel:"noopener"}},[e._v("Apache 2.0"),t("OutboundLink")],1),e._v(" license.")]),e._v(" "),t("p",[e._v("All the documentation is licensed under the\n"),t("a",{attrs:{href:"http://creativecommons.org/licenses/by/4.0/",target:"_blank",rel:"noopener"}},[e._v("Creative Commons (Attribution)"),t("OutboundLink")],1),e._v("\nlicense.")]),e._v(" "),t("h2",{attrs:{id:"social"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#social"}},[e._v("#")]),e._v(" Social")]),e._v(" "),t("p",[e._v("You can find us on the following social platforms:")]),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"https://twitter.com/ontop4obda",target:"_blank",rel:"noopener"}},[e._v("Twitter (ontop4obda)"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{rel:"me",href:"https://fosstodon.org/@ontop"}},[e._v("Mastodon (@ontop@fosstodon.org)")])]),e._v(" "),t("li",[t("a",{attrs:{href:"https://www.facebook.com/obdaontop/",target:"_blank",rel:"noopener"}},[e._v("Facebook (obdaontop)"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://groups.google.com/forum/#!forum/ontop4obda",target:"_blank",rel:"noopener"}},[e._v("Google Group (ontop4obda)"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://github.com/ontop/ontop/",target:"_blank",rel:"noopener"}},[e._v("GitHub (ontop/ontop)"),t("OutboundLink")],1)])]),e._v(" "),t("h2",{attrs:{id:"citations"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#citations"}},[e._v("#")]),e._v(" Citations")]),e._v(" "),t("ul",[t("li",[t("p",[e._v("If you use Ontop in your work, please cite one of the following articles describing the system.")]),e._v(" "),t("ul",[t("li",[e._v("Guohui Xiao, Davide Lanti, Roman Kontchakov, Sarah Komla-Ebri, Elem Güzel-Kalayci, Linfang Ding, Julien Corman, Benjamin Cogrel, Diego Calvanese, and Elena Botoeva. "),t("a",{attrs:{href:"https://research.bcgl.fr/pdfs/ontop-iswc20.pdf",target:"_blank",rel:"noopener"}},[e._v("The Virtual Knowledge Graph System Ontop"),t("OutboundLink")],1),e._v(". In: International Semantic Web Conference (Resource Track), 2020.")]),e._v(" "),t("li",[e._v("Diego Calvanese, Benjamin Cogrel, Sarah Komla-Ebri, Roman Kontchakov, Davide Lanti, Martin Rezk, Mariano Rodriguez-Muro, and Guohui Xiao. "),t("a",{attrs:{href:"http://www.semantic-web-journal.net/content/ontop-answering-sparql-queries-over-relational-databases-1",target:"_blank",rel:"noopener"}},[e._v("Ontop: Answering SPARQL Queries over Relational Databases"),t("OutboundLink")],1),e._v(". In: Semantic Web Journal 8.3 (2017), pp. 471–487.")])])]),e._v(" "),t("li",[t("p",[e._v("If you want to cite the techniques behind Ontop, check "),t("a",{attrs:{href:"/research/publications"}},[e._v("our publications")]),e._v(".")])])])])}),[],!1,null,null,null);a.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/29.6957445c.js b/assets/js/29.a693cec1.js similarity index 98% rename from assets/js/29.6957445c.js rename to assets/js/29.a693cec1.js index c13565985..fad408486 100644 --- a/assets/js/29.6957445c.js +++ b/assets/js/29.a693cec1.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[29],{406:function(e,t,a){"use strict";a.r(t);var s=a(51),r=Object(s.a)({},(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[a("h1",{attrs:{id:"http-caching"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#http-caching"}},[e._v("#")]),e._v(" HTTP caching")]),e._v(" "),a("p",[a("em",[e._v("Since 4.1.0.")])]),e._v(" "),a("p",[e._v("HTTP caching allows to reduce the load on the SPARQL endpoint and to provide faster responses to clients.\nIt is particularly useful when many clients issue the same queries and data is not updated at a high frequency.")]),e._v(" "),a("p",[e._v("To enable HTTP caching, add the property "),a("code",[e._v("ontop.http.cacheControl")]),e._v(" in the properties file.\nThis will cause the insertion of a "),a("a",{attrs:{href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control",target:"_blank",rel:"noopener"}},[a("code",[e._v("Cache-Control")]),a("OutboundLink")],1),e._v(" HTTP header in successful responses, with the specified value.")]),e._v(" "),a("div",{staticClass:"custom-block tip"},[a("p",{staticClass:"custom-block-title"},[e._v("Example")]),e._v(" "),a("div",{staticClass:"language-properties extra-class"},[a("pre",{pre:!0,attrs:{class:"language-properties"}},[a("code",[a("span",{pre:!0,attrs:{class:"token attr-name"}},[e._v("ontop.http.cacheControl")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("=")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[e._v("max-age=60, stale-while-revalidate=20, stale-if-error=300")]),e._v("\n")])])]),a("p",[e._v("This entry informs the cache that values can be considered as fresh for 60 seconds. After this period, the cache remains allowed to serve cached results for 20 more seconds while revalidating the requests in the background, or for 300 more seconds in case of error with the upstream server.")])]),e._v(" "),a("p",[e._v("Ontop does not embed a HTTP cache. We recommend setting up a HTTP cache like "),a("a",{attrs:{href:"https://varnish-cache.org/",target:"_blank",rel:"noopener"}},[e._v("Varnish"),a("OutboundLink")],1),e._v(" or "),a("a",{attrs:{href:"http://nginx.org",target:"_blank",rel:"noopener"}},[e._v("Nginx"),a("OutboundLink")],1),e._v(" above the Ontop endpoint.")]),e._v(" "),a("h2",{attrs:{id:"remarks"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#remarks"}},[e._v("#")]),e._v(" Remarks")]),e._v(" "),a("ul",[a("li",[e._v("Most caches (e.g. Nginx but also Web browsers) do not cache POST requests by default. Since most SPARQL queries are sent with the POST method, it is important to turn this option on. This option is safe as Ontop is a read-only system.")]),e._v(" "),a("li",[e._v("Consider using the GET method for sending SPARQL queries so as to take advantage from Web browser caches.")]),e._v(" "),a("li",[e._v("For an example of configuration for Nginx, see "),a("a",{attrs:{href:"https://github.com/noi-techpark/it.bz.opendatahub.sparql/blob/eda53616c252691a73a8eb87963664cd06ca3e93/infrastructure/docker/nginx/default.conf",target:"_blank",rel:"noopener"}},[e._v("this file"),a("OutboundLink")],1),e._v(".")])])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[29],{405:function(e,t,a){"use strict";a.r(t);var s=a(51),r=Object(s.a)({},(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[a("h1",{attrs:{id:"http-caching"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#http-caching"}},[e._v("#")]),e._v(" HTTP caching")]),e._v(" "),a("p",[a("em",[e._v("Since 4.1.0.")])]),e._v(" "),a("p",[e._v("HTTP caching allows to reduce the load on the SPARQL endpoint and to provide faster responses to clients.\nIt is particularly useful when many clients issue the same queries and data is not updated at a high frequency.")]),e._v(" "),a("p",[e._v("To enable HTTP caching, add the property "),a("code",[e._v("ontop.http.cacheControl")]),e._v(" in the properties file.\nThis will cause the insertion of a "),a("a",{attrs:{href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control",target:"_blank",rel:"noopener"}},[a("code",[e._v("Cache-Control")]),a("OutboundLink")],1),e._v(" HTTP header in successful responses, with the specified value.")]),e._v(" "),a("div",{staticClass:"custom-block tip"},[a("p",{staticClass:"custom-block-title"},[e._v("Example")]),e._v(" "),a("div",{staticClass:"language-properties extra-class"},[a("pre",{pre:!0,attrs:{class:"language-properties"}},[a("code",[a("span",{pre:!0,attrs:{class:"token attr-name"}},[e._v("ontop.http.cacheControl")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("=")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[e._v("max-age=60, stale-while-revalidate=20, stale-if-error=300")]),e._v("\n")])])]),a("p",[e._v("This entry informs the cache that values can be considered as fresh for 60 seconds. After this period, the cache remains allowed to serve cached results for 20 more seconds while revalidating the requests in the background, or for 300 more seconds in case of error with the upstream server.")])]),e._v(" "),a("p",[e._v("Ontop does not embed a HTTP cache. We recommend setting up a HTTP cache like "),a("a",{attrs:{href:"https://varnish-cache.org/",target:"_blank",rel:"noopener"}},[e._v("Varnish"),a("OutboundLink")],1),e._v(" or "),a("a",{attrs:{href:"http://nginx.org",target:"_blank",rel:"noopener"}},[e._v("Nginx"),a("OutboundLink")],1),e._v(" above the Ontop endpoint.")]),e._v(" "),a("h2",{attrs:{id:"remarks"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#remarks"}},[e._v("#")]),e._v(" Remarks")]),e._v(" "),a("ul",[a("li",[e._v("Most caches (e.g. Nginx but also Web browsers) do not cache POST requests by default. Since most SPARQL queries are sent with the POST method, it is important to turn this option on. This option is safe as Ontop is a read-only system.")]),e._v(" "),a("li",[e._v("Consider using the GET method for sending SPARQL queries so as to take advantage from Web browser caches.")]),e._v(" "),a("li",[e._v("For an example of configuration for Nginx, see "),a("a",{attrs:{href:"https://github.com/noi-techpark/it.bz.opendatahub.sparql/blob/eda53616c252691a73a8eb87963664cd06ca3e93/infrastructure/docker/nginx/default.conf",target:"_blank",rel:"noopener"}},[e._v("this file"),a("OutboundLink")],1),e._v(".")])])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/31.de926e6b.js b/assets/js/31.169c8911.js similarity index 99% rename from assets/js/31.de926e6b.js rename to assets/js/31.169c8911.js index bc379e554..fc72e2ffc 100644 --- a/assets/js/31.de926e6b.js +++ b/assets/js/31.169c8911.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[31],{408:function(t,e,s){"use strict";s.r(e);var a=s(51),r=Object(a.a)({},(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"query-logging"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#query-logging"}},[t._v("#")]),t._v(" Query logging")]),t._v(" "),s("p",[s("em",[t._v("Since 4.1.0.")])]),t._v(" "),s("p",[t._v("Query logging, disabled by default, prints one-line JSON objects into the standard output.")]),t._v(" "),s("p",[t._v("Its JSON format follows some ElasticSearch conventions and works nicely with the corresponding stack (FileBeat, ES, Kibana).")]),t._v(" "),s("h2",{attrs:{id:"example"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#example"}},[t._v("#")]),t._v(" Example")]),t._v(" "),s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"@timestamp"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2023-10-13T14:02:05.973Z"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"message"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"query:all"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"application"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ontop-odh"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"payload"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"queryId"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"36ade6c6-f091-4af2-9828-ee6316e191f4"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"classesUsedInQuery"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://schema.org/Hotel"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"propertiesUsedInQuery"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://schema.org/name"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"tables"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"\\"v_accommodationsopen\\""')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reformulationDuration"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("50")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reformulationCacheHit"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"user"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"joe"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"groups"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"admins,users"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roles"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"my_app_write,my_app_reader"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"httpHeaders"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"referer"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://localhost:8080/"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"extractedQueryTemplate"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"de167012e1ce3cf9dce66a986a3343d883a1f319f800132565b614498d9c73d8"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"parameters"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"v0"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"\\"Residence Tuberis\\""')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"sparqlQuery"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"PREFIX schema: \\nSELECT * WHERE {\\n ?h a schema:Hotel ; schema:name ?name .\\n FILTER (langMatches(lang(?name), \'en\'))\\n FILTER(str(?name) = \\"Residence Tuberis\\")\\n} \\nLIMIT 10"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reformulatedQuery"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ans1(h,name)\\nCONSTRUCT [h, name] [name/\\"Residence Tuberis\\"^^@en, h/RDF(http://noi.example.org/data/accommodation/{}(VARCHARToTEXT(Id1m148)),IRI)]\\n NATIVE [Id1m148]\\nSELECT v1.\\"Id\\" AS \\"Id1m148\\"\\nFROM \\"v_accommodationsopen\\" v1\\nWHERE (\'Residence Tuberis\' = v1.\\"AccoDetail-en-Name\\" AND \'HotelPension\' = v1.\\"AccoTypeId\\")\\nLIMIT 10\\n"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"executionBeforeUnblockingDuration"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"executionAndFetchingDuration"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("30")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"totalDuration"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("80")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"resultCount"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h2",{attrs:{id:"entries"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#entries"}},[t._v("#")]),t._v(" Entries")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("Key")]),t._v(" "),s("th",[t._v("Type")]),t._v(" "),s("th",[t._v("Description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[s("code",[t._v("@timestamp")])]),t._v(" "),s("td",[t._v("Timestamp")]),t._v(" "),s("td")]),t._v(" "),s("tr",[s("td",[s("code",[t._v("message")])]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Type of the message. It always start with the prefix "),s("code",[t._v("query:")]),t._v(". Its default value is "),s("code",[t._v("query:all")]),t._v(". In case of an exception, the value starts with "),s("code",[t._v("query:exception-")]),t._v(".")])]),t._v(" "),s("tr",[s("td",[s("code",[t._v("application")])]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Controlled by the property "),s("code",[t._v("ontop.applicationName")]),t._v(".")])]),t._v(" "),s("tr",[s("td",[s("code",[t._v("payload")])]),t._v(" "),s("td",[t._v("JSON object")]),t._v(" "),s("td",[t._v("Gathers the entries below.")])]),t._v(" "),s("tr",[s("td",[s("code",[t._v("queryId")])]),t._v(" "),s("td",[t._v("UUID")]),t._v(" "),s("td",[t._v("Unique to each query.")])]),t._v(" "),s("tr",[s("td",[s("code",[t._v("classesUsedInQuery")])]),t._v(" "),s("td",[t._v("Array of IRIs")]),t._v(" "),s("td",[t._v("IRIs of the classes appearing in the SPARQL query.")])]),t._v(" "),s("tr",[s("td",[s("code",[t._v("propertiesUsedInQuery")])]),t._v(" "),s("td",[t._v("Array of IRIs")]),t._v(" "),s("td",[t._v("IRIs of the properties appearing in the SPARQL query.")])]),t._v(" "),s("tr",[s("td",[s("code",[t._v("tables")])]),t._v(" "),s("td",[t._v("Array of Strings")]),t._v(" "),s("td",[t._v("Names of the relations appearing in the SQL query.")])]),t._v(" "),s("tr",[s("td",[s("code",[t._v("reformulationDuration")])]),t._v(" "),s("td",[t._v("Integer")]),t._v(" "),s("td",[t._v("Query reformulation duration (in ms).")])]),t._v(" "),s("tr",[s("td",[s("code",[t._v("reformulationCacheHit")])]),t._v(" "),s("td",[t._v("Boolean")]),t._v(" "),s("td",[t._v("True if the reformulated query cache has been used")])]),t._v(" "),s("tr",[s("td",[s("code",[t._v("user")])]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Since 5.2.0. User ID. Disabled by default")])]),t._v(" "),s("tr",[s("td",[s("code",[t._v("groups")])]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Since 5.2.0. User groups separated by commas. Disabled by default")])]),t._v(" "),s("tr",[s("td",[s("code",[t._v("roles")])]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Since 5.2.0. User roles separated by commas. Disabled by default")])]),t._v(" "),s("tr",[s("td",[s("code",[t._v("httpHeaders")])]),t._v(" "),s("td",[t._v("JSON object")]),t._v(" "),s("td",[t._v("Values of a specific list of HTTP headers. By default, this list is empty. To track for instance the referer, set the property "),s("code",[t._v("ontop.queryLogging.includeHttpHeader.referer")]),t._v(" to true.")])]),t._v(" "),s("tr",[s("td",[s("code",[t._v("extractedQueryTemplate.")]),t._v(" "),s("code",[t._v("hash")])]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Hash of the query template extracted, after removing extracted constants. Can be shared by similar queries.")])]),t._v(" "),s("tr",[s("td",[s("code",[t._v("extractedQueryTemplate.")]),t._v(" "),s("code",[t._v("parameters")])]),t._v(" "),s("td",[t._v("JSON object")]),t._v(" "),s("td",[t._v("Constants extracted and replaced by variables.")])]),t._v(" "),s("tr",[s("td",[s("code",[t._v("sparqlQuery")])]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("SPARQL query.")])]),t._v(" "),s("tr",[s("td",[s("code",[t._v("reformulatedQuery")])]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Includes the SQL query and the post-processing.")])]),t._v(" "),s("tr",[s("td",[s("code",[t._v("executionBefore")]),t._v(" "),s("code",[t._v("UnblockingDuration")])]),t._v(" "),s("td",[t._v("Integer")]),t._v(" "),s("td",[t._v("Duration between the moments where the SQL query is sent and the result set is unblocked (in ms).")])]),t._v(" "),s("tr",[s("td",[s("code",[t._v("executionAndFetching")]),t._v(" "),s("code",[t._v("Duration")])]),t._v(" "),s("td",[t._v("Integer")]),t._v(" "),s("td",[t._v("Duration between the moments where the SQL query is sent and the last result is fetched (in ms).")])]),t._v(" "),s("tr",[s("td",[s("code",[t._v("totalDuration")])]),t._v(" "),s("td",[t._v("Integer")]),t._v(" "),s("td",[t._v("Total duration (in ms).")])]),t._v(" "),s("tr",[s("td",[s("code",[t._v("resultCount")])]),t._v(" "),s("td",[t._v("Integer")]),t._v(" "),s("td",[t._v("Number of results returned.")])])])]),t._v(" "),s("h2",{attrs:{id:"default-settings"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#default-settings"}},[t._v("#")]),t._v(" Default settings")]),t._v(" "),s("div",{staticClass:"language-properties extra-class"},[s("pre",{pre:!0,attrs:{class:"language-properties"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Query logging is disabled by default")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("ontop.queryLogging")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[t._v("false")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Application name (needed for logging)")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("ontop.applicationName")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[t._v("Ontop")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Includes the SPARQL query string into the query log")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("ontop.queryLogging.includeSparqlQuery")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[t._v("true")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Includes the reformulated query into the query log")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("ontop.queryLogging.includeReformulatedQuery")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[t._v("false")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Includes classes and properties into the query log")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("ontop.queryLogging.includeClassesAndProperties")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[t._v("true")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Includes DB tables/views into the query log")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("ontop.queryLogging.includeTables")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[t._v("true")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Includes the user ID, his/her groups and roles")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("ontop.queryLogging.includeUserInfo")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[t._v("false")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Provides separated message at different phases (after reformulation, result set unblocked, last result fetched)")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("ontop.queryLogging.decomposition")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[t._v("false")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Sets that merged messages are only inserted when decomposition is disabled")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("ontop.queryLogging.decompositionAndMergingMutuallyExclusive")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[t._v("true")]),t._v("\n")])])])])}),[],!1,null,null,null);e.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[31],{412:function(t,e,s){"use strict";s.r(e);var a=s(51),r=Object(a.a)({},(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"query-logging"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#query-logging"}},[t._v("#")]),t._v(" Query logging")]),t._v(" "),s("p",[s("em",[t._v("Since 4.1.0.")])]),t._v(" "),s("p",[t._v("Query logging, disabled by default, prints one-line JSON objects into the standard output.")]),t._v(" "),s("p",[t._v("Its JSON format follows some ElasticSearch conventions and works nicely with the corresponding stack (FileBeat, ES, Kibana).")]),t._v(" "),s("h2",{attrs:{id:"example"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#example"}},[t._v("#")]),t._v(" Example")]),t._v(" "),s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"@timestamp"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2023-10-13T14:02:05.973Z"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"message"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"query:all"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"application"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ontop-odh"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"payload"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"queryId"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"36ade6c6-f091-4af2-9828-ee6316e191f4"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"classesUsedInQuery"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://schema.org/Hotel"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"propertiesUsedInQuery"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://schema.org/name"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"tables"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"\\"v_accommodationsopen\\""')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reformulationDuration"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("50")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reformulationCacheHit"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"user"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"joe"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"groups"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"admins,users"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roles"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"my_app_write,my_app_reader"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"httpHeaders"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"referer"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://localhost:8080/"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"extractedQueryTemplate"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"de167012e1ce3cf9dce66a986a3343d883a1f319f800132565b614498d9c73d8"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"parameters"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"v0"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"\\"Residence Tuberis\\""')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"sparqlQuery"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"PREFIX schema: \\nSELECT * WHERE {\\n ?h a schema:Hotel ; schema:name ?name .\\n FILTER (langMatches(lang(?name), \'en\'))\\n FILTER(str(?name) = \\"Residence Tuberis\\")\\n} \\nLIMIT 10"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reformulatedQuery"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ans1(h,name)\\nCONSTRUCT [h, name] [name/\\"Residence Tuberis\\"^^@en, h/RDF(http://noi.example.org/data/accommodation/{}(VARCHARToTEXT(Id1m148)),IRI)]\\n NATIVE [Id1m148]\\nSELECT v1.\\"Id\\" AS \\"Id1m148\\"\\nFROM \\"v_accommodationsopen\\" v1\\nWHERE (\'Residence Tuberis\' = v1.\\"AccoDetail-en-Name\\" AND \'HotelPension\' = v1.\\"AccoTypeId\\")\\nLIMIT 10\\n"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"executionBeforeUnblockingDuration"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"executionAndFetchingDuration"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("30")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"totalDuration"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("80")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"resultCount"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h2",{attrs:{id:"entries"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#entries"}},[t._v("#")]),t._v(" Entries")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("Key")]),t._v(" "),s("th",[t._v("Type")]),t._v(" "),s("th",[t._v("Description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[s("code",[t._v("@timestamp")])]),t._v(" "),s("td",[t._v("Timestamp")]),t._v(" "),s("td")]),t._v(" "),s("tr",[s("td",[s("code",[t._v("message")])]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Type of the message. It always start with the prefix "),s("code",[t._v("query:")]),t._v(". Its default value is "),s("code",[t._v("query:all")]),t._v(". In case of an exception, the value starts with "),s("code",[t._v("query:exception-")]),t._v(".")])]),t._v(" "),s("tr",[s("td",[s("code",[t._v("application")])]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Controlled by the property "),s("code",[t._v("ontop.applicationName")]),t._v(".")])]),t._v(" "),s("tr",[s("td",[s("code",[t._v("payload")])]),t._v(" "),s("td",[t._v("JSON object")]),t._v(" "),s("td",[t._v("Gathers the entries below.")])]),t._v(" "),s("tr",[s("td",[s("code",[t._v("queryId")])]),t._v(" "),s("td",[t._v("UUID")]),t._v(" "),s("td",[t._v("Unique to each query.")])]),t._v(" "),s("tr",[s("td",[s("code",[t._v("classesUsedInQuery")])]),t._v(" "),s("td",[t._v("Array of IRIs")]),t._v(" "),s("td",[t._v("IRIs of the classes appearing in the SPARQL query.")])]),t._v(" "),s("tr",[s("td",[s("code",[t._v("propertiesUsedInQuery")])]),t._v(" "),s("td",[t._v("Array of IRIs")]),t._v(" "),s("td",[t._v("IRIs of the properties appearing in the SPARQL query.")])]),t._v(" "),s("tr",[s("td",[s("code",[t._v("tables")])]),t._v(" "),s("td",[t._v("Array of Strings")]),t._v(" "),s("td",[t._v("Names of the relations appearing in the SQL query.")])]),t._v(" "),s("tr",[s("td",[s("code",[t._v("reformulationDuration")])]),t._v(" "),s("td",[t._v("Integer")]),t._v(" "),s("td",[t._v("Query reformulation duration (in ms).")])]),t._v(" "),s("tr",[s("td",[s("code",[t._v("reformulationCacheHit")])]),t._v(" "),s("td",[t._v("Boolean")]),t._v(" "),s("td",[t._v("True if the reformulated query cache has been used")])]),t._v(" "),s("tr",[s("td",[s("code",[t._v("user")])]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Since 5.2.0. User ID. Disabled by default")])]),t._v(" "),s("tr",[s("td",[s("code",[t._v("groups")])]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Since 5.2.0. User groups separated by commas. Disabled by default")])]),t._v(" "),s("tr",[s("td",[s("code",[t._v("roles")])]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Since 5.2.0. User roles separated by commas. Disabled by default")])]),t._v(" "),s("tr",[s("td",[s("code",[t._v("httpHeaders")])]),t._v(" "),s("td",[t._v("JSON object")]),t._v(" "),s("td",[t._v("Values of a specific list of HTTP headers. By default, this list is empty. To track for instance the referer, set the property "),s("code",[t._v("ontop.queryLogging.includeHttpHeader.referer")]),t._v(" to true.")])]),t._v(" "),s("tr",[s("td",[s("code",[t._v("extractedQueryTemplate.")]),t._v(" "),s("code",[t._v("hash")])]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Hash of the query template extracted, after removing extracted constants. Can be shared by similar queries.")])]),t._v(" "),s("tr",[s("td",[s("code",[t._v("extractedQueryTemplate.")]),t._v(" "),s("code",[t._v("parameters")])]),t._v(" "),s("td",[t._v("JSON object")]),t._v(" "),s("td",[t._v("Constants extracted and replaced by variables.")])]),t._v(" "),s("tr",[s("td",[s("code",[t._v("sparqlQuery")])]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("SPARQL query.")])]),t._v(" "),s("tr",[s("td",[s("code",[t._v("reformulatedQuery")])]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Includes the SQL query and the post-processing.")])]),t._v(" "),s("tr",[s("td",[s("code",[t._v("executionBefore")]),t._v(" "),s("code",[t._v("UnblockingDuration")])]),t._v(" "),s("td",[t._v("Integer")]),t._v(" "),s("td",[t._v("Duration between the moments where the SQL query is sent and the result set is unblocked (in ms).")])]),t._v(" "),s("tr",[s("td",[s("code",[t._v("executionAndFetching")]),t._v(" "),s("code",[t._v("Duration")])]),t._v(" "),s("td",[t._v("Integer")]),t._v(" "),s("td",[t._v("Duration between the moments where the SQL query is sent and the last result is fetched (in ms).")])]),t._v(" "),s("tr",[s("td",[s("code",[t._v("totalDuration")])]),t._v(" "),s("td",[t._v("Integer")]),t._v(" "),s("td",[t._v("Total duration (in ms).")])]),t._v(" "),s("tr",[s("td",[s("code",[t._v("resultCount")])]),t._v(" "),s("td",[t._v("Integer")]),t._v(" "),s("td",[t._v("Number of results returned.")])])])]),t._v(" "),s("h2",{attrs:{id:"default-settings"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#default-settings"}},[t._v("#")]),t._v(" Default settings")]),t._v(" "),s("div",{staticClass:"language-properties extra-class"},[s("pre",{pre:!0,attrs:{class:"language-properties"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Query logging is disabled by default")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("ontop.queryLogging")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[t._v("false")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Application name (needed for logging)")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("ontop.applicationName")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[t._v("Ontop")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Includes the SPARQL query string into the query log")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("ontop.queryLogging.includeSparqlQuery")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[t._v("true")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Includes the reformulated query into the query log")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("ontop.queryLogging.includeReformulatedQuery")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[t._v("false")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Includes classes and properties into the query log")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("ontop.queryLogging.includeClassesAndProperties")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[t._v("true")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Includes DB tables/views into the query log")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("ontop.queryLogging.includeTables")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[t._v("true")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Includes the user ID, his/her groups and roles")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("ontop.queryLogging.includeUserInfo")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[t._v("false")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Provides separated message at different phases (after reformulation, result set unblocked, last result fetched)")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("ontop.queryLogging.decomposition")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[t._v("false")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Sets that merged messages are only inserted when decomposition is disabled")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("ontop.queryLogging.decompositionAndMergingMutuallyExclusive")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[t._v("true")]),t._v("\n")])])])])}),[],!1,null,null,null);e.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/33.ebb322a6.js b/assets/js/33.ec5caa0f.js similarity index 89% rename from assets/js/33.ebb322a6.js rename to assets/js/33.ec5caa0f.js index 525991f4e..5960dc5eb 100644 --- a/assets/js/33.ebb322a6.js +++ b/assets/js/33.ec5caa0f.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[33],{413:function(t,e,s){"use strict";s.r(e);var n=s(51),a=Object(n.a)({},(function(){var t=this.$createElement,e=this._self._c||t;return e("ContentSlotsDistributor",{attrs:{"slot-key":this.$parent.slotKey}},[e("h1",{attrs:{id:"ontop-views"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#ontop-views"}},[this._v("#")]),this._v(" Ontop views")]),this._v(" "),e("p",[this._v("Ontop views have been renamed lenses. See "),e("a",{attrs:{href:"/guide/advanced/lenses"}},[this._v("the new page")]),this._v(".")])])}),[],!1,null,null,null);e.default=a.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[33],{408:function(t,e,s){"use strict";s.r(e);var n=s(51),a=Object(n.a)({},(function(){var t=this.$createElement,e=this._self._c||t;return e("ContentSlotsDistributor",{attrs:{"slot-key":this.$parent.slotKey}},[e("h1",{attrs:{id:"ontop-views"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#ontop-views"}},[this._v("#")]),this._v(" Ontop views")]),this._v(" "),e("p",[this._v("Ontop views have been renamed lenses. See "),e("a",{attrs:{href:"/guide/advanced/lenses"}},[this._v("the new page")]),this._v(".")])])}),[],!1,null,null,null);e.default=a.exports}}]); \ No newline at end of file diff --git a/assets/js/36.69b1ebb1.js b/assets/js/36.c44deccc.js similarity index 98% rename from assets/js/36.69b1ebb1.js rename to assets/js/36.c44deccc.js index aaa141a51..dcf32d325 100644 --- a/assets/js/36.69b1ebb1.js +++ b/assets/js/36.c44deccc.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[36],{412:function(t,e,a){"use strict";a.r(e);var r=a(51),n=Object(r.a)({},(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"key-concepts"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#key-concepts"}},[t._v("#")]),t._v(" Key concepts")]),t._v(" "),a("h2",{attrs:{id:"virtual-knowledge-graph-vkg"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#virtual-knowledge-graph-vkg"}},[t._v("#")]),t._v(" Virtual Knowledge Graph (VKG)")]),t._v(" "),a("p",[t._v("A Knowledge Graph (KG) is, in our terminology, a graph using the RDF data model.")]),t._v(" "),a("p",[t._v("A Virtual KG (VKG) is a virtual representation in RDF of non-RDF data, which is generally relational data.\nWith a VKG, the data remains in the data sources in its original format but can be virtually represented as an RDF graph.")]),t._v(" "),a("h2",{attrs:{id:"rdf"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#rdf"}},[t._v("#")]),t._v(" RDF")]),t._v(" "),a("p",[t._v("The "),a("a",{attrs:{href:"https://www.w3.org/TR/rdf11-concepts/",target:"_blank",rel:"noopener"}},[t._v("Resource Description Framework (RDF)"),a("OutboundLink")],1),t._v("\nis one of the two main data models for graphs (together with "),a("a",{attrs:{href:"http://graphdatamodeling.com/Graph%20Data%20Modeling/GraphDataModeling/page/PropertyGraphs.html",target:"_blank",rel:"noopener"}},[t._v("property graphs"),a("OutboundLink")],1),t._v(").\nRDF mainly targets "),a("strong",[t._v("data integration")]),t._v(" applications while property graphs are used for building graph databases.")]),t._v(" "),a("p",[t._v("In RDF, data is modelled using classes and properties.")]),t._v(" "),a("p",[t._v("Starting from 3.0, Ontop supports "),a("a",{attrs:{href:"https://www.w3.org/TR/rdf11-concepts/",target:"_blank",rel:"noopener"}},[t._v("RDF 1.1"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("h2",{attrs:{id:"sparql-query"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#sparql-query"}},[t._v("#")]),t._v(" SPARQL query")]),t._v(" "),a("p",[a("a",{attrs:{href:"https://www.w3.org/TR/sparql11-query/",target:"_blank",rel:"noopener"}},[t._v("SPARQL"),a("OutboundLink")],1),t._v(" is the standard query language for RDF graphs.")]),t._v(" "),a("p",[t._v("Ontop is capable of answering SPARQL queries expressed over the VKG.\nOntop translates these SPARQL queries into SQL queries, which are then executed over the relational data sources.")]),t._v(" "),a("p",[t._v("Ontop supports a large fragment of "),a("a",{attrs:{href:"https://www.w3.org/TR/sparql11-query/",target:"_blank",rel:"noopener"}},[t._v("SPARQL 1.1"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("h2",{attrs:{id:"mappings"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#mappings"}},[t._v("#")]),t._v(" Mappings")]),t._v(" "),a("p",[t._v("Mappings specify the correspondence between the data models of the relational data sources and the RDF graph.\nOntop supports the "),a("a",{attrs:{href:"https://www.w3.org/TR/r2rml/",target:"_blank",rel:"noopener"}},[t._v("R2RML standard mapping language"),a("OutboundLink")],1),t._v(" and the Ontop mapping language, which is fully interoperable with R2RML.")]),t._v(" "),a("h2",{attrs:{id:"ontology"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#ontology"}},[t._v("#")]),t._v(" Ontology")]),t._v(" "),a("p",[t._v("An ontology specifies the formal relations between the classes and properties used by the RDF graph. It is mainly used for enriching the RDF graph by, for instance, taking account of class hierarchies.")]),t._v(" "),a("p",[t._v("Ontop supports lightweight ontologies expressed in "),a("a",{attrs:{href:"https://www.w3.org/TR/rdf-schema/",target:"_blank",rel:"noopener"}},[t._v("RDFS"),a("OutboundLink")],1),t._v(" or in the slightly more expressive "),a("a",{attrs:{href:"https://www.w3.org/TR/owl2-profiles/#OWL_2_QL",target:"_blank",rel:"noopener"}},[t._v("OWL 2 QL"),a("OutboundLink")],1),t._v(" fragment of OWL.")]),t._v(" "),a("h2",{attrs:{id:"vkg-specification"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#vkg-specification"}},[t._v("#")]),t._v(" VKG specification")]),t._v(" "),a("p",[t._v("VKG specifications are composed of mappings and optionally of ontologies.")]),t._v(" "),a("h2",{attrs:{id:"sparql-endpoint"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#sparql-endpoint"}},[t._v("#")]),t._v(" SPARQL endpoint")]),t._v(" "),a("p",[t._v("A "),a("a",{attrs:{href:"https://www.w3.org/TR/2013/REC-sparql11-protocol-20130321/",target:"_blank",rel:"noopener"}},[t._v("SPARQL endpoint"),a("OutboundLink")],1),t._v(" is a standardized HTTP-based Web API.\nIt makes the RDF graph queryable by any HTTP client.")]),t._v(" "),a("p",[t._v("Ontop enables VKG specifications to be deployed as SPARQL endpoints.")])])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[36],{413:function(t,e,a){"use strict";a.r(e);var r=a(51),n=Object(r.a)({},(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"key-concepts"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#key-concepts"}},[t._v("#")]),t._v(" Key concepts")]),t._v(" "),a("h2",{attrs:{id:"virtual-knowledge-graph-vkg"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#virtual-knowledge-graph-vkg"}},[t._v("#")]),t._v(" Virtual Knowledge Graph (VKG)")]),t._v(" "),a("p",[t._v("A Knowledge Graph (KG) is, in our terminology, a graph using the RDF data model.")]),t._v(" "),a("p",[t._v("A Virtual KG (VKG) is a virtual representation in RDF of non-RDF data, which is generally relational data.\nWith a VKG, the data remains in the data sources in its original format but can be virtually represented as an RDF graph.")]),t._v(" "),a("h2",{attrs:{id:"rdf"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#rdf"}},[t._v("#")]),t._v(" RDF")]),t._v(" "),a("p",[t._v("The "),a("a",{attrs:{href:"https://www.w3.org/TR/rdf11-concepts/",target:"_blank",rel:"noopener"}},[t._v("Resource Description Framework (RDF)"),a("OutboundLink")],1),t._v("\nis one of the two main data models for graphs (together with "),a("a",{attrs:{href:"http://graphdatamodeling.com/Graph%20Data%20Modeling/GraphDataModeling/page/PropertyGraphs.html",target:"_blank",rel:"noopener"}},[t._v("property graphs"),a("OutboundLink")],1),t._v(").\nRDF mainly targets "),a("strong",[t._v("data integration")]),t._v(" applications while property graphs are used for building graph databases.")]),t._v(" "),a("p",[t._v("In RDF, data is modelled using classes and properties.")]),t._v(" "),a("p",[t._v("Starting from 3.0, Ontop supports "),a("a",{attrs:{href:"https://www.w3.org/TR/rdf11-concepts/",target:"_blank",rel:"noopener"}},[t._v("RDF 1.1"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("h2",{attrs:{id:"sparql-query"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#sparql-query"}},[t._v("#")]),t._v(" SPARQL query")]),t._v(" "),a("p",[a("a",{attrs:{href:"https://www.w3.org/TR/sparql11-query/",target:"_blank",rel:"noopener"}},[t._v("SPARQL"),a("OutboundLink")],1),t._v(" is the standard query language for RDF graphs.")]),t._v(" "),a("p",[t._v("Ontop is capable of answering SPARQL queries expressed over the VKG.\nOntop translates these SPARQL queries into SQL queries, which are then executed over the relational data sources.")]),t._v(" "),a("p",[t._v("Ontop supports a large fragment of "),a("a",{attrs:{href:"https://www.w3.org/TR/sparql11-query/",target:"_blank",rel:"noopener"}},[t._v("SPARQL 1.1"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("h2",{attrs:{id:"mappings"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#mappings"}},[t._v("#")]),t._v(" Mappings")]),t._v(" "),a("p",[t._v("Mappings specify the correspondence between the data models of the relational data sources and the RDF graph.\nOntop supports the "),a("a",{attrs:{href:"https://www.w3.org/TR/r2rml/",target:"_blank",rel:"noopener"}},[t._v("R2RML standard mapping language"),a("OutboundLink")],1),t._v(" and the Ontop mapping language, which is fully interoperable with R2RML.")]),t._v(" "),a("h2",{attrs:{id:"ontology"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#ontology"}},[t._v("#")]),t._v(" Ontology")]),t._v(" "),a("p",[t._v("An ontology specifies the formal relations between the classes and properties used by the RDF graph. It is mainly used for enriching the RDF graph by, for instance, taking account of class hierarchies.")]),t._v(" "),a("p",[t._v("Ontop supports lightweight ontologies expressed in "),a("a",{attrs:{href:"https://www.w3.org/TR/rdf-schema/",target:"_blank",rel:"noopener"}},[t._v("RDFS"),a("OutboundLink")],1),t._v(" or in the slightly more expressive "),a("a",{attrs:{href:"https://www.w3.org/TR/owl2-profiles/#OWL_2_QL",target:"_blank",rel:"noopener"}},[t._v("OWL 2 QL"),a("OutboundLink")],1),t._v(" fragment of OWL.")]),t._v(" "),a("h2",{attrs:{id:"vkg-specification"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#vkg-specification"}},[t._v("#")]),t._v(" VKG specification")]),t._v(" "),a("p",[t._v("VKG specifications are composed of mappings and optionally of ontologies.")]),t._v(" "),a("h2",{attrs:{id:"sparql-endpoint"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#sparql-endpoint"}},[t._v("#")]),t._v(" SPARQL endpoint")]),t._v(" "),a("p",[t._v("A "),a("a",{attrs:{href:"https://www.w3.org/TR/2013/REC-sparql11-protocol-20130321/",target:"_blank",rel:"noopener"}},[t._v("SPARQL endpoint"),a("OutboundLink")],1),t._v(" is a standardized HTTP-based Web API.\nIt makes the RDF graph queryable by any HTTP client.")]),t._v(" "),a("p",[t._v("Ontop enables VKG specifications to be deployed as SPARQL endpoints.")])])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/39.aec49c79.js b/assets/js/39.7ddd7dbe.js similarity index 99% rename from assets/js/39.aec49c79.js rename to assets/js/39.7ddd7dbe.js index d666ea496..65535edbc 100644 --- a/assets/js/39.aec49c79.js +++ b/assets/js/39.7ddd7dbe.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[39],{417:function(t,a,s){"use strict";s.r(a);var e=s(51),r=Object(e.a)({},(function(){var t=this,a=t.$createElement,s=t._self._c||a;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"databricks"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#databricks"}},[t._v("#")]),t._v(" Databricks")]),t._v(" "),s("p",[s("em",[t._v("Supported since 5.0.0.")])]),t._v(" "),s("p",[t._v("Through the "),s("a",{attrs:{href:"https://spark.apache.org/",target:"_blank",rel:"noopener"}},[t._v("Databricks"),s("OutboundLink")],1),t._v(" SparkSQL connector, Ontop is able to construct VKGs on a Databricks cloud database. All main Ontop features are supported for Databricks.")]),t._v(" "),s("h2",{attrs:{id:"limitations-exceptions"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#limitations-exceptions"}},[t._v("#")]),t._v(" Limitations & Exceptions")]),t._v(" "),s("div",{staticClass:"custom-block warning"},[s("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),s("p",[t._v("Databricks does not provide information about integrity constraints. Make sure to provide this information in order to avoid very inefficient queries.\nWe recommend using "),s("a",{attrs:{href:"/guide/advanced/lenses"}},[t._v("lenses")]),t._v(" for this purpose.")])]),t._v(" "),s("ul",[s("li",[t._v('Accessing struct fields with the "dot operator" is not supported (see below).')])]),t._v(" "),s("h2",{attrs:{id:"database-connection"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#database-connection"}},[t._v("#")]),t._v(" Database Connection")]),t._v(" "),s("p",[t._v("The following shows the content of a sample "),s("code",[t._v(".properties")]),t._v(" file that can be used to connect Ontop to Databricks using each supported driver:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("com.databricks.client.jdbc.Driver")])])]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[t._v("jdbc.url "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" jdbc:databricks://dummyid.cloud.databricks.com:443"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("HttpPath")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("/sql/1.0/endpoints/endpointid"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\njdbc.user "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" token\njdbc.password "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" private-access-token \njdbc.driver"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("com.databricks.client.jdbc.Driver\n")])])]),s("ul",[s("li",[s("code",[t._v("com.simba.spark.jdbc.Driver")]),t._v(" (legacy driver)")])]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[t._v("jdbc.url "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" jdbc:spark://dummyid.cloud.databricks.com:443/default"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("transportMode")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("http"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("ssl")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("AuthMech")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("httpPath")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("/sql/1.0/endpoints/endpointid"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\njdbc.user "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" token\njdbc.password "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" private-access-token \njdbc.driver"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("com.simba.spark.jdbc.Driver\n")])])]),s("h2",{attrs:{id:"nested-type-support"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#nested-type-support"}},[t._v("#")]),t._v(" Nested Type Support")]),t._v(" "),s("p",[t._v("Ontop implements explicit compatibility with the SparkSQL array type "),s("code",[t._v("Array")]),t._v(". When used with the "),s("a",{attrs:{href:"/guide/advanced/lenses#flattenlens"}},[t._v("flatten lens")]),t._v(", it is able to automatically infer the type of the result column.")]),t._v(" "),s("p",[t._v("Furthermore, the flatten lens can also be used with the JSON-encoded string columns. For these columns, however, Ontop cannot infer the output type of the flattened column.")]),t._v(" "),s("h3",{attrs:{id:"struct-access"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#struct-access"}},[t._v("#")]),t._v(" Struct Access")]),t._v(" "),s("p",[t._v('In SparkSQL, individual struct objects can be accessed by SQL expressions using the "dot operator" on the struct column. In Ontop, this feature is not currently supported.')]),t._v(" "),s("p",[t._v("Should any of their elements still be required, then a workaround can be performed by first transforming the struct into a JSON object and then accessing it using JSON functions.")]),t._v(" "),s("p",[t._v("Example:")]),t._v(" "),s("p",[s("code",[t._v("my_struct.my_attribute")]),t._v(" "),s("mjx-container",{staticClass:"MathJax",attrs:{jax:"SVG"}},[s("svg",{staticStyle:{"vertical-align":"-0.025ex"},attrs:{xmlns:"http://www.w3.org/2000/svg",width:"2.262ex",height:"1.181ex",viewBox:"0 -511 1000 522"}},[s("g",{attrs:{stroke:"currentColor",fill:"currentColor","stroke-width":"0",transform:"matrix(1 0 0 -1 0 0)"}},[s("g",{attrs:{"data-mml-node":"math"}},[s("g",{attrs:{"data-mml-node":"mo"}},[s("path",{attrs:{"data-c":"2192",d:"M56 237T56 250T70 270H835Q719 357 692 493Q692 494 692 496T691 499Q691 511 708 511H711Q720 511 723 510T729 506T732 497T735 481T743 456Q765 389 816 336T935 261Q944 258 944 250Q944 244 939 241T915 231T877 212Q836 186 806 152T761 85T740 35T732 4Q730 -6 727 -8T711 -11Q691 -11 691 0Q691 7 696 25Q728 151 835 230H70Q56 237 56 250Z"}})])])])])]),t._v(" "),s("code",[t._v("GET_JSON_OBJECT(TO_JSON(my_struct), '$.my_attribute')")])],1)])}),[],!1,null,null,null);a.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[39],{416:function(t,a,s){"use strict";s.r(a);var e=s(51),r=Object(e.a)({},(function(){var t=this,a=t.$createElement,s=t._self._c||a;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"databricks"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#databricks"}},[t._v("#")]),t._v(" Databricks")]),t._v(" "),s("p",[s("em",[t._v("Supported since 5.0.0.")])]),t._v(" "),s("p",[t._v("Through the "),s("a",{attrs:{href:"https://spark.apache.org/",target:"_blank",rel:"noopener"}},[t._v("Databricks"),s("OutboundLink")],1),t._v(" SparkSQL connector, Ontop is able to construct VKGs on a Databricks cloud database. All main Ontop features are supported for Databricks.")]),t._v(" "),s("h2",{attrs:{id:"limitations-exceptions"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#limitations-exceptions"}},[t._v("#")]),t._v(" Limitations & Exceptions")]),t._v(" "),s("div",{staticClass:"custom-block warning"},[s("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),s("p",[t._v("Databricks does not provide information about integrity constraints. Make sure to provide this information in order to avoid very inefficient queries.\nWe recommend using "),s("a",{attrs:{href:"/guide/advanced/lenses"}},[t._v("lenses")]),t._v(" for this purpose.")])]),t._v(" "),s("ul",[s("li",[t._v('Accessing struct fields with the "dot operator" is not supported (see below).')])]),t._v(" "),s("h2",{attrs:{id:"database-connection"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#database-connection"}},[t._v("#")]),t._v(" Database Connection")]),t._v(" "),s("p",[t._v("The following shows the content of a sample "),s("code",[t._v(".properties")]),t._v(" file that can be used to connect Ontop to Databricks using each supported driver:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("com.databricks.client.jdbc.Driver")])])]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[t._v("jdbc.url "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" jdbc:databricks://dummyid.cloud.databricks.com:443"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("HttpPath")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("/sql/1.0/endpoints/endpointid"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\njdbc.user "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" token\njdbc.password "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" private-access-token \njdbc.driver"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("com.databricks.client.jdbc.Driver\n")])])]),s("ul",[s("li",[s("code",[t._v("com.simba.spark.jdbc.Driver")]),t._v(" (legacy driver)")])]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[t._v("jdbc.url "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" jdbc:spark://dummyid.cloud.databricks.com:443/default"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("transportMode")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("http"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("ssl")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("AuthMech")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("httpPath")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("/sql/1.0/endpoints/endpointid"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\njdbc.user "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" token\njdbc.password "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" private-access-token \njdbc.driver"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("com.simba.spark.jdbc.Driver\n")])])]),s("h2",{attrs:{id:"nested-type-support"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#nested-type-support"}},[t._v("#")]),t._v(" Nested Type Support")]),t._v(" "),s("p",[t._v("Ontop implements explicit compatibility with the SparkSQL array type "),s("code",[t._v("Array")]),t._v(". When used with the "),s("a",{attrs:{href:"/guide/advanced/lenses#flattenlens"}},[t._v("flatten lens")]),t._v(", it is able to automatically infer the type of the result column.")]),t._v(" "),s("p",[t._v("Furthermore, the flatten lens can also be used with the JSON-encoded string columns. For these columns, however, Ontop cannot infer the output type of the flattened column.")]),t._v(" "),s("h3",{attrs:{id:"struct-access"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#struct-access"}},[t._v("#")]),t._v(" Struct Access")]),t._v(" "),s("p",[t._v('In SparkSQL, individual struct objects can be accessed by SQL expressions using the "dot operator" on the struct column. In Ontop, this feature is not currently supported.')]),t._v(" "),s("p",[t._v("Should any of their elements still be required, then a workaround can be performed by first transforming the struct into a JSON object and then accessing it using JSON functions.")]),t._v(" "),s("p",[t._v("Example:")]),t._v(" "),s("p",[s("code",[t._v("my_struct.my_attribute")]),t._v(" "),s("mjx-container",{staticClass:"MathJax",attrs:{jax:"SVG"}},[s("svg",{staticStyle:{"vertical-align":"-0.025ex"},attrs:{xmlns:"http://www.w3.org/2000/svg",width:"2.262ex",height:"1.181ex",viewBox:"0 -511 1000 522"}},[s("g",{attrs:{stroke:"currentColor",fill:"currentColor","stroke-width":"0",transform:"matrix(1 0 0 -1 0 0)"}},[s("g",{attrs:{"data-mml-node":"math"}},[s("g",{attrs:{"data-mml-node":"mo"}},[s("path",{attrs:{"data-c":"2192",d:"M56 237T56 250T70 270H835Q719 357 692 493Q692 494 692 496T691 499Q691 511 708 511H711Q720 511 723 510T729 506T732 497T735 481T743 456Q765 389 816 336T935 261Q944 258 944 250Q944 244 939 241T915 231T877 212Q836 186 806 152T761 85T740 35T732 4Q730 -6 727 -8T711 -11Q691 -11 691 0Q691 7 696 25Q728 151 835 230H70Q56 237 56 250Z"}})])])])])]),t._v(" "),s("code",[t._v("GET_JSON_OBJECT(TO_JSON(my_struct), '$.my_attribute')")])],1)])}),[],!1,null,null,null);a.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/40.f2a17819.js b/assets/js/40.95a2c8af.js similarity index 97% rename from assets/js/40.f2a17819.js rename to assets/js/40.95a2c8af.js index 0d3618713..95321f456 100644 --- a/assets/js/40.f2a17819.js +++ b/assets/js/40.95a2c8af.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[40],{416:function(t,e,a){"use strict";a.r(e);var s=a(51),n=Object(s.a)({},(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"db2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#db2"}},[t._v("#")]),t._v(" DB2")]),t._v(" "),a("p",[t._v("Through the IBM "),a("a",{attrs:{href:"https://www.ibm.com/products/db2",target:"_blank",rel:"noopener"}},[t._v("DB2"),a("OutboundLink")],1),t._v(" connector, Ontop is able to construct VKGs on DB2 databases.")]),t._v(" "),a("h2",{attrs:{id:"limitations-exceptions"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#limitations-exceptions"}},[t._v("#")]),t._v(" Limitations & Exceptions")]),t._v(" "),a("ul",[a("li",[t._v("SPARQL "),a("em",[t._v("UUID")]),t._v(" and "),a("em",[t._v("hash")]),t._v(" functions are not supported for DB2.")]),t._v(" "),a("li",[t._v("Nested data types and the "),a("a",{attrs:{href:"/guide/advanced/lenses#flattenlens"}},[t._v("flatten lens")]),t._v(" are not supported for DB2")])]),t._v(" "),a("h2",{attrs:{id:"database-connection"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#database-connection"}},[t._v("#")]),t._v(" Database Connection")]),t._v(" "),a("p",[t._v("The following shows the content of a sample "),a("code",[t._v(".properties")]),t._v(" file that can be used to connect Ontop to DB2:")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[t._v("jdbc.url "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" jdbc:db2://localhost:50000/defaultdatabase\njdbc.user "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" user\njdbc.password "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" password\njdbc.driver "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" com.ibm.db2.jcc.DB2Driver\n")])])]),a("h2",{attrs:{id:"nested-type-support"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#nested-type-support"}},[t._v("#")]),t._v(" Nested Type Support")]),t._v(" "),a("p",[t._v("Nested data types and the "),a("a",{attrs:{href:"/guide/advanced/lenses#flattenlens"}},[t._v("flatten lens")]),t._v(" are not supported for DB2.")])])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[40],{417:function(t,e,a){"use strict";a.r(e);var s=a(51),n=Object(s.a)({},(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"db2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#db2"}},[t._v("#")]),t._v(" DB2")]),t._v(" "),a("p",[t._v("Through the IBM "),a("a",{attrs:{href:"https://www.ibm.com/products/db2",target:"_blank",rel:"noopener"}},[t._v("DB2"),a("OutboundLink")],1),t._v(" connector, Ontop is able to construct VKGs on DB2 databases.")]),t._v(" "),a("h2",{attrs:{id:"limitations-exceptions"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#limitations-exceptions"}},[t._v("#")]),t._v(" Limitations & Exceptions")]),t._v(" "),a("ul",[a("li",[t._v("SPARQL "),a("em",[t._v("UUID")]),t._v(" and "),a("em",[t._v("hash")]),t._v(" functions are not supported for DB2.")]),t._v(" "),a("li",[t._v("Nested data types and the "),a("a",{attrs:{href:"/guide/advanced/lenses#flattenlens"}},[t._v("flatten lens")]),t._v(" are not supported for DB2")])]),t._v(" "),a("h2",{attrs:{id:"database-connection"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#database-connection"}},[t._v("#")]),t._v(" Database Connection")]),t._v(" "),a("p",[t._v("The following shows the content of a sample "),a("code",[t._v(".properties")]),t._v(" file that can be used to connect Ontop to DB2:")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[t._v("jdbc.url "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" jdbc:db2://localhost:50000/defaultdatabase\njdbc.user "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" user\njdbc.password "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" password\njdbc.driver "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" com.ibm.db2.jcc.DB2Driver\n")])])]),a("h2",{attrs:{id:"nested-type-support"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#nested-type-support"}},[t._v("#")]),t._v(" Nested Type Support")]),t._v(" "),a("p",[t._v("Nested data types and the "),a("a",{attrs:{href:"/guide/advanced/lenses#flattenlens"}},[t._v("flatten lens")]),t._v(" are not supported for DB2.")])])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/41.c6d6e782.js b/assets/js/41.8783e3b4.js similarity index 97% rename from assets/js/41.c6d6e782.js rename to assets/js/41.8783e3b4.js index 47508a055..59ff95982 100644 --- a/assets/js/41.c6d6e782.js +++ b/assets/js/41.8783e3b4.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[41],{419:function(t,e,a){"use strict";a.r(e);var s=a(51),o=Object(s.a)({},(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"denodo"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#denodo"}},[t._v("#")]),t._v(" Denodo")]),t._v(" "),a("p",[t._v("Through the "),a("a",{attrs:{href:"https://www.denodo.com/en",target:"_blank",rel:"noopener"}},[t._v("Denodo"),a("OutboundLink")],1),t._v(" connector, Ontop is able to construct VKGs on Denodo databases.")]),t._v(" "),a("h2",{attrs:{id:"limitations-exceptions"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#limitations-exceptions"}},[t._v("#")]),t._v(" Limitations & Exceptions")]),t._v(" "),a("ul",[a("li",[t._v("SPARQL "),a("em",[t._v("UUID")]),t._v(" and "),a("em",[t._v("hash")]),t._v(" functions are not supported for Denodo.")]),t._v(" "),a("li",[t._v("Nested data types and the "),a("a",{attrs:{href:"/guide/advanced/lenses#flattenlens"}},[t._v("flatten lens")]),t._v(" are not supported for Denodo.")])]),t._v(" "),a("h2",{attrs:{id:"database-connection"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#database-connection"}},[t._v("#")]),t._v(" Database Connection")]),t._v(" "),a("p",[t._v("The following shows the content of a sample "),a("code",[t._v(".properties")]),t._v(" file that can be used to connect Ontop to Denodo:")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[t._v("jdbc.url "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" jdbc:vdb://localhost:9999/books\njdbc.user "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" admin\njdbc.password "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("${denodo.password}")]),t._v("\njdbc.driver "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" com.denodo.vdp.jdbc.Driver\n")])])]),a("h2",{attrs:{id:"nested-type-support"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#nested-type-support"}},[t._v("#")]),t._v(" Nested Type Support")]),t._v(" "),a("p",[t._v("Nested data types and the "),a("a",{attrs:{href:"/guide/advanced/lenses#flattenlens"}},[t._v("flatten lens")]),t._v(" are not supported for Denodo.")])])}),[],!1,null,null,null);e.default=o.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[41],{418:function(t,e,a){"use strict";a.r(e);var s=a(51),o=Object(s.a)({},(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"denodo"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#denodo"}},[t._v("#")]),t._v(" Denodo")]),t._v(" "),a("p",[t._v("Through the "),a("a",{attrs:{href:"https://www.denodo.com/en",target:"_blank",rel:"noopener"}},[t._v("Denodo"),a("OutboundLink")],1),t._v(" connector, Ontop is able to construct VKGs on Denodo databases.")]),t._v(" "),a("h2",{attrs:{id:"limitations-exceptions"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#limitations-exceptions"}},[t._v("#")]),t._v(" Limitations & Exceptions")]),t._v(" "),a("ul",[a("li",[t._v("SPARQL "),a("em",[t._v("UUID")]),t._v(" and "),a("em",[t._v("hash")]),t._v(" functions are not supported for Denodo.")]),t._v(" "),a("li",[t._v("Nested data types and the "),a("a",{attrs:{href:"/guide/advanced/lenses#flattenlens"}},[t._v("flatten lens")]),t._v(" are not supported for Denodo.")])]),t._v(" "),a("h2",{attrs:{id:"database-connection"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#database-connection"}},[t._v("#")]),t._v(" Database Connection")]),t._v(" "),a("p",[t._v("The following shows the content of a sample "),a("code",[t._v(".properties")]),t._v(" file that can be used to connect Ontop to Denodo:")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[t._v("jdbc.url "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" jdbc:vdb://localhost:9999/books\njdbc.user "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" admin\njdbc.password "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("${denodo.password}")]),t._v("\njdbc.driver "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" com.denodo.vdp.jdbc.Driver\n")])])]),a("h2",{attrs:{id:"nested-type-support"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#nested-type-support"}},[t._v("#")]),t._v(" Nested Type Support")]),t._v(" "),a("p",[t._v("Nested data types and the "),a("a",{attrs:{href:"/guide/advanced/lenses#flattenlens"}},[t._v("flatten lens")]),t._v(" are not supported for Denodo.")])])}),[],!1,null,null,null);e.default=o.exports}}]); \ No newline at end of file diff --git a/assets/js/42.975f0441.js b/assets/js/42.605d70b3.js similarity index 98% rename from assets/js/42.975f0441.js rename to assets/js/42.605d70b3.js index f23cb029b..610a740e1 100644 --- a/assets/js/42.975f0441.js +++ b/assets/js/42.605d70b3.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[42],{418:function(e,t,a){"use strict";a.r(t);var s=a(51),r=Object(s.a)({},(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[a("h1",{attrs:{id:"dremio"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#dremio"}},[e._v("#")]),e._v(" Dremio")]),e._v(" "),a("p",[a("em",[e._v("Supported since 4.1.0.")])]),e._v(" "),a("p",[e._v("Through the "),a("a",{attrs:{href:"https://dremio.com",target:"_blank",rel:"noopener"}},[e._v("Dremio"),a("OutboundLink")],1),e._v(" connector, Ontop is able to construct VKGs on Dremio databases.\nOntop can connect to normal Dremio instances, as well as Dremio Cloud databases.")]),e._v(" "),a("h2",{attrs:{id:"limitations-exceptions"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#limitations-exceptions"}},[e._v("#")]),e._v(" Limitations & Exceptions")]),e._v(" "),a("div",{staticClass:"custom-block warning"},[a("p",{staticClass:"custom-block-title"},[e._v("WARNING")]),e._v(" "),a("p",[e._v("Dremio does not provide information about integrity constraints. Make sure to provide this information in order to avoid very inefficient queries.\nWe recommend using "),a("a",{attrs:{href:"/guide/advanced/lenses"}},[e._v("lenses")]),e._v(" for this purpose.")])]),e._v(" "),a("ul",[a("li",[e._v("The "),a("code",[e._v("position")]),e._v(" argument for the "),a("a",{attrs:{href:"/guide/advanced/lenses#flattenlens"}},[e._v("flatten lens")]),e._v(" cannot be used with Dremio.")]),e._v(" "),a("li",[e._v("When using a Dremio version below 21.0.0, some larger queries that employ "),a("code",[e._v("UNION")]),e._v("s may fail. This can be solved by adding "),a("code",[e._v("ontop.maxNbChildrenLiftingDBFS=0")]),e._v(" to the properties")])]),e._v(" "),a("h2",{attrs:{id:"database-connection"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#database-connection"}},[e._v("#")]),e._v(" Database Connection")]),e._v(" "),a("p",[e._v("The following shows the content of a sample "),a("code",[e._v(".properties")]),e._v(" file that can be used to connect Ontop to Dremio for each supported JDBC:")]),e._v(" "),a("ul",[a("li",[a("code",[e._v("com.dremio.jdbc.Driver")])])]),e._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[e._v("jdbc.url "),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" jdbc:dremio:direct"),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v("localhost:31010\njdbc.user "),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" user\njdbc.password "),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" password\njdbc.driver "),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" com.dremio.jdbc.Driver\n")])])]),a("ul",[a("li",[a("code",[e._v("org.apache.arrow.driver.jdbc.ArrowFlightJdbcDriver")])])]),e._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[e._v("jdbc.url "),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" jdbc:arrow-flight-sql://localhost:32010\njdbc.user "),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" dremio\njdbc.password "),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" password\njdbc.driver "),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" org.apache.arrow.driver.jdbc.ArrowFlightJdbcDriver\n")])])]),a("h2",{attrs:{id:"nested-type-support"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#nested-type-support"}},[e._v("#")]),e._v(" Nested Type Support")]),e._v(" "),a("p",[e._v("Ontop implements explicit compatibility with the Dremio array type "),a("code",[e._v("LIST")]),e._v(" which can be used with the "),a("a",{attrs:{href:"/guide/advanced/lenses#flattenlens"}},[e._v("flatten lens")]),e._v(". However, it cannot infer the type of the flattened result column.")]),e._v(" "),a("p",[e._v("To use a flatten lens on a JSON-encoded array stored in the database, it first has to be converted to a "),a("code",[e._v("LIST")]),e._v(".")]),e._v(" "),a("div",{staticClass:"custom-block warning"},[a("p",{staticClass:"custom-block-title"},[e._v("WARNING")]),e._v(" "),a("p",[e._v("The "),a("code",[e._v("position")]),e._v(" argument for flatten lenses cannot be used with Dremio.")])]),e._v(" "),a("h3",{attrs:{id:"struct-access"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#struct-access"}},[e._v("#")]),e._v(" Struct Access")]),e._v(" "),a("p",[e._v("Individual struct objects can be accessed by SQL expressions in the dialect's default way:")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v("SELECT my_struct['my_attribute'] FROM ...\n")])])])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[42],{419:function(e,t,a){"use strict";a.r(t);var s=a(51),r=Object(s.a)({},(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[a("h1",{attrs:{id:"dremio"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#dremio"}},[e._v("#")]),e._v(" Dremio")]),e._v(" "),a("p",[a("em",[e._v("Supported since 4.1.0.")])]),e._v(" "),a("p",[e._v("Through the "),a("a",{attrs:{href:"https://dremio.com",target:"_blank",rel:"noopener"}},[e._v("Dremio"),a("OutboundLink")],1),e._v(" connector, Ontop is able to construct VKGs on Dremio databases.\nOntop can connect to normal Dremio instances, as well as Dremio Cloud databases.")]),e._v(" "),a("h2",{attrs:{id:"limitations-exceptions"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#limitations-exceptions"}},[e._v("#")]),e._v(" Limitations & Exceptions")]),e._v(" "),a("div",{staticClass:"custom-block warning"},[a("p",{staticClass:"custom-block-title"},[e._v("WARNING")]),e._v(" "),a("p",[e._v("Dremio does not provide information about integrity constraints. Make sure to provide this information in order to avoid very inefficient queries.\nWe recommend using "),a("a",{attrs:{href:"/guide/advanced/lenses"}},[e._v("lenses")]),e._v(" for this purpose.")])]),e._v(" "),a("ul",[a("li",[e._v("The "),a("code",[e._v("position")]),e._v(" argument for the "),a("a",{attrs:{href:"/guide/advanced/lenses#flattenlens"}},[e._v("flatten lens")]),e._v(" cannot be used with Dremio.")]),e._v(" "),a("li",[e._v("When using a Dremio version below 21.0.0, some larger queries that employ "),a("code",[e._v("UNION")]),e._v("s may fail. This can be solved by adding "),a("code",[e._v("ontop.maxNbChildrenLiftingDBFS=0")]),e._v(" to the properties")])]),e._v(" "),a("h2",{attrs:{id:"database-connection"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#database-connection"}},[e._v("#")]),e._v(" Database Connection")]),e._v(" "),a("p",[e._v("The following shows the content of a sample "),a("code",[e._v(".properties")]),e._v(" file that can be used to connect Ontop to Dremio for each supported JDBC:")]),e._v(" "),a("ul",[a("li",[a("code",[e._v("com.dremio.jdbc.Driver")])])]),e._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[e._v("jdbc.url "),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" jdbc:dremio:direct"),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v("localhost:31010\njdbc.user "),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" user\njdbc.password "),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" password\njdbc.driver "),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" com.dremio.jdbc.Driver\n")])])]),a("ul",[a("li",[a("code",[e._v("org.apache.arrow.driver.jdbc.ArrowFlightJdbcDriver")])])]),e._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[e._v("jdbc.url "),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" jdbc:arrow-flight-sql://localhost:32010\njdbc.user "),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" dremio\njdbc.password "),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" password\njdbc.driver "),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" org.apache.arrow.driver.jdbc.ArrowFlightJdbcDriver\n")])])]),a("h2",{attrs:{id:"nested-type-support"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#nested-type-support"}},[e._v("#")]),e._v(" Nested Type Support")]),e._v(" "),a("p",[e._v("Ontop implements explicit compatibility with the Dremio array type "),a("code",[e._v("LIST")]),e._v(" which can be used with the "),a("a",{attrs:{href:"/guide/advanced/lenses#flattenlens"}},[e._v("flatten lens")]),e._v(". However, it cannot infer the type of the flattened result column.")]),e._v(" "),a("p",[e._v("To use a flatten lens on a JSON-encoded array stored in the database, it first has to be converted to a "),a("code",[e._v("LIST")]),e._v(".")]),e._v(" "),a("div",{staticClass:"custom-block warning"},[a("p",{staticClass:"custom-block-title"},[e._v("WARNING")]),e._v(" "),a("p",[e._v("The "),a("code",[e._v("position")]),e._v(" argument for flatten lenses cannot be used with Dremio.")])]),e._v(" "),a("h3",{attrs:{id:"struct-access"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#struct-access"}},[e._v("#")]),e._v(" Struct Access")]),e._v(" "),a("p",[e._v("Individual struct objects can be accessed by SQL expressions in the dialect's default way:")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v("SELECT my_struct['my_attribute'] FROM ...\n")])])])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/43.9e2da8d6.js b/assets/js/43.1f88b050.js similarity index 98% rename from assets/js/43.9e2da8d6.js rename to assets/js/43.1f88b050.js index 28c9766d7..cc7309060 100644 --- a/assets/js/43.9e2da8d6.js +++ b/assets/js/43.1f88b050.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[43],{420:function(t,e,s){"use strict";s.r(e);var a=s(51),o=Object(a.a)({},(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"duckdb"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#duckdb"}},[t._v("#")]),t._v(" DuckDB")]),t._v(" "),s("p",[s("em",[t._v("Supported since 5.0.2.")])]),t._v(" "),s("p",[t._v("Through the "),s("a",{attrs:{href:"https://duckdb.org",target:"_blank",rel:"noopener"}},[t._v("DuckDB"),s("OutboundLink")],1),t._v(" connector, Ontop is able to construct VKGs on DuckDB database files.")]),t._v(" "),s("h2",{attrs:{id:"limitations-exceptions"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#limitations-exceptions"}},[t._v("#")]),t._v(" Limitations & Exceptions")]),t._v(" "),s("ul",[s("li",[t._v("DuckDB database files prior to version 1.0 are not guaranteed to be compatible with later versions.")]),t._v(" "),s("li",[t._v("Setting a default schema is not supported when connecting to DuckDB.")]),t._v(" "),s("li",[t._v("Nested data types are only supported starting from version 0.7 of DuckDB.")]),t._v(" "),s("li",[t._v('Accessing struct fields using the "dot operator" is not supported.')]),t._v(" "),s("li",[t._v("The Ontop option "),s("code",[t._v("ontop.exposeSystemTables")]),t._v(" is not supported for DuckDB, as the JBDC does not allow us to access system tables.")]),t._v(" "),s("li",[t._v("DuckDB has a very specific "),s("a",{attrs:{href:"https://duckdb.org/faq#how-does-duckdb-handle-concurrency",target:"_blank",rel:"noopener"}},[t._v("concurrency model"),s("OutboundLink")],1),t._v(". In particular, it does not support concurrent multi-process read-write queries.")])]),t._v(" "),s("h2",{attrs:{id:"database-connection"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#database-connection"}},[t._v("#")]),t._v(" Database Connection")]),t._v(" "),s("p",[t._v("The following shows the content of a sample "),s("code",[t._v(".properties")]),t._v(" file that can be used to connect Ontop to DuckDB:")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[t._v("jdbc.url "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" jdbc:duckdb:path/to/database.db\njdbc.driver "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" org.duckdb.DuckDBDriver\n")])])]),s("h2",{attrs:{id:"nested-type-support"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#nested-type-support"}},[t._v("#")]),t._v(" Nested Type Support")]),t._v(" "),s("p",[t._v("Ontop implements explicit compatibility with the DuckDB array type "),s("code",[t._v("T[]")]),t._v(". When used with the "),s("a",{attrs:{href:"/guide/advanced/lenses#flattenlens"}},[t._v("flatten lens")]),t._v(", it is able to automatically infer the type of the result column.")]),t._v(" "),s("p",[t._v("The flatten lens cannot be used on arrays stored as JSON-encoded columns in the database. For such use cases, the column first has to be converted to an array type.")]),t._v(" "),s("div",{staticClass:"custom-block tip"},[s("p",{staticClass:"custom-block-title"},[t._v("NOTE")]),t._v(" "),s("p",[t._v("Nested data types are only supported starting from version 0.7 of DuckDB.")])]),t._v(" "),s("h3",{attrs:{id:"struct-access"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#struct-access"}},[t._v("#")]),t._v(" Struct Access")]),t._v(" "),s("p",[t._v("Individual struct objects can be accessed by SQL expressions in the dialect's default way:")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("SELECT my_struct['my_attribute'] FROM ...\n")])])]),s("div",{staticClass:"custom-block warning"},[s("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),s("p",[t._v('Accessing struct fields using the "dot operator" is not supported.')])])])}),[],!1,null,null,null);e.default=o.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[43],{421:function(t,e,s){"use strict";s.r(e);var a=s(51),o=Object(a.a)({},(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"duckdb"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#duckdb"}},[t._v("#")]),t._v(" DuckDB")]),t._v(" "),s("p",[s("em",[t._v("Supported since 5.0.2.")])]),t._v(" "),s("p",[t._v("Through the "),s("a",{attrs:{href:"https://duckdb.org",target:"_blank",rel:"noopener"}},[t._v("DuckDB"),s("OutboundLink")],1),t._v(" connector, Ontop is able to construct VKGs on DuckDB database files.")]),t._v(" "),s("h2",{attrs:{id:"limitations-exceptions"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#limitations-exceptions"}},[t._v("#")]),t._v(" Limitations & Exceptions")]),t._v(" "),s("ul",[s("li",[t._v("DuckDB database files prior to version 1.0 are not guaranteed to be compatible with later versions.")]),t._v(" "),s("li",[t._v("Setting a default schema is not supported when connecting to DuckDB.")]),t._v(" "),s("li",[t._v("Nested data types are only supported starting from version 0.7 of DuckDB.")]),t._v(" "),s("li",[t._v('Accessing struct fields using the "dot operator" is not supported.')]),t._v(" "),s("li",[t._v("The Ontop option "),s("code",[t._v("ontop.exposeSystemTables")]),t._v(" is not supported for DuckDB, as the JBDC does not allow us to access system tables.")]),t._v(" "),s("li",[t._v("DuckDB has a very specific "),s("a",{attrs:{href:"https://duckdb.org/faq#how-does-duckdb-handle-concurrency",target:"_blank",rel:"noopener"}},[t._v("concurrency model"),s("OutboundLink")],1),t._v(". In particular, it does not support concurrent multi-process read-write queries.")])]),t._v(" "),s("h2",{attrs:{id:"database-connection"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#database-connection"}},[t._v("#")]),t._v(" Database Connection")]),t._v(" "),s("p",[t._v("The following shows the content of a sample "),s("code",[t._v(".properties")]),t._v(" file that can be used to connect Ontop to DuckDB:")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[t._v("jdbc.url "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" jdbc:duckdb:path/to/database.db\njdbc.driver "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" org.duckdb.DuckDBDriver\n")])])]),s("h2",{attrs:{id:"nested-type-support"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#nested-type-support"}},[t._v("#")]),t._v(" Nested Type Support")]),t._v(" "),s("p",[t._v("Ontop implements explicit compatibility with the DuckDB array type "),s("code",[t._v("T[]")]),t._v(". When used with the "),s("a",{attrs:{href:"/guide/advanced/lenses#flattenlens"}},[t._v("flatten lens")]),t._v(", it is able to automatically infer the type of the result column.")]),t._v(" "),s("p",[t._v("The flatten lens cannot be used on arrays stored as JSON-encoded columns in the database. For such use cases, the column first has to be converted to an array type.")]),t._v(" "),s("div",{staticClass:"custom-block tip"},[s("p",{staticClass:"custom-block-title"},[t._v("NOTE")]),t._v(" "),s("p",[t._v("Nested data types are only supported starting from version 0.7 of DuckDB.")])]),t._v(" "),s("h3",{attrs:{id:"struct-access"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#struct-access"}},[t._v("#")]),t._v(" Struct Access")]),t._v(" "),s("p",[t._v("Individual struct objects can be accessed by SQL expressions in the dialect's default way:")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("SELECT my_struct['my_attribute'] FROM ...\n")])])]),s("div",{staticClass:"custom-block warning"},[s("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),s("p",[t._v('Accessing struct fields using the "dot operator" is not supported.')])])])}),[],!1,null,null,null);e.default=o.exports}}]); \ No newline at end of file diff --git a/assets/js/44.b45be0fb.js b/assets/js/44.3141a4aa.js similarity index 98% rename from assets/js/44.b45be0fb.js rename to assets/js/44.3141a4aa.js index 23939f88e..71197df48 100644 --- a/assets/js/44.b45be0fb.js +++ b/assets/js/44.3141a4aa.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[44],{421:function(t,e,a){"use strict";a.r(e);var s=a(51),n=Object(s.a)({},(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"aws-dynamodb"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#aws-dynamodb"}},[t._v("#")]),t._v(" AWS DynamoDB")]),t._v(" "),a("p",[a("em",[t._v("Supported (beta) since 5.1.0.")])]),t._v(" "),a("p",[t._v("Through the "),a("a",{attrs:{href:"https://www.amazonaws.cn/en/dynamodb/",target:"_blank",rel:"noopener"}},[t._v("DynamoDB"),a("OutboundLink")],1),t._v(" connector, Ontop is able to construct VKGs on AWS DynamoDB tables using the "),a("a",{attrs:{href:"https://www.cdata.com/drivers/dynamodb/jdbc/",target:"_blank",rel:"noopener"}},[t._v("CData JDBC Driver for Amazon DynamoDB"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("h2",{attrs:{id:"limitations-exceptions"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#limitations-exceptions"}},[t._v("#")]),t._v(" Limitations & Exceptions")]),t._v(" "),a("div",{staticClass:"custom-block warning"},[a("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),a("p",[t._v("DynamoDB only provides limited information about integrity constraints. Make sure to provide this information in order to avoid very inefficient queries.\nWe recommend using "),a("a",{attrs:{href:"/guide/advanced/lenses"}},[t._v("lenses")]),t._v(" for this purpose.")])]),t._v(" "),a("div",{staticClass:"custom-block warning"},[a("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),a("p",[t._v("To run Ontop with the CData DynamoDB JDBC, "),a("em",[t._v('"enhanced SQL queries"')]),t._v(" must be enabled. This is achieved by adding "),a("code",[t._v("supportenhancedsql=true")]),t._v(" to the connection properties.")])]),t._v(" "),a("ul",[a("li",[t._v("Nested data structures and the "),a("em",[t._v("FlattenLens")]),t._v(" are not supported.")])]),t._v(" "),a("h2",{attrs:{id:"database-connection"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#database-connection"}},[t._v("#")]),t._v(" Database Connection")]),t._v(" "),a("p",[t._v("The following shows the content of a sample "),a("code",[t._v(".properties")]),t._v(" file that can be used to connect Ontop to DynamoDB:")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[t._v("jdbc.url "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" jdbc:amazondynamodb:AuthScheme"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("AwsRootKeys"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),a("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("AWSRegion")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("FRANKFURT"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),a("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("supportenhancedsql")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("true\njdbc.property.AWSAccessKey "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" public-access-key\njdbc.property.AWSSecretKey "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" private-access-key\njdbc.driver "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" cdata.jdbc.amazondynamodb.AmazonDynamoDBDriver\n")])])]),a("h2",{attrs:{id:"nested-type-support"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#nested-type-support"}},[t._v("#")]),t._v(" Nested Type Support")]),t._v(" "),a("p",[t._v("Nested data types and the "),a("a",{attrs:{href:"/guide/advanced/lenses#flattenlens"}},[t._v("flatten lens")]),t._v(" are not supported for DynamoDB.")])])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[44],{420:function(t,e,a){"use strict";a.r(e);var s=a(51),n=Object(s.a)({},(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"aws-dynamodb"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#aws-dynamodb"}},[t._v("#")]),t._v(" AWS DynamoDB")]),t._v(" "),a("p",[a("em",[t._v("Supported (beta) since 5.1.0.")])]),t._v(" "),a("p",[t._v("Through the "),a("a",{attrs:{href:"https://www.amazonaws.cn/en/dynamodb/",target:"_blank",rel:"noopener"}},[t._v("DynamoDB"),a("OutboundLink")],1),t._v(" connector, Ontop is able to construct VKGs on AWS DynamoDB tables using the "),a("a",{attrs:{href:"https://www.cdata.com/drivers/dynamodb/jdbc/",target:"_blank",rel:"noopener"}},[t._v("CData JDBC Driver for Amazon DynamoDB"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("h2",{attrs:{id:"limitations-exceptions"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#limitations-exceptions"}},[t._v("#")]),t._v(" Limitations & Exceptions")]),t._v(" "),a("div",{staticClass:"custom-block warning"},[a("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),a("p",[t._v("DynamoDB only provides limited information about integrity constraints. Make sure to provide this information in order to avoid very inefficient queries.\nWe recommend using "),a("a",{attrs:{href:"/guide/advanced/lenses"}},[t._v("lenses")]),t._v(" for this purpose.")])]),t._v(" "),a("div",{staticClass:"custom-block warning"},[a("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),a("p",[t._v("To run Ontop with the CData DynamoDB JDBC, "),a("em",[t._v('"enhanced SQL queries"')]),t._v(" must be enabled. This is achieved by adding "),a("code",[t._v("supportenhancedsql=true")]),t._v(" to the connection properties.")])]),t._v(" "),a("ul",[a("li",[t._v("Nested data structures and the "),a("em",[t._v("FlattenLens")]),t._v(" are not supported.")])]),t._v(" "),a("h2",{attrs:{id:"database-connection"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#database-connection"}},[t._v("#")]),t._v(" Database Connection")]),t._v(" "),a("p",[t._v("The following shows the content of a sample "),a("code",[t._v(".properties")]),t._v(" file that can be used to connect Ontop to DynamoDB:")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[t._v("jdbc.url "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" jdbc:amazondynamodb:AuthScheme"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("AwsRootKeys"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),a("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("AWSRegion")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("FRANKFURT"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),a("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("supportenhancedsql")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("true\njdbc.property.AWSAccessKey "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" public-access-key\njdbc.property.AWSSecretKey "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" private-access-key\njdbc.driver "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" cdata.jdbc.amazondynamodb.AmazonDynamoDBDriver\n")])])]),a("h2",{attrs:{id:"nested-type-support"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#nested-type-support"}},[t._v("#")]),t._v(" Nested Type Support")]),t._v(" "),a("p",[t._v("Nested data types and the "),a("a",{attrs:{href:"/guide/advanced/lenses#flattenlens"}},[t._v("flatten lens")]),t._v(" are not supported for DynamoDB.")])])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/47.82a65742.js b/assets/js/47.386aad46.js similarity index 97% rename from assets/js/47.82a65742.js rename to assets/js/47.386aad46.js index 43247eb7d..cacff0e46 100644 --- a/assets/js/47.82a65742.js +++ b/assets/js/47.386aad46.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[47],{426:function(t,e,a){"use strict";a.r(e);var s=a(51),r=Object(s.a)({},(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"mariadb"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#mariadb"}},[t._v("#")]),t._v(" MariaDB")]),t._v(" "),a("p",[a("em",[t._v("Supported since 5.0.0.")])]),t._v(" "),a("p",[t._v("Through the "),a("a",{attrs:{href:"https://mariadb.com",target:"_blank",rel:"noopener"}},[t._v("MariaDB"),a("OutboundLink")],1),t._v(" connector, Ontop is able to construct VKGs on MariaDB databases.")]),t._v(" "),a("h2",{attrs:{id:"limitations-exceptions"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#limitations-exceptions"}},[t._v("#")]),t._v(" Limitations & Exceptions")]),t._v(" "),a("ul",[a("li",[t._v("String literals have to be encased in "),a("em",[t._v("single quotes")]),t._v(" ("),a("code",[t._v("'")]),t._v("). Double quote string literals ("),a("code",[t._v('"')]),t._v(") are not supported.")])]),t._v(" "),a("h2",{attrs:{id:"database-connection"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#database-connection"}},[t._v("#")]),t._v(" Database Connection")]),t._v(" "),a("p",[t._v("The following shows the content of a sample "),a("code",[t._v(".properties")]),t._v(" file that can be used to connect Ontop to MariaDB:")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[t._v("jdbc.url "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" jdbc:mariadb://localhost:3306/defaultdatabase\njdbc.user "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" user\njdbc.password "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" password\njdbc.driver "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" org.mariadb.jdbc.Driver\n")])])]),a("h2",{attrs:{id:"nested-type-support"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#nested-type-support"}},[t._v("#")]),t._v(" Nested Type Support")]),t._v(" "),a("p",[t._v("Ontop implements explicit compatibility with the MariaDB type "),a("code",[t._v("JSON")]),t._v(" which can be used with the "),a("a",{attrs:{href:"/guide/advanced/lenses#flattenlens"}},[t._v("flatten lens")]),t._v(". However, it cannot infer the type of the flattened result column.")]),t._v(" "),a("p",[t._v("In case the flattened column is still a nested structure after the flatten operation is performed (e.g. for arrays of objects), "),a("a",{attrs:{href:"https://mariadb.com/kb/en/json-functions/",target:"_blank",rel:"noopener"}},[t._v("MariaDB's JSON functions"),a("OutboundLink")],1),t._v(" can be used to further work with them.")])])}),[],!1,null,null,null);e.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[47],{424:function(t,e,a){"use strict";a.r(e);var s=a(51),r=Object(s.a)({},(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"mariadb"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#mariadb"}},[t._v("#")]),t._v(" MariaDB")]),t._v(" "),a("p",[a("em",[t._v("Supported since 5.0.0.")])]),t._v(" "),a("p",[t._v("Through the "),a("a",{attrs:{href:"https://mariadb.com",target:"_blank",rel:"noopener"}},[t._v("MariaDB"),a("OutboundLink")],1),t._v(" connector, Ontop is able to construct VKGs on MariaDB databases.")]),t._v(" "),a("h2",{attrs:{id:"limitations-exceptions"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#limitations-exceptions"}},[t._v("#")]),t._v(" Limitations & Exceptions")]),t._v(" "),a("ul",[a("li",[t._v("String literals have to be encased in "),a("em",[t._v("single quotes")]),t._v(" ("),a("code",[t._v("'")]),t._v("). Double quote string literals ("),a("code",[t._v('"')]),t._v(") are not supported.")])]),t._v(" "),a("h2",{attrs:{id:"database-connection"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#database-connection"}},[t._v("#")]),t._v(" Database Connection")]),t._v(" "),a("p",[t._v("The following shows the content of a sample "),a("code",[t._v(".properties")]),t._v(" file that can be used to connect Ontop to MariaDB:")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[t._v("jdbc.url "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" jdbc:mariadb://localhost:3306/defaultdatabase\njdbc.user "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" user\njdbc.password "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" password\njdbc.driver "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" org.mariadb.jdbc.Driver\n")])])]),a("h2",{attrs:{id:"nested-type-support"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#nested-type-support"}},[t._v("#")]),t._v(" Nested Type Support")]),t._v(" "),a("p",[t._v("Ontop implements explicit compatibility with the MariaDB type "),a("code",[t._v("JSON")]),t._v(" which can be used with the "),a("a",{attrs:{href:"/guide/advanced/lenses#flattenlens"}},[t._v("flatten lens")]),t._v(". However, it cannot infer the type of the flattened result column.")]),t._v(" "),a("p",[t._v("In case the flattened column is still a nested structure after the flatten operation is performed (e.g. for arrays of objects), "),a("a",{attrs:{href:"https://mariadb.com/kb/en/json-functions/",target:"_blank",rel:"noopener"}},[t._v("MariaDB's JSON functions"),a("OutboundLink")],1),t._v(" can be used to further work with them.")])])}),[],!1,null,null,null);e.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/48.ae920e84.js b/assets/js/48.cc4799f6.js similarity index 98% rename from assets/js/48.ae920e84.js rename to assets/js/48.cc4799f6.js index e832fc182..82234c4cd 100644 --- a/assets/js/48.ae920e84.js +++ b/assets/js/48.cc4799f6.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[48],{424:function(e,t,s){"use strict";s.r(t);var r=s(51),a=Object(r.a)({},(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[s("h1",{attrs:{id:"ms-sql-server"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#ms-sql-server"}},[e._v("#")]),e._v(" MS SQL Server")]),e._v(" "),s("p",[e._v("Through the "),s("a",{attrs:{href:"https://www.microsoft.com/en-us/sql-server",target:"_blank",rel:"noopener"}},[e._v("MS SQL Server"),s("OutboundLink")],1),e._v(" connector, Ontop is able to construct VKGs on SQL Server databases.")]),e._v(" "),s("h2",{attrs:{id:"limitations-exceptions"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#limitations-exceptions"}},[e._v("#")]),e._v(" Limitations & Exceptions")]),e._v(" "),s("ul",[s("li",[e._v("RegEx SPARQL functions are not supported.")]),e._v(" "),s("li",[e._v("The "),s("code",[e._v("position")]),e._v(" argument for the "),s("a",{attrs:{href:"/guide/advanced/lenses#flattenlens"}},[e._v("Flatten Lens")]),e._v(" cannot be used with SQLServer.")]),e._v(" "),s("li",[e._v("Support for "),s("code",[e._v("DATETRUNC")]),e._v(" in SQL Server is very recent (introduced in SQL Server 2022)")])]),e._v(" "),s("h2",{attrs:{id:"database-connection"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#database-connection"}},[e._v("#")]),e._v(" Database Connection")]),e._v(" "),s("p",[e._v("The following shows the content of a sample "),s("code",[e._v(".properties")]),e._v(" file that can be used to connect Ontop to SQLServer:")]),e._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[e._v("jdbc.url "),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" jdbc:sqlserver://localhost:1433"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("databaseName")]),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v("defaultdatabase\njdbc.user "),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" user\njdbc.password "),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" password\njdbc.driver "),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" com.microsoft.sqlserver.jdbc.SQLServerDriver\n")])])]),s("h2",{attrs:{id:"nested-type-support"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#nested-type-support"}},[e._v("#")]),e._v(" Nested Type Support")]),e._v(" "),s("p",[e._v("Nested data types are not supported by SQLServer. However, Ontop allows the usage of the "),s("a",{attrs:{href:"/guide/advanced/lenses#flattenlens"}},[e._v("flatten lens")]),e._v(" over string columns that contain JSON-encoded arrays. The output type of the flattened result column cannot be inferred.")]),e._v(" "),s("div",{staticClass:"custom-block warning"},[s("p",{staticClass:"custom-block-title"},[e._v("WARNING")]),e._v(" "),s("p",[e._v("The "),s("code",[e._v("position")]),e._v(" argument for flatten lenses cannot be used with SQLServer.")])]),e._v(" "),s("p",[e._v("In case the flattened column is still a nested structure after the flatten operation is performed (e.g. for arrays of objects), "),s("a",{attrs:{href:"https://learn.microsoft.com/en-us/sql/t-sql/functions/json-functions-transact-sql?view=sql-server-ver16",target:"_blank",rel:"noopener"}},[e._v("SQLServer's JSON functions"),s("OutboundLink")],1),e._v(" can be used to further work with them.")])])}),[],!1,null,null,null);t.default=a.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[48],{426:function(e,t,s){"use strict";s.r(t);var r=s(51),a=Object(r.a)({},(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[s("h1",{attrs:{id:"ms-sql-server"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#ms-sql-server"}},[e._v("#")]),e._v(" MS SQL Server")]),e._v(" "),s("p",[e._v("Through the "),s("a",{attrs:{href:"https://www.microsoft.com/en-us/sql-server",target:"_blank",rel:"noopener"}},[e._v("MS SQL Server"),s("OutboundLink")],1),e._v(" connector, Ontop is able to construct VKGs on SQL Server databases.")]),e._v(" "),s("h2",{attrs:{id:"limitations-exceptions"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#limitations-exceptions"}},[e._v("#")]),e._v(" Limitations & Exceptions")]),e._v(" "),s("ul",[s("li",[e._v("RegEx SPARQL functions are not supported.")]),e._v(" "),s("li",[e._v("The "),s("code",[e._v("position")]),e._v(" argument for the "),s("a",{attrs:{href:"/guide/advanced/lenses#flattenlens"}},[e._v("Flatten Lens")]),e._v(" cannot be used with SQLServer.")]),e._v(" "),s("li",[e._v("Support for "),s("code",[e._v("DATETRUNC")]),e._v(" in SQL Server is very recent (introduced in SQL Server 2022)")])]),e._v(" "),s("h2",{attrs:{id:"database-connection"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#database-connection"}},[e._v("#")]),e._v(" Database Connection")]),e._v(" "),s("p",[e._v("The following shows the content of a sample "),s("code",[e._v(".properties")]),e._v(" file that can be used to connect Ontop to SQLServer:")]),e._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[e._v("jdbc.url "),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" jdbc:sqlserver://localhost:1433"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("databaseName")]),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v("defaultdatabase\njdbc.user "),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" user\njdbc.password "),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" password\njdbc.driver "),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" com.microsoft.sqlserver.jdbc.SQLServerDriver\n")])])]),s("h2",{attrs:{id:"nested-type-support"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#nested-type-support"}},[e._v("#")]),e._v(" Nested Type Support")]),e._v(" "),s("p",[e._v("Nested data types are not supported by SQLServer. However, Ontop allows the usage of the "),s("a",{attrs:{href:"/guide/advanced/lenses#flattenlens"}},[e._v("flatten lens")]),e._v(" over string columns that contain JSON-encoded arrays. The output type of the flattened result column cannot be inferred.")]),e._v(" "),s("div",{staticClass:"custom-block warning"},[s("p",{staticClass:"custom-block-title"},[e._v("WARNING")]),e._v(" "),s("p",[e._v("The "),s("code",[e._v("position")]),e._v(" argument for flatten lenses cannot be used with SQLServer.")])]),e._v(" "),s("p",[e._v("In case the flattened column is still a nested structure after the flatten operation is performed (e.g. for arrays of objects), "),s("a",{attrs:{href:"https://learn.microsoft.com/en-us/sql/t-sql/functions/json-functions-transact-sql?view=sql-server-ver16",target:"_blank",rel:"noopener"}},[e._v("SQLServer's JSON functions"),s("OutboundLink")],1),e._v(" can be used to further work with them.")])])}),[],!1,null,null,null);t.default=a.exports}}]); \ No newline at end of file diff --git a/assets/js/49.4a6e8b26.js b/assets/js/49.4a6e8b26.js new file mode 100644 index 000000000..b64250062 --- /dev/null +++ b/assets/js/49.4a6e8b26.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[49],{425:function(t,e,s){"use strict";s.r(e);var a=s(51),o=Object(a.a)({},(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"mysql"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#mysql"}},[t._v("#")]),t._v(" MySQL")]),t._v(" "),s("p",[t._v("Through the "),s("a",{attrs:{href:"https://mysql.com",target:"_blank",rel:"noopener"}},[t._v("MySQL"),s("OutboundLink")],1),t._v(" connector, Ontop is able to construct VKGs on MySQL databases.")]),t._v(" "),s("h2",{attrs:{id:"limitations-exceptions"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#limitations-exceptions"}},[t._v("#")]),t._v(" Limitations & Exceptions")]),t._v(" "),s("ul",[s("li",[t._v("String literals have to be encased in "),s("em",[t._v("single quotes")]),t._v(" ("),s("code",[t._v("'")]),t._v("). Double quote string literals ("),s("code",[t._v('"')]),t._v(") are not supported.")]),t._v(" "),s("li",[t._v('Accessing JSON object fields with the "dot operator" is not supported (see below).')]),t._v(" "),s("li",[t._v("MySQL 5.x comes with some limitations (e.g. no anonymous bnode support, no regexp replace, no nested data support). MySQL 5.x reached its end-of-life, so please consider upgrading.")])]),t._v(" "),s("h2",{attrs:{id:"database-connection"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#database-connection"}},[t._v("#")]),t._v(" Database Connection")]),t._v(" "),s("p",[t._v("The following shows the content of a sample "),s("code",[t._v(".properties")]),t._v(" file that can be used to connect Ontop to MySQL:")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[t._v("jdbc.url "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" jdbc:mysql://localhost:3306/defaultdatabase\njdbc.user "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" user\njdbc.password "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" password\njdbc.driver "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" com.mysql.cj.jdbc.Driver\n")])])]),s("h2",{attrs:{id:"nested-type-support"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#nested-type-support"}},[t._v("#")]),t._v(" Nested Type Support")]),t._v(" "),s("p",[t._v("Ontop implements explicit compatibility with the MySQL type "),s("code",[t._v("JSON")]),t._v(" which can be used with the "),s("a",{attrs:{href:"/guide/advanced/lenses#flattenlens"}},[t._v("flatten lens")]),t._v(". However, it cannot infer the type of the flattened result column.")]),t._v(" "),s("p",[t._v("In case the flattened column is still a nested structure after the flatten operation is performed (e.g. for arrays of objects), "),s("a",{attrs:{href:"https://dev.mysql.com/doc/refman/8.0/en/json-functions.html",target:"_blank",rel:"noopener"}},[t._v("MySQL's JSON functions"),s("OutboundLink")],1),t._v(" can be used to further work with them.")]),t._v(" "),s("div",{staticClass:"custom-block warning"},[s("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),s("p",[t._v('Accessing object fields using the "arrow operator" is not supported.')])]),t._v(" "),s("div",{staticClass:"custom-block warning"},[s("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),s("p",[t._v("Nested type only supported for MySQL >= 8.0")])])])}),[],!1,null,null,null);e.default=o.exports}}]); \ No newline at end of file diff --git a/assets/js/49.a8638ba0.js b/assets/js/49.a8638ba0.js deleted file mode 100644 index 912c8ceeb..000000000 --- a/assets/js/49.a8638ba0.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[49],{425:function(t,e,s){"use strict";s.r(e);var a=s(51),o=Object(a.a)({},(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"mysql"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#mysql"}},[t._v("#")]),t._v(" MySQL")]),t._v(" "),s("p",[t._v("Through the "),s("a",{attrs:{href:"https://mysql.com",target:"_blank",rel:"noopener"}},[t._v("MySQL"),s("OutboundLink")],1),t._v(" connector, Ontop is able to construct VKGs on MySQL databases.")]),t._v(" "),s("h2",{attrs:{id:"limitations-exceptions"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#limitations-exceptions"}},[t._v("#")]),t._v(" Limitations & Exceptions")]),t._v(" "),s("ul",[s("li",[t._v("String literals have to be encased in "),s("em",[t._v("single quotes")]),t._v(" ("),s("code",[t._v("'")]),t._v("). Double quote string literals ("),s("code",[t._v('"')]),t._v(") are not supported.")]),t._v(" "),s("li",[t._v('Accessing JSON object fields with the "dot operator" is not supported (see below).')])]),t._v(" "),s("h2",{attrs:{id:"database-connection"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#database-connection"}},[t._v("#")]),t._v(" Database Connection")]),t._v(" "),s("p",[t._v("The following shows the content of a sample "),s("code",[t._v(".properties")]),t._v(" file that can be used to connect Ontop to MySQL:")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[t._v("jdbc.url "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" jdbc:mysql://localhost:3306/defaultdatabase\njdbc.user "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" user\njdbc.password "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" password\njdbc.driver "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" com.mysql.cj.jdbc.Driver\n")])])]),s("h2",{attrs:{id:"nested-type-support"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#nested-type-support"}},[t._v("#")]),t._v(" Nested Type Support")]),t._v(" "),s("p",[t._v("Ontop implements explicit compatibility with the MySQL type "),s("code",[t._v("JSON")]),t._v(" which can be used with the "),s("a",{attrs:{href:"/guide/advanced/lenses#flattenlens"}},[t._v("flatten lens")]),t._v(". However, it cannot infer the type of the flattened result column.")]),t._v(" "),s("p",[t._v("In case the flattened column is still a nested structure after the flatten operation is performed (e.g. for arrays of objects), "),s("a",{attrs:{href:"https://dev.mysql.com/doc/refman/8.0/en/json-functions.html",target:"_blank",rel:"noopener"}},[t._v("MySQL's JSON functions"),s("OutboundLink")],1),t._v(" can be used to further work with them.")]),t._v(" "),s("div",{staticClass:"custom-block warning"},[s("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),s("p",[t._v('Accessing object fields using the "arrow operator" is not supported.')])])])}),[],!1,null,null,null);e.default=o.exports}}]); \ No newline at end of file diff --git a/assets/js/50.2e427b56.js b/assets/js/50.a6d14188.js similarity index 98% rename from assets/js/50.2e427b56.js rename to assets/js/50.a6d14188.js index 46c93e1a6..984892e2f 100644 --- a/assets/js/50.2e427b56.js +++ b/assets/js/50.a6d14188.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[50],{428:function(t,e,a){"use strict";a.r(e);var s=a(51),r=Object(s.a)({},(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"oracle"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#oracle"}},[t._v("#")]),t._v(" Oracle")]),t._v(" "),a("p",[t._v("Through the "),a("a",{attrs:{href:"https://www.oracle.com/database/",target:"_blank",rel:"noopener"}},[t._v("Oracle"),a("OutboundLink")],1),t._v(" connector, Ontop is able to construct VKGs on external Oracle databases.")]),t._v(" "),a("h2",{attrs:{id:"limitations-exceptions"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#limitations-exceptions"}},[t._v("#")]),t._v(" Limitations & Exceptions")]),t._v(" "),a("ul",[a("li",[t._v("Ontop cannot perform inference based on nested data types in Oracle.")]),t._v(" "),a("li",[t._v('Ontop represents the "big integer" datatype as '),a("code",[t._v("NUMBER(19)")]),t._v(".")])]),t._v(" "),a("h2",{attrs:{id:"database-connection"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#database-connection"}},[t._v("#")]),t._v(" Database Connection")]),t._v(" "),a("p",[t._v("The following shows the content of a sample "),a("code",[t._v(".properties")]),t._v(" file that can be used to connect Ontop to Oracle:")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[t._v("jdbc.url "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" jdbc:oracle:thin:@//localhost:49161/defaultcontainer\njdbc.user "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" user\njdbc.password "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" password\njdbc.driver "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" oracle.jdbc.OracleDriver\n")])])]),a("h2",{attrs:{id:"nested-type-support"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#nested-type-support"}},[t._v("#")]),t._v(" Nested Type Support")]),t._v(" "),a("p",[t._v("Ontop does not implement explicit compatibility with nested datatypes in Oracle.\nHowever, Ontop allows the usage of the "),a("a",{attrs:{href:"/guide/advanced/lenses#flattenlens"}},[t._v("flatten lens")]),t._v(" over string columns that contain JSON-encoded arrays. The output type of the flattened result column cannot be inferred.")]),t._v(" "),a("p",[t._v("To use the flatten lens with Oracle array types, they must first be converted to JSON strings.")]),t._v(" "),a("p",[t._v("In case the flattened column is still a nested structure after the flatten operation is performed (e.g. for arrays of objects), "),a("a",{attrs:{href:"https://docs.oracle.com/en/database/oracle/oracle-database/21/adjsn/query-json-data.html#GUID-119E5069-77F2-45DC-B6F0-A1B312945590",target:"_blank",rel:"noopener"}},[t._v("Oracle's JSON functions"),a("OutboundLink")],1),t._v(" can be used to further work with them.")]),t._v(" "),a("div",{staticClass:"custom-block warning"},[a("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),a("p",[t._v('Accessing object fields using the "dot operator" is not supported. Please use SQL JSON functions instead.')])])])}),[],!1,null,null,null);e.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[50],{427:function(t,e,a){"use strict";a.r(e);var s=a(51),r=Object(s.a)({},(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"oracle"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#oracle"}},[t._v("#")]),t._v(" Oracle")]),t._v(" "),a("p",[t._v("Through the "),a("a",{attrs:{href:"https://www.oracle.com/database/",target:"_blank",rel:"noopener"}},[t._v("Oracle"),a("OutboundLink")],1),t._v(" connector, Ontop is able to construct VKGs on external Oracle databases.")]),t._v(" "),a("h2",{attrs:{id:"limitations-exceptions"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#limitations-exceptions"}},[t._v("#")]),t._v(" Limitations & Exceptions")]),t._v(" "),a("ul",[a("li",[t._v("Ontop cannot perform inference based on nested data types in Oracle.")]),t._v(" "),a("li",[t._v('Ontop represents the "big integer" datatype as '),a("code",[t._v("NUMBER(19)")]),t._v(".")])]),t._v(" "),a("h2",{attrs:{id:"database-connection"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#database-connection"}},[t._v("#")]),t._v(" Database Connection")]),t._v(" "),a("p",[t._v("The following shows the content of a sample "),a("code",[t._v(".properties")]),t._v(" file that can be used to connect Ontop to Oracle:")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[t._v("jdbc.url "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" jdbc:oracle:thin:@//localhost:49161/defaultcontainer\njdbc.user "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" user\njdbc.password "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" password\njdbc.driver "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" oracle.jdbc.OracleDriver\n")])])]),a("h2",{attrs:{id:"nested-type-support"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#nested-type-support"}},[t._v("#")]),t._v(" Nested Type Support")]),t._v(" "),a("p",[t._v("Ontop does not implement explicit compatibility with nested datatypes in Oracle.\nHowever, Ontop allows the usage of the "),a("a",{attrs:{href:"/guide/advanced/lenses#flattenlens"}},[t._v("flatten lens")]),t._v(" over string columns that contain JSON-encoded arrays. The output type of the flattened result column cannot be inferred.")]),t._v(" "),a("p",[t._v("To use the flatten lens with Oracle array types, they must first be converted to JSON strings.")]),t._v(" "),a("p",[t._v("In case the flattened column is still a nested structure after the flatten operation is performed (e.g. for arrays of objects), "),a("a",{attrs:{href:"https://docs.oracle.com/en/database/oracle/oracle-database/21/adjsn/query-json-data.html#GUID-119E5069-77F2-45DC-B6F0-A1B312945590",target:"_blank",rel:"noopener"}},[t._v("Oracle's JSON functions"),a("OutboundLink")],1),t._v(" can be used to further work with them.")]),t._v(" "),a("div",{staticClass:"custom-block warning"},[a("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),a("p",[t._v('Accessing object fields using the "dot operator" is not supported. Please use SQL JSON functions instead.')])])])}),[],!1,null,null,null);e.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/51.55dfa97d.js b/assets/js/51.db247110.js similarity index 98% rename from assets/js/51.55dfa97d.js rename to assets/js/51.db247110.js index 5cb482392..78f786150 100644 --- a/assets/js/51.55dfa97d.js +++ b/assets/js/51.db247110.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[51],{427:function(t,e,s){"use strict";s.r(e);var a=s(51),r=Object(a.a)({},(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"postgresql"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#postgresql"}},[t._v("#")]),t._v(" PostgreSQL")]),t._v(" "),s("p",[t._v("Through the "),s("a",{attrs:{href:"https://postgresql.org",target:"_blank",rel:"noopener"}},[t._v("PostgreSQL"),s("OutboundLink")],1),t._v(" connector, Ontop is able to construct VKGs on external Postgres databases.")]),t._v(" "),s("h2",{attrs:{id:"limitations-exceptions"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#limitations-exceptions"}},[t._v("#")]),t._v(" Limitations & Exceptions")]),t._v(" "),s("ul",[s("li",[t._v('Accessing JSON object fields with the "arrow operator" is not supported (see below).')])]),t._v(" "),s("h2",{attrs:{id:"database-connection"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#database-connection"}},[t._v("#")]),t._v(" Database Connection")]),t._v(" "),s("p",[t._v("The following shows the content of a sample "),s("code",[t._v(".properties")]),t._v(" file that can be used to connect Ontop to PostgreSQL:")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[t._v("jdbc.url "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" jdbc:postgresql://localhost:5432/database\njdbc.user "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" admin\njdbc.password "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" password\njdbc.driver "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" org.postgresql.Driver\n")])])]),s("h2",{attrs:{id:"nested-type-support"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#nested-type-support"}},[t._v("#")]),t._v(" Nested Type Support")]),t._v(" "),s("p",[t._v("Ontop implements explicit compatibility with the PostgreSQL array type "),s("code",[t._v("T[]")]),t._v(". When used with the "),s("a",{attrs:{href:"/guide/advanced/lenses#flattenlens"}},[t._v("flatten lens")]),t._v(", it is able to automatically infer the type of the result column.")]),t._v(" "),s("p",[t._v("Furthermore, the flatten lens can also be used with the "),s("code",[t._v("JSON")]),t._v(" and "),s("code",[t._v("JSONB")]),t._v(" datatypes, which are both recognized by Ontop. For these types, however, Ontop cannot infer the output type of the flattened column.")]),t._v(" "),s("h3",{attrs:{id:"struct-access"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#struct-access"}},[t._v("#")]),t._v(" Struct Access")]),t._v(" "),s("p",[t._v('In PostgreSQL, individual struct objects can be accessed by SQL expressions using the "dot operator" on the struct column. In Ontop, this feature is not currently supported.')]),t._v(" "),s("p",[t._v("Should any of their elements still be required, then a workaround can be performed by first transforming the struct into a JSON object and then accessing it using JSON functions.")]),t._v(" "),s("p",[t._v("Example:")]),t._v(" "),s("p",[s("code",[t._v("my_struct.my_attribute")]),t._v(" "),s("mjx-container",{staticClass:"MathJax",attrs:{jax:"SVG"}},[s("svg",{staticStyle:{"vertical-align":"-0.025ex"},attrs:{xmlns:"http://www.w3.org/2000/svg",width:"2.262ex",height:"1.181ex",viewBox:"0 -511 1000 522"}},[s("g",{attrs:{stroke:"currentColor",fill:"currentColor","stroke-width":"0",transform:"matrix(1 0 0 -1 0 0)"}},[s("g",{attrs:{"data-mml-node":"math"}},[s("g",{attrs:{"data-mml-node":"mo"}},[s("path",{attrs:{"data-c":"2192",d:"M56 237T56 250T70 270H835Q719 357 692 493Q692 494 692 496T691 499Q691 511 708 511H711Q720 511 723 510T729 506T732 497T735 481T743 456Q765 389 816 336T935 261Q944 258 944 250Q944 244 939 241T915 231T877 212Q836 186 806 152T761 85T740 35T732 4Q730 -6 727 -8T711 -11Q691 -11 691 0Q691 7 696 25Q728 151 835 230H70Q56 237 56 250Z"}})])])])])]),t._v(" "),s("code",[t._v("JSON_EXTRACT_PATH(TO_JSON(my_struct), '$.my_attribute')")])],1),t._v(" "),s("div",{staticClass:"custom-block warning"},[s("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),s("p",[t._v('The "arrow operators" used to access JSON objects in PostgreSQL are not supported in Ontop. Please use JSON functions instead.')])])])}),[],!1,null,null,null);e.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[51],{429:function(t,e,s){"use strict";s.r(e);var a=s(51),r=Object(a.a)({},(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"postgresql"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#postgresql"}},[t._v("#")]),t._v(" PostgreSQL")]),t._v(" "),s("p",[t._v("Through the "),s("a",{attrs:{href:"https://postgresql.org",target:"_blank",rel:"noopener"}},[t._v("PostgreSQL"),s("OutboundLink")],1),t._v(" connector, Ontop is able to construct VKGs on external Postgres databases.")]),t._v(" "),s("h2",{attrs:{id:"limitations-exceptions"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#limitations-exceptions"}},[t._v("#")]),t._v(" Limitations & Exceptions")]),t._v(" "),s("ul",[s("li",[t._v('Accessing JSON object fields with the "arrow operator" is not supported (see below).')])]),t._v(" "),s("h2",{attrs:{id:"database-connection"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#database-connection"}},[t._v("#")]),t._v(" Database Connection")]),t._v(" "),s("p",[t._v("The following shows the content of a sample "),s("code",[t._v(".properties")]),t._v(" file that can be used to connect Ontop to PostgreSQL:")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[t._v("jdbc.url "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" jdbc:postgresql://localhost:5432/database\njdbc.user "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" admin\njdbc.password "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" password\njdbc.driver "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" org.postgresql.Driver\n")])])]),s("h2",{attrs:{id:"nested-type-support"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#nested-type-support"}},[t._v("#")]),t._v(" Nested Type Support")]),t._v(" "),s("p",[t._v("Ontop implements explicit compatibility with the PostgreSQL array type "),s("code",[t._v("T[]")]),t._v(". When used with the "),s("a",{attrs:{href:"/guide/advanced/lenses#flattenlens"}},[t._v("flatten lens")]),t._v(", it is able to automatically infer the type of the result column.")]),t._v(" "),s("p",[t._v("Furthermore, the flatten lens can also be used with the "),s("code",[t._v("JSON")]),t._v(" and "),s("code",[t._v("JSONB")]),t._v(" datatypes, which are both recognized by Ontop. For these types, however, Ontop cannot infer the output type of the flattened column.")]),t._v(" "),s("h3",{attrs:{id:"struct-access"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#struct-access"}},[t._v("#")]),t._v(" Struct Access")]),t._v(" "),s("p",[t._v('In PostgreSQL, individual struct objects can be accessed by SQL expressions using the "dot operator" on the struct column. In Ontop, this feature is not currently supported.')]),t._v(" "),s("p",[t._v("Should any of their elements still be required, then a workaround can be performed by first transforming the struct into a JSON object and then accessing it using JSON functions.")]),t._v(" "),s("p",[t._v("Example:")]),t._v(" "),s("p",[s("code",[t._v("my_struct.my_attribute")]),t._v(" "),s("mjx-container",{staticClass:"MathJax",attrs:{jax:"SVG"}},[s("svg",{staticStyle:{"vertical-align":"-0.025ex"},attrs:{xmlns:"http://www.w3.org/2000/svg",width:"2.262ex",height:"1.181ex",viewBox:"0 -511 1000 522"}},[s("g",{attrs:{stroke:"currentColor",fill:"currentColor","stroke-width":"0",transform:"matrix(1 0 0 -1 0 0)"}},[s("g",{attrs:{"data-mml-node":"math"}},[s("g",{attrs:{"data-mml-node":"mo"}},[s("path",{attrs:{"data-c":"2192",d:"M56 237T56 250T70 270H835Q719 357 692 493Q692 494 692 496T691 499Q691 511 708 511H711Q720 511 723 510T729 506T732 497T735 481T743 456Q765 389 816 336T935 261Q944 258 944 250Q944 244 939 241T915 231T877 212Q836 186 806 152T761 85T740 35T732 4Q730 -6 727 -8T711 -11Q691 -11 691 0Q691 7 696 25Q728 151 835 230H70Q56 237 56 250Z"}})])])])])]),t._v(" "),s("code",[t._v("JSON_EXTRACT_PATH(TO_JSON(my_struct), '$.my_attribute')")])],1),t._v(" "),s("div",{staticClass:"custom-block warning"},[s("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),s("p",[t._v('The "arrow operators" used to access JSON objects in PostgreSQL are not supported in Ontop. Please use JSON functions instead.')])])])}),[],!1,null,null,null);e.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/52.ad24df19.js b/assets/js/52.184b92b3.js similarity index 98% rename from assets/js/52.ad24df19.js rename to assets/js/52.184b92b3.js index c0c0f340d..4a72e91fe 100644 --- a/assets/js/52.ad24df19.js +++ b/assets/js/52.184b92b3.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[52],{429:function(t,e,s){"use strict";s.r(e);var a=s(51),r=Object(a.a)({},(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"presto"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#presto"}},[t._v("#")]),t._v(" Presto")]),t._v(" "),s("p",[s("em",[t._v("Supported since 5.0.2.")])]),t._v(" "),s("p",[t._v("Through the "),s("a",{attrs:{href:"https://prestodb.io",target:"_blank",rel:"noopener"}},[t._v("Presto"),s("OutboundLink")],1),t._v(" connector, Ontop is able to construct VKGs on Presto databases.")]),t._v(" "),s("h2",{attrs:{id:"limitations-exceptions"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#limitations-exceptions"}},[t._v("#")]),t._v(" Limitations & Exceptions")]),t._v(" "),s("div",{staticClass:"custom-block warning"},[s("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),s("p",[t._v("Presto does not provide information about integrity constraints. Make sure to provide this information in order to avoid very inefficient queries.\nWe recommend using "),s("a",{attrs:{href:"/guide/advanced/lenses"}},[t._v("lenses")]),t._v(" for this purpose.")])]),t._v(" "),s("ul",[s("li",[t._v('Accessing struct fields with the "dot operator" is not supported (see below).')])]),t._v(" "),s("h2",{attrs:{id:"database-connection"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#database-connection"}},[t._v("#")]),t._v(" Database Connection")]),t._v(" "),s("p",[t._v("The following shows the content of a sample "),s("code",[t._v(".properties")]),t._v(" file that can be used to connect Ontop to Presto:")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[t._v("jdbc.url "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" jdbc:presto://localhost:8080/defaultdatabase\njdbc.user "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" user\njdbc.password "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" password\njdbc.driver "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" com.facebook.presto.jdbc.PrestoDriver\n")])])]),s("p",[t._v("In case Presto is set up without authentication, the "),s("code",[t._v("jdbc.user")]),t._v(" and "),s("code",[t._v("jdbc.password")]),t._v(" lines can also be left out.")]),t._v(" "),s("h2",{attrs:{id:"nested-type-support"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#nested-type-support"}},[t._v("#")]),t._v(" Nested Type Support")]),t._v(" "),s("p",[t._v("Ontop implements explicit compatibility with the Presto array type "),s("code",[t._v("array(t)")]),t._v(". When used with the "),s("a",{attrs:{href:"/guide/advanced/lenses#flattenlens"}},[t._v("flatten lens")]),t._v(", it is able to automatically infer the type of the result column.")]),t._v(" "),s("p",[t._v("The flatten lens cannot be used on arrays stored as JSON-encoded columns in the database. For such use cases, the column first has to be converted to an array type.")]),t._v(" "),s("h3",{attrs:{id:"struct-access"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#struct-access"}},[t._v("#")]),t._v(" Struct Access")]),t._v(" "),s("p",[t._v("In Presto, individual "),s("code",[t._v("ROW")]),t._v(' objects can be accessed by SQL expressions using the "dot operator" on the '),s("code",[t._v("ROW")]),t._v(" column. In Ontop, this feature is not currently supported.")]),t._v(" "),s("p",[t._v("Should any of their elements still be required, then a workaround can be performed by first transforming the struct into a JSON object and then accessing it using JSON functions.")]),t._v(" "),s("p",[t._v("Example:")]),t._v(" "),s("p",[s("code",[t._v("my_row.my_attribute")]),t._v(" "),s("mjx-container",{staticClass:"MathJax",attrs:{jax:"SVG"}},[s("svg",{staticStyle:{"vertical-align":"-0.025ex"},attrs:{xmlns:"http://www.w3.org/2000/svg",width:"2.262ex",height:"1.181ex",viewBox:"0 -511 1000 522"}},[s("g",{attrs:{stroke:"currentColor",fill:"currentColor","stroke-width":"0",transform:"matrix(1 0 0 -1 0 0)"}},[s("g",{attrs:{"data-mml-node":"math"}},[s("g",{attrs:{"data-mml-node":"mo"}},[s("path",{attrs:{"data-c":"2192",d:"M56 237T56 250T70 270H835Q719 357 692 493Q692 494 692 496T691 499Q691 511 708 511H711Q720 511 723 510T729 506T732 497T735 481T743 456Q765 389 816 336T935 261Q944 258 944 250Q944 244 939 241T915 231T877 212Q836 186 806 152T761 85T740 35T732 4Q730 -6 727 -8T711 -11Q691 -11 691 0Q691 7 696 25Q728 151 835 230H70Q56 237 56 250Z"}})])])])])]),t._v(" "),s("code",[t._v("JSON_EXTRACT(CAST(my_struct AS JSON), '$.my_attribute')")])],1),t._v(" "),s("p",[t._v("Elements of "),s("code",[t._v("MAP")]),t._v(" objects can be accessed using the "),s("code",[t._v("[]")]),t._v(" operator, as in")]),t._v(" "),s("div",{staticClass:"language-SQL extra-class"},[s("pre",{pre:!0,attrs:{class:"language-sql"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("SELECT")]),t._v(" my_map"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'my_attribute'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("FROM")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n")])])])])}),[],!1,null,null,null);e.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[52],{428:function(t,e,s){"use strict";s.r(e);var a=s(51),r=Object(a.a)({},(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"presto"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#presto"}},[t._v("#")]),t._v(" Presto")]),t._v(" "),s("p",[s("em",[t._v("Supported since 5.0.2.")])]),t._v(" "),s("p",[t._v("Through the "),s("a",{attrs:{href:"https://prestodb.io",target:"_blank",rel:"noopener"}},[t._v("Presto"),s("OutboundLink")],1),t._v(" connector, Ontop is able to construct VKGs on Presto databases.")]),t._v(" "),s("h2",{attrs:{id:"limitations-exceptions"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#limitations-exceptions"}},[t._v("#")]),t._v(" Limitations & Exceptions")]),t._v(" "),s("div",{staticClass:"custom-block warning"},[s("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),s("p",[t._v("Presto does not provide information about integrity constraints. Make sure to provide this information in order to avoid very inefficient queries.\nWe recommend using "),s("a",{attrs:{href:"/guide/advanced/lenses"}},[t._v("lenses")]),t._v(" for this purpose.")])]),t._v(" "),s("ul",[s("li",[t._v('Accessing struct fields with the "dot operator" is not supported (see below).')])]),t._v(" "),s("h2",{attrs:{id:"database-connection"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#database-connection"}},[t._v("#")]),t._v(" Database Connection")]),t._v(" "),s("p",[t._v("The following shows the content of a sample "),s("code",[t._v(".properties")]),t._v(" file that can be used to connect Ontop to Presto:")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[t._v("jdbc.url "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" jdbc:presto://localhost:8080/defaultdatabase\njdbc.user "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" user\njdbc.password "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" password\njdbc.driver "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" com.facebook.presto.jdbc.PrestoDriver\n")])])]),s("p",[t._v("In case Presto is set up without authentication, the "),s("code",[t._v("jdbc.user")]),t._v(" and "),s("code",[t._v("jdbc.password")]),t._v(" lines can also be left out.")]),t._v(" "),s("h2",{attrs:{id:"nested-type-support"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#nested-type-support"}},[t._v("#")]),t._v(" Nested Type Support")]),t._v(" "),s("p",[t._v("Ontop implements explicit compatibility with the Presto array type "),s("code",[t._v("array(t)")]),t._v(". When used with the "),s("a",{attrs:{href:"/guide/advanced/lenses#flattenlens"}},[t._v("flatten lens")]),t._v(", it is able to automatically infer the type of the result column.")]),t._v(" "),s("p",[t._v("The flatten lens cannot be used on arrays stored as JSON-encoded columns in the database. For such use cases, the column first has to be converted to an array type.")]),t._v(" "),s("h3",{attrs:{id:"struct-access"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#struct-access"}},[t._v("#")]),t._v(" Struct Access")]),t._v(" "),s("p",[t._v("In Presto, individual "),s("code",[t._v("ROW")]),t._v(' objects can be accessed by SQL expressions using the "dot operator" on the '),s("code",[t._v("ROW")]),t._v(" column. In Ontop, this feature is not currently supported.")]),t._v(" "),s("p",[t._v("Should any of their elements still be required, then a workaround can be performed by first transforming the struct into a JSON object and then accessing it using JSON functions.")]),t._v(" "),s("p",[t._v("Example:")]),t._v(" "),s("p",[s("code",[t._v("my_row.my_attribute")]),t._v(" "),s("mjx-container",{staticClass:"MathJax",attrs:{jax:"SVG"}},[s("svg",{staticStyle:{"vertical-align":"-0.025ex"},attrs:{xmlns:"http://www.w3.org/2000/svg",width:"2.262ex",height:"1.181ex",viewBox:"0 -511 1000 522"}},[s("g",{attrs:{stroke:"currentColor",fill:"currentColor","stroke-width":"0",transform:"matrix(1 0 0 -1 0 0)"}},[s("g",{attrs:{"data-mml-node":"math"}},[s("g",{attrs:{"data-mml-node":"mo"}},[s("path",{attrs:{"data-c":"2192",d:"M56 237T56 250T70 270H835Q719 357 692 493Q692 494 692 496T691 499Q691 511 708 511H711Q720 511 723 510T729 506T732 497T735 481T743 456Q765 389 816 336T935 261Q944 258 944 250Q944 244 939 241T915 231T877 212Q836 186 806 152T761 85T740 35T732 4Q730 -6 727 -8T711 -11Q691 -11 691 0Q691 7 696 25Q728 151 835 230H70Q56 237 56 250Z"}})])])])])]),t._v(" "),s("code",[t._v("JSON_EXTRACT(CAST(my_struct AS JSON), '$.my_attribute')")])],1),t._v(" "),s("p",[t._v("Elements of "),s("code",[t._v("MAP")]),t._v(" objects can be accessed using the "),s("code",[t._v("[]")]),t._v(" operator, as in")]),t._v(" "),s("div",{staticClass:"language-SQL extra-class"},[s("pre",{pre:!0,attrs:{class:"language-sql"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("SELECT")]),t._v(" my_map"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'my_attribute'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("FROM")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n")])])])])}),[],!1,null,null,null);e.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/53.7504f725.js b/assets/js/53.baae48e1.js similarity index 98% rename from assets/js/53.7504f725.js rename to assets/js/53.baae48e1.js index eb83bb53c..584c1d3b6 100644 --- a/assets/js/53.7504f725.js +++ b/assets/js/53.baae48e1.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[53],{430:function(t,e,s){"use strict";s.r(e);var a=s(51),o=Object(a.a)({},(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"aws-redshift"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#aws-redshift"}},[t._v("#")]),t._v(" AWS Redshift")]),t._v(" "),s("p",[s("em",[t._v("Supported since 5.0.2.")])]),t._v(" "),s("p",[t._v("Through the "),s("a",{attrs:{href:"https://aws.amazon.com/redshift/",target:"_blank",rel:"noopener"}},[t._v("Redshift"),s("OutboundLink")],1),t._v(" connector, Ontop is able to construct VKGs on AWS Redshift databases.")]),t._v(" "),s("h2",{attrs:{id:"limitations-exceptions"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#limitations-exceptions"}},[t._v("#")]),t._v(" Limitations & Exceptions")]),t._v(" "),s("div",{staticClass:"custom-block warning"},[s("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),s("p",[t._v("AWS Redshift does not provide information about integrity constraints. Make sure to provide this information in order to avoid very inefficient queries.\nWe recommend using "),s("a",{attrs:{href:"/guide/advanced/lenses"}},[t._v("lenses")]),t._v(" for this purpose.")])]),t._v(" "),s("ul",[s("li",[t._v("The Simba Redshift JDBC does not support the use of default databases when connecting to Redshift.")]),t._v(" "),s("li",[t._v("Accessing "),s("code",[t._v("SUPER")]),t._v(' object fields with the "dot operator" is not supported (see below).')])]),t._v(" "),s("h2",{attrs:{id:"database-connection"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#database-connection"}},[t._v("#")]),t._v(" Database Connection")]),t._v(" "),s("p",[t._v("The following shows the content of a sample "),s("code",[t._v(".properties")]),t._v(" file that can be used to connect Ontop to Redshift:")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[t._v("jdbc.url "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" jdbc:redshift:iam://default.dummyaccount.eu-central-1.redshift-serverless.amazonaws.com:5439/defaultdatabase\njdbc.property.AccessKeyID "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" public-access-key\njdbc.property.SecretAccessKey "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" private-access-key\njdbc.driver "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" com.amazon.redshift.jdbc42.Driver\n")])])]),s("div",{staticClass:"custom-block tip"},[s("p",{staticClass:"custom-block-title"},[t._v("NOTE")]),t._v(" "),s("p",[t._v("The AWS Redshift JDBC supports different types of authentication methods. The above "),s("code",[t._v(".property")]),t._v(" file corresponds to authentication with access keys. However, any other authentication method can be used with Ontop as well. In these cases, the corresponding connection properties have to be supplied as "),s("code",[t._v("jdbc.property.")]),t._v(" instead of the "),s("code",[t._v("AccessKeyID")]),t._v(" and "),s("code",[t._v("SecretAccessKey")]),t._v(" properties.")])]),t._v(" "),s("h2",{attrs:{id:"nested-type-support"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#nested-type-support"}},[t._v("#")]),t._v(" Nested Type Support")]),t._v(" "),s("p",[t._v("Ontop implements explicit compatibility with the Redshift type "),s("code",[t._v("SUPER")]),t._v(".")]),t._v(" "),s("p",[t._v("This type can be used with the "),s("a",{attrs:{href:"/guide/advanced/lenses#flattenlens"}},[t._v("flatten lens")]),t._v(". However, Ontop is not able to automatically infer the type of the result column.")]),t._v(" "),s("h3",{attrs:{id:"struct-access"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#struct-access"}},[t._v("#")]),t._v(" Struct Access")]),t._v(" "),s("p",[t._v("In Redshift, individual "),s("code",[t._v("SUPER")]),t._v(' struct objects can be accessed by SQL expressions using the "dot operator" on the '),s("code",[t._v("SUPER")]),t._v(" column. In Ontop, this feature is not currently supported.")]),t._v(" "),s("p",[t._v("Should any of their elements still be required, then a workaround can be performed by first transforming the struct into a JSON object and then accessing it using JSON functions.")]),t._v(" "),s("p",[t._v("Example:")]),t._v(" "),s("p",[s("code",[t._v("my_struct.my_attribute")]),t._v(" "),s("mjx-container",{staticClass:"MathJax",attrs:{jax:"SVG"}},[s("svg",{staticStyle:{"vertical-align":"-0.025ex"},attrs:{xmlns:"http://www.w3.org/2000/svg",width:"2.262ex",height:"1.181ex",viewBox:"0 -511 1000 522"}},[s("g",{attrs:{stroke:"currentColor",fill:"currentColor","stroke-width":"0",transform:"matrix(1 0 0 -1 0 0)"}},[s("g",{attrs:{"data-mml-node":"math"}},[s("g",{attrs:{"data-mml-node":"mo"}},[s("path",{attrs:{"data-c":"2192",d:"M56 237T56 250T70 270H835Q719 357 692 493Q692 494 692 496T691 499Q691 511 708 511H711Q720 511 723 510T729 506T732 497T735 481T743 456Q765 389 816 336T935 261Q944 258 944 250Q944 244 939 241T915 231T877 212Q836 186 806 152T761 85T740 35T732 4Q730 -6 727 -8T711 -11Q691 -11 691 0Q691 7 696 25Q728 151 835 230H70Q56 237 56 250Z"}})])])])])]),t._v(" "),s("code",[t._v("JSON_EXTRACT_PATH_TEXT(JSON_SERIALIZE(my_struct), 'my_attribute')")])],1)])}),[],!1,null,null,null);e.default=o.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[53],{431:function(t,e,s){"use strict";s.r(e);var a=s(51),o=Object(a.a)({},(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"aws-redshift"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#aws-redshift"}},[t._v("#")]),t._v(" AWS Redshift")]),t._v(" "),s("p",[s("em",[t._v("Supported since 5.0.2.")])]),t._v(" "),s("p",[t._v("Through the "),s("a",{attrs:{href:"https://aws.amazon.com/redshift/",target:"_blank",rel:"noopener"}},[t._v("Redshift"),s("OutboundLink")],1),t._v(" connector, Ontop is able to construct VKGs on AWS Redshift databases.")]),t._v(" "),s("h2",{attrs:{id:"limitations-exceptions"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#limitations-exceptions"}},[t._v("#")]),t._v(" Limitations & Exceptions")]),t._v(" "),s("div",{staticClass:"custom-block warning"},[s("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),s("p",[t._v("AWS Redshift does not provide information about integrity constraints. Make sure to provide this information in order to avoid very inefficient queries.\nWe recommend using "),s("a",{attrs:{href:"/guide/advanced/lenses"}},[t._v("lenses")]),t._v(" for this purpose.")])]),t._v(" "),s("ul",[s("li",[t._v("The Simba Redshift JDBC does not support the use of default databases when connecting to Redshift.")]),t._v(" "),s("li",[t._v("Accessing "),s("code",[t._v("SUPER")]),t._v(' object fields with the "dot operator" is not supported (see below).')])]),t._v(" "),s("h2",{attrs:{id:"database-connection"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#database-connection"}},[t._v("#")]),t._v(" Database Connection")]),t._v(" "),s("p",[t._v("The following shows the content of a sample "),s("code",[t._v(".properties")]),t._v(" file that can be used to connect Ontop to Redshift:")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[t._v("jdbc.url "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" jdbc:redshift:iam://default.dummyaccount.eu-central-1.redshift-serverless.amazonaws.com:5439/defaultdatabase\njdbc.property.AccessKeyID "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" public-access-key\njdbc.property.SecretAccessKey "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" private-access-key\njdbc.driver "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" com.amazon.redshift.jdbc42.Driver\n")])])]),s("div",{staticClass:"custom-block tip"},[s("p",{staticClass:"custom-block-title"},[t._v("NOTE")]),t._v(" "),s("p",[t._v("The AWS Redshift JDBC supports different types of authentication methods. The above "),s("code",[t._v(".property")]),t._v(" file corresponds to authentication with access keys. However, any other authentication method can be used with Ontop as well. In these cases, the corresponding connection properties have to be supplied as "),s("code",[t._v("jdbc.property.")]),t._v(" instead of the "),s("code",[t._v("AccessKeyID")]),t._v(" and "),s("code",[t._v("SecretAccessKey")]),t._v(" properties.")])]),t._v(" "),s("h2",{attrs:{id:"nested-type-support"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#nested-type-support"}},[t._v("#")]),t._v(" Nested Type Support")]),t._v(" "),s("p",[t._v("Ontop implements explicit compatibility with the Redshift type "),s("code",[t._v("SUPER")]),t._v(".")]),t._v(" "),s("p",[t._v("This type can be used with the "),s("a",{attrs:{href:"/guide/advanced/lenses#flattenlens"}},[t._v("flatten lens")]),t._v(". However, Ontop is not able to automatically infer the type of the result column.")]),t._v(" "),s("h3",{attrs:{id:"struct-access"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#struct-access"}},[t._v("#")]),t._v(" Struct Access")]),t._v(" "),s("p",[t._v("In Redshift, individual "),s("code",[t._v("SUPER")]),t._v(' struct objects can be accessed by SQL expressions using the "dot operator" on the '),s("code",[t._v("SUPER")]),t._v(" column. In Ontop, this feature is not currently supported.")]),t._v(" "),s("p",[t._v("Should any of their elements still be required, then a workaround can be performed by first transforming the struct into a JSON object and then accessing it using JSON functions.")]),t._v(" "),s("p",[t._v("Example:")]),t._v(" "),s("p",[s("code",[t._v("my_struct.my_attribute")]),t._v(" "),s("mjx-container",{staticClass:"MathJax",attrs:{jax:"SVG"}},[s("svg",{staticStyle:{"vertical-align":"-0.025ex"},attrs:{xmlns:"http://www.w3.org/2000/svg",width:"2.262ex",height:"1.181ex",viewBox:"0 -511 1000 522"}},[s("g",{attrs:{stroke:"currentColor",fill:"currentColor","stroke-width":"0",transform:"matrix(1 0 0 -1 0 0)"}},[s("g",{attrs:{"data-mml-node":"math"}},[s("g",{attrs:{"data-mml-node":"mo"}},[s("path",{attrs:{"data-c":"2192",d:"M56 237T56 250T70 270H835Q719 357 692 493Q692 494 692 496T691 499Q691 511 708 511H711Q720 511 723 510T729 506T732 497T735 481T743 456Q765 389 816 336T935 261Q944 258 944 250Q944 244 939 241T915 231T877 212Q836 186 806 152T761 85T740 35T732 4Q730 -6 727 -8T711 -11Q691 -11 691 0Q691 7 696 25Q728 151 835 230H70Q56 237 56 250Z"}})])])])])]),t._v(" "),s("code",[t._v("JSON_EXTRACT_PATH_TEXT(JSON_SERIALIZE(my_struct), 'my_attribute')")])],1)])}),[],!1,null,null,null);e.default=o.exports}}]); \ No newline at end of file diff --git a/assets/js/54.fc0ed059.js b/assets/js/54.ea19806d.js similarity index 98% rename from assets/js/54.fc0ed059.js rename to assets/js/54.ea19806d.js index 01cc5f473..ae408fb07 100644 --- a/assets/js/54.fc0ed059.js +++ b/assets/js/54.ea19806d.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[54],{431:function(e,t,s){"use strict";s.r(t);var a=s(51),o=Object(a.a)({},(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[s("h1",{attrs:{id:"snowflake"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#snowflake"}},[e._v("#")]),e._v(" Snowflake")]),e._v(" "),s("p",[s("em",[e._v("Supported since 5.0.0.")])]),e._v(" "),s("p",[e._v("Through the "),s("a",{attrs:{href:"https://snowflake.com",target:"_blank",rel:"noopener"}},[e._v("Snowflake"),s("OutboundLink")],1),e._v(" connector, Ontop is able to construct VKGs on cloud-based Snowflake databases.")]),e._v(" "),s("h2",{attrs:{id:"limitations-exceptions"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#limitations-exceptions"}},[e._v("#")]),e._v(" Limitations & Exceptions")]),e._v(" "),s("div",{staticClass:"custom-block warning"},[s("p",{staticClass:"custom-block-title"},[e._v("WARNING")]),e._v(" "),s("p",[e._v("Integrity constraints are often missing in Snowflake. Make sure to specify the missing ones in order to avoid very inefficient queries.\nWe recommend using "),s("a",{attrs:{href:"/guide/advanced/lenses"}},[e._v("lenses")]),e._v(" for this purpose.")])]),e._v(" "),s("ul",[s("li",[e._v("Due to an issue in the JDBC, quotation marks cannot always be used when defining an alias. Because of this, it is recommended to choose column names without special characters where possible.")]),e._v(" "),s("li",[e._v('Accessing struct fields with the "colon operator" is not supported (see below).')])]),e._v(" "),s("h2",{attrs:{id:"database-connection"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#database-connection"}},[e._v("#")]),e._v(" Database Connection")]),e._v(" "),s("p",[e._v("The following shows the content of a sample "),s("code",[e._v(".properties")]),e._v(" file that can be used to connect Ontop to Snowflake:")]),e._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[e._v("jdbc.url "),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" jdbc:snowflake://dummyuser.snowflakecomputing.com/?warehouse"),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v("dummywarehouse"),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v("&")]),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("db")]),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v("dummydb"),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v("&")]),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("schema")]),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v("dummyschema\njdbc.user "),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" user\njdbc.password "),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" password\njdbc.driver "),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" net.snowflake.client.jdbc.SnowflakeDriver\n")])])]),s("h2",{attrs:{id:"nested-type-support"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#nested-type-support"}},[e._v("#")]),e._v(" Nested Type Support")]),e._v(" "),s("p",[e._v("Ontop implements explicit compatibility with the "),s("code",[e._v("ARRAY")]),e._v(" type, which can be used with the "),s("a",{attrs:{href:"/guide/advanced/lenses#flattenlens"}},[e._v("flatten lens")]),e._v(". However, it is not able to automatically infer the type of the resulting column.")]),e._v(" "),s("div",{staticClass:"custom-block warning"},[s("p",{staticClass:"custom-block-title"},[e._v("WARNING")]),e._v(" "),s("p",[e._v("Due to an issue mentioned above, using special characters inside the "),s("code",[e._v("output")]),e._v(" and "),s("code",[e._v("position")]),e._v(" fields of the flatten lens for Snowflake will fail. Furthermore, these fields will always be case-insensitive.")])]),e._v(" "),s("h3",{attrs:{id:"struct-access"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#struct-access"}},[e._v("#")]),e._v(" Struct Access")]),e._v(" "),s("p",[e._v("Individual object fields can be accessed by SQL expressions in the dialect's default way:")]),e._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("SELECT my_object['my_field'] FROM ...\n")])])]),s("div",{staticClass:"custom-block warning"},[s("p",{staticClass:"custom-block-title"},[e._v("WARNING")]),e._v(" "),s("p",[e._v('Accessing object fields using the "colon operator" is not supported. Please use the '),s("code",[e._v("[]")]),e._v(" operator instead.")])])])}),[],!1,null,null,null);t.default=o.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[54],{430:function(e,t,s){"use strict";s.r(t);var a=s(51),o=Object(a.a)({},(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[s("h1",{attrs:{id:"snowflake"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#snowflake"}},[e._v("#")]),e._v(" Snowflake")]),e._v(" "),s("p",[s("em",[e._v("Supported since 5.0.0.")])]),e._v(" "),s("p",[e._v("Through the "),s("a",{attrs:{href:"https://snowflake.com",target:"_blank",rel:"noopener"}},[e._v("Snowflake"),s("OutboundLink")],1),e._v(" connector, Ontop is able to construct VKGs on cloud-based Snowflake databases.")]),e._v(" "),s("h2",{attrs:{id:"limitations-exceptions"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#limitations-exceptions"}},[e._v("#")]),e._v(" Limitations & Exceptions")]),e._v(" "),s("div",{staticClass:"custom-block warning"},[s("p",{staticClass:"custom-block-title"},[e._v("WARNING")]),e._v(" "),s("p",[e._v("Integrity constraints are often missing in Snowflake. Make sure to specify the missing ones in order to avoid very inefficient queries.\nWe recommend using "),s("a",{attrs:{href:"/guide/advanced/lenses"}},[e._v("lenses")]),e._v(" for this purpose.")])]),e._v(" "),s("ul",[s("li",[e._v("Due to an issue in the JDBC, quotation marks cannot always be used when defining an alias. Because of this, it is recommended to choose column names without special characters where possible.")]),e._v(" "),s("li",[e._v('Accessing struct fields with the "colon operator" is not supported (see below).')])]),e._v(" "),s("h2",{attrs:{id:"database-connection"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#database-connection"}},[e._v("#")]),e._v(" Database Connection")]),e._v(" "),s("p",[e._v("The following shows the content of a sample "),s("code",[e._v(".properties")]),e._v(" file that can be used to connect Ontop to Snowflake:")]),e._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[e._v("jdbc.url "),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" jdbc:snowflake://dummyuser.snowflakecomputing.com/?warehouse"),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v("dummywarehouse"),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v("&")]),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("db")]),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v("dummydb"),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v("&")]),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[e._v("schema")]),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v("dummyschema\njdbc.user "),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" user\njdbc.password "),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" password\njdbc.driver "),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v("=")]),e._v(" net.snowflake.client.jdbc.SnowflakeDriver\n")])])]),s("h2",{attrs:{id:"nested-type-support"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#nested-type-support"}},[e._v("#")]),e._v(" Nested Type Support")]),e._v(" "),s("p",[e._v("Ontop implements explicit compatibility with the "),s("code",[e._v("ARRAY")]),e._v(" type, which can be used with the "),s("a",{attrs:{href:"/guide/advanced/lenses#flattenlens"}},[e._v("flatten lens")]),e._v(". However, it is not able to automatically infer the type of the resulting column.")]),e._v(" "),s("div",{staticClass:"custom-block warning"},[s("p",{staticClass:"custom-block-title"},[e._v("WARNING")]),e._v(" "),s("p",[e._v("Due to an issue mentioned above, using special characters inside the "),s("code",[e._v("output")]),e._v(" and "),s("code",[e._v("position")]),e._v(" fields of the flatten lens for Snowflake will fail. Furthermore, these fields will always be case-insensitive.")])]),e._v(" "),s("h3",{attrs:{id:"struct-access"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#struct-access"}},[e._v("#")]),e._v(" Struct Access")]),e._v(" "),s("p",[e._v("Individual object fields can be accessed by SQL expressions in the dialect's default way:")]),e._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("SELECT my_object['my_field'] FROM ...\n")])])]),s("div",{staticClass:"custom-block warning"},[s("p",{staticClass:"custom-block-title"},[e._v("WARNING")]),e._v(" "),s("p",[e._v('Accessing object fields using the "colon operator" is not supported. Please use the '),s("code",[e._v("[]")]),e._v(" operator instead.")])])])}),[],!1,null,null,null);t.default=o.exports}}]); \ No newline at end of file diff --git a/assets/js/57.4fb596f2.js b/assets/js/57.a635467f.js similarity index 91% rename from assets/js/57.4fb596f2.js rename to assets/js/57.a635467f.js index 8a3212f6c..dee5265d5 100644 --- a/assets/js/57.4fb596f2.js +++ b/assets/js/57.a635467f.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[57],{435:function(t,s,a){"use strict";a.r(s);var r=a(51),e=Object(r.a)({},(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"data-sources"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#data-sources"}},[t._v("#")]),t._v(" Data sources")]),t._v(" "),a("h2",{attrs:{id:"postgresql"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#postgresql"}},[t._v("#")]),t._v(" PostgreSQL")]),t._v(" "),a("div",{staticClass:"custom-block warning"},[a("p",{staticClass:"custom-block-title"},[t._v("DOUBLE-CHECK restrictions")]),t._v(" "),a("p",[t._v("SIMILAR TO (not parsed by JSQLParser)")])])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[57],{434:function(t,s,a){"use strict";a.r(s);var r=a(51),e=Object(r.a)({},(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"data-sources"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#data-sources"}},[t._v("#")]),t._v(" Data sources")]),t._v(" "),a("h2",{attrs:{id:"postgresql"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#postgresql"}},[t._v("#")]),t._v(" PostgreSQL")]),t._v(" "),a("div",{staticClass:"custom-block warning"},[a("p",{staticClass:"custom-block-title"},[t._v("DOUBLE-CHECK restrictions")]),t._v(" "),a("p",[t._v("SIMILAR TO (not parsed by JSQLParser)")])])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/58.57f1759b.js b/assets/js/58.5d967bf0.js similarity index 98% rename from assets/js/58.57f1759b.js rename to assets/js/58.5d967bf0.js index c7b8d4e01..9c6a2d768 100644 --- a/assets/js/58.57f1759b.js +++ b/assets/js/58.5d967bf0.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[58],{434:function(t,e,o){"use strict";o.r(e);var a=o(51),n=Object(a.a)({},(function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[o("h1",{attrs:{id:"getting-started"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#getting-started"}},[t._v("#")]),t._v(" Getting started")]),t._v(" "),o("h2",{attrs:{id:"tutorial"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#tutorial"}},[t._v("#")]),t._v(" Tutorial")]),t._v(" "),o("p",[t._v("If you are new to Ontop and Virtual Knowledge Graphs, we encourage you to have a look "),o("a",{attrs:{href:"/tutorial"}},[t._v("at the official tutorial")]),t._v(".")]),t._v(" "),o("h2",{attrs:{id:"using-ontop"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#using-ontop"}},[t._v("#")]),t._v(" Using Ontop")]),t._v(" "),o("p",[t._v("Ontop is distributed under various forms. They can be downloaded on "),o("a",{attrs:{href:"https://github.com/ontop/ontop/releases",target:"_blank",rel:"noopener"}},[t._v("Github"),o("OutboundLink")],1),t._v(", "),o("a",{attrs:{href:"https://hub.docker.com/r/ontop/ontop",target:"_blank",rel:"noopener"}},[t._v("Docker Hub"),o("OutboundLink")],1),t._v(", "),o("a",{attrs:{href:"http://sourceforge.net/projects/ontop4obda/files/",target:"_blank",rel:"noopener"}},[t._v("Sourceforge"),o("OutboundLink")],1),t._v(" and in the Protégé plugin repository.")]),t._v(" "),o("h3",{attrs:{id:"mapping-designer"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#mapping-designer"}},[t._v("#")]),t._v(" Mapping designer")]),t._v(" "),o("p",[t._v("For editing and testing your mappings, you can use our plugin of the "),o("a",{attrs:{href:"https://protege.stanford.edu/",target:"_blank",rel:"noopener"}},[t._v("Protégé ontology editor"),o("OutboundLink")],1),t._v(". You can download the latest stable release directly from Protégé. Alternatively, pre-releases can be found on "),o("a",{attrs:{href:"https://github.com/ontop/ontop/releases",target:"_blank",rel:"noopener"}},[t._v("Github"),o("OutboundLink")],1),t._v(" and "),o("a",{attrs:{href:"http://sourceforge.net/projects/ontop4obda/files/",target:"_blank",rel:"noopener"}},[t._v("Sourceforge"),o("OutboundLink")],1),t._v(".")]),t._v(" "),o("div",{staticClass:"custom-block warning"},[o("p",{staticClass:"custom-block-title"},[t._v("Limited support of advanced features")]),t._v(" "),o("p",[t._v("In particular, the Protégé plugin doesn't support "),o("a",{attrs:{href:"/guide/advanced/lenses"}},[t._v("lenses")]),t._v(". For advanced usage, we recommend using text editors or considering commercial offerings.")])]),t._v(" "),o("h3",{attrs:{id:"deployment"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#deployment"}},[t._v("#")]),t._v(" Deployment")]),t._v(" "),o("p",[t._v("Once your mappings and your ontology are ready, you can deploy your VKG as a SPARQL endpoint. The Ontop endpoint is available both as a "),o("a",{attrs:{href:"/guide/cli#ontop-endpoint"}},[t._v("CLI command ("),o("code",[t._v("ontop endpoint")]),t._v(")")]),t._v(" and as a "),o("a",{attrs:{href:"https://hub.docker.com/r/ontop/ontop",target:"_blank",rel:"noopener"}},[t._v("Docker image"),o("OutboundLink")],1),t._v(".")]),t._v(" "),o("p",[t._v("You can also use the Ontop endpoint during development as it embeds "),o("a",{attrs:{href:"https://about.yasgui.org/",target:"_blank",rel:"noopener"}},[t._v("a nice YASGUI client"),o("OutboundLink")],1),t._v(" and an optional portal (since 4.0-beta-1) containing pre-defined queries.")]),t._v(" "),o("h3",{attrs:{id:"command-line-interface"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#command-line-interface"}},[t._v("#")]),t._v(" Command Line Interface")]),t._v(" "),o("p",[t._v("Want to materialize your VKG, convert your mappings into R2RML, bootstrap your mappings or start a SPARQL endpoint? You can use "),o("a",{attrs:{href:"/guide/cli"}},[t._v("the CLI")]),t._v(" for that. It can be found on on "),o("a",{attrs:{href:"https://github.com/ontop/ontop/releases",target:"_blank",rel:"noopener"}},[t._v("Github"),o("OutboundLink")],1),t._v(" and "),o("a",{attrs:{href:"http://sourceforge.net/projects/ontop4obda/files/",target:"_blank",rel:"noopener"}},[t._v("Sourceforge"),o("OutboundLink")],1),t._v(".")]),t._v(" "),o("h3",{attrs:{id:"former-solutions"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#former-solutions"}},[t._v("#")]),t._v(" Former solutions")]),t._v(" "),o("p",[t._v("Historically, Ontop has been made available under other means that we don't recommend anymore.")]),t._v(" "),o("h4",{attrs:{id:"java-api-not-recommended"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#java-api-not-recommended"}},[t._v("#")]),t._v(" Java API (not recommended)")]),t._v(" "),o("p",[t._v("It remains possible to use Ontop as a Java API through "),o("a",{attrs:{href:"https://rdf4j.org/",target:"_blank",rel:"noopener"}},[t._v("RDF4J"),o("OutboundLink")],1),t._v(" although we recommend the HTTP SPARQL endpoint as a first option (think of a microservice). Why? Because such a Java API would add many dependencies to your project and constraint you to use certain versions of Java.")]),t._v(" "),o("p",[t._v("Ontop-rdf4j is available on "),o("a",{attrs:{href:"https://search.maven.org/artifact/it.unibz.inf.ontop/ontop-rdf4j",target:"_blank",rel:"noopener"}},[t._v("Maven Central"),o("OutboundLink")],1),t._v(".")])])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[58],{435:function(t,e,o){"use strict";o.r(e);var a=o(51),n=Object(a.a)({},(function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[o("h1",{attrs:{id:"getting-started"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#getting-started"}},[t._v("#")]),t._v(" Getting started")]),t._v(" "),o("h2",{attrs:{id:"tutorial"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#tutorial"}},[t._v("#")]),t._v(" Tutorial")]),t._v(" "),o("p",[t._v("If you are new to Ontop and Virtual Knowledge Graphs, we encourage you to have a look "),o("a",{attrs:{href:"/tutorial"}},[t._v("at the official tutorial")]),t._v(".")]),t._v(" "),o("h2",{attrs:{id:"using-ontop"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#using-ontop"}},[t._v("#")]),t._v(" Using Ontop")]),t._v(" "),o("p",[t._v("Ontop is distributed under various forms. They can be downloaded on "),o("a",{attrs:{href:"https://github.com/ontop/ontop/releases",target:"_blank",rel:"noopener"}},[t._v("Github"),o("OutboundLink")],1),t._v(", "),o("a",{attrs:{href:"https://hub.docker.com/r/ontop/ontop",target:"_blank",rel:"noopener"}},[t._v("Docker Hub"),o("OutboundLink")],1),t._v(", "),o("a",{attrs:{href:"http://sourceforge.net/projects/ontop4obda/files/",target:"_blank",rel:"noopener"}},[t._v("Sourceforge"),o("OutboundLink")],1),t._v(" and in the Protégé plugin repository.")]),t._v(" "),o("h3",{attrs:{id:"mapping-designer"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#mapping-designer"}},[t._v("#")]),t._v(" Mapping designer")]),t._v(" "),o("p",[t._v("For editing and testing your mappings, you can use our plugin of the "),o("a",{attrs:{href:"https://protege.stanford.edu/",target:"_blank",rel:"noopener"}},[t._v("Protégé ontology editor"),o("OutboundLink")],1),t._v(". You can download the latest stable release directly from Protégé. Alternatively, pre-releases can be found on "),o("a",{attrs:{href:"https://github.com/ontop/ontop/releases",target:"_blank",rel:"noopener"}},[t._v("Github"),o("OutboundLink")],1),t._v(" and "),o("a",{attrs:{href:"http://sourceforge.net/projects/ontop4obda/files/",target:"_blank",rel:"noopener"}},[t._v("Sourceforge"),o("OutboundLink")],1),t._v(".")]),t._v(" "),o("div",{staticClass:"custom-block warning"},[o("p",{staticClass:"custom-block-title"},[t._v("Limited support of advanced features")]),t._v(" "),o("p",[t._v("In particular, the Protégé plugin doesn't support "),o("a",{attrs:{href:"/guide/advanced/lenses"}},[t._v("lenses")]),t._v(". For advanced usage, we recommend using text editors or considering commercial offerings.")])]),t._v(" "),o("h3",{attrs:{id:"deployment"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#deployment"}},[t._v("#")]),t._v(" Deployment")]),t._v(" "),o("p",[t._v("Once your mappings and your ontology are ready, you can deploy your VKG as a SPARQL endpoint. The Ontop endpoint is available both as a "),o("a",{attrs:{href:"/guide/cli#ontop-endpoint"}},[t._v("CLI command ("),o("code",[t._v("ontop endpoint")]),t._v(")")]),t._v(" and as a "),o("a",{attrs:{href:"https://hub.docker.com/r/ontop/ontop",target:"_blank",rel:"noopener"}},[t._v("Docker image"),o("OutboundLink")],1),t._v(".")]),t._v(" "),o("p",[t._v("You can also use the Ontop endpoint during development as it embeds "),o("a",{attrs:{href:"https://about.yasgui.org/",target:"_blank",rel:"noopener"}},[t._v("a nice YASGUI client"),o("OutboundLink")],1),t._v(" and an optional portal (since 4.0-beta-1) containing pre-defined queries.")]),t._v(" "),o("h3",{attrs:{id:"command-line-interface"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#command-line-interface"}},[t._v("#")]),t._v(" Command Line Interface")]),t._v(" "),o("p",[t._v("Want to materialize your VKG, convert your mappings into R2RML, bootstrap your mappings or start a SPARQL endpoint? You can use "),o("a",{attrs:{href:"/guide/cli"}},[t._v("the CLI")]),t._v(" for that. It can be found on on "),o("a",{attrs:{href:"https://github.com/ontop/ontop/releases",target:"_blank",rel:"noopener"}},[t._v("Github"),o("OutboundLink")],1),t._v(" and "),o("a",{attrs:{href:"http://sourceforge.net/projects/ontop4obda/files/",target:"_blank",rel:"noopener"}},[t._v("Sourceforge"),o("OutboundLink")],1),t._v(".")]),t._v(" "),o("h3",{attrs:{id:"former-solutions"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#former-solutions"}},[t._v("#")]),t._v(" Former solutions")]),t._v(" "),o("p",[t._v("Historically, Ontop has been made available under other means that we don't recommend anymore.")]),t._v(" "),o("h4",{attrs:{id:"java-api-not-recommended"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#java-api-not-recommended"}},[t._v("#")]),t._v(" Java API (not recommended)")]),t._v(" "),o("p",[t._v("It remains possible to use Ontop as a Java API through "),o("a",{attrs:{href:"https://rdf4j.org/",target:"_blank",rel:"noopener"}},[t._v("RDF4J"),o("OutboundLink")],1),t._v(" although we recommend the HTTP SPARQL endpoint as a first option (think of a microservice). Why? Because such a Java API would add many dependencies to your project and constraint you to use certain versions of Java.")]),t._v(" "),o("p",[t._v("Ontop-rdf4j is available on "),o("a",{attrs:{href:"https://search.maven.org/artifact/it.unibz.inf.ontop/ontop-rdf4j",target:"_blank",rel:"noopener"}},[t._v("Maven Central"),o("OutboundLink")],1),t._v(".")])])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/60.f7b866f9.js b/assets/js/60.2cdda51b.js similarity index 86% rename from assets/js/60.f7b866f9.js rename to assets/js/60.2cdda51b.js index dc0026705..437da6fb3 100644 --- a/assets/js/60.f7b866f9.js +++ b/assets/js/60.2cdda51b.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[60],{437:function(t,a,i){"use strict";i.r(a);var e=i(51),s=Object(e.a)({},(function(){var t=this.$createElement,a=this._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":this.$parent.slotKey}},[a("h1",{attrs:{id:"materialization"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#materialization"}},[this._v("#")]),this._v(" Materialization")])])}),[],!1,null,null,null);a.default=s.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[60],{438:function(t,a,i){"use strict";i.r(a);var e=i(51),s=Object(e.a)({},(function(){var t=this.$createElement,a=this._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":this.$parent.slotKey}},[a("h1",{attrs:{id:"materialization"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#materialization"}},[this._v("#")]),this._v(" Materialization")])])}),[],!1,null,null,null);a.default=s.exports}}]); \ No newline at end of file diff --git a/assets/js/61.e93e67cb.js b/assets/js/61.74e48afb.js similarity index 99% rename from assets/js/61.e93e67cb.js rename to assets/js/61.74e48afb.js index 43e42f917..533d286b4 100644 --- a/assets/js/61.e93e67cb.js +++ b/assets/js/61.74e48afb.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[61],{438:function(e,t,a){"use strict";a.r(t);var n=a(51),i=Object(n.a)({},(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[a("h1",{attrs:{id:"release-notes"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#release-notes"}},[e._v("#")]),e._v(" Release notes")]),e._v(" "),a("h2",{attrs:{id:"_5-1-1-november-22-2023"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-1-1-november-22-2023"}},[e._v("#")]),e._v(" 5.1.1 (November 22, 2023)")]),e._v(" "),a("h4",{attrs:{id:"new-features"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#new-features"}},[e._v("#")]),e._v(" New features")]),e._v(" "),a("ul",[a("li",[e._v("Option to expose system tables added "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/744",target:"_blank",rel:"noopener"}},[e._v("#744"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Standard deviation and variance functions added "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/735",target:"_blank",rel:"noopener"}},[e._v("#735"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Option to disable the registration of custom SPARQL aggregation functions "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/746",target:"_blank",rel:"noopener"}},[e._v("#746"),a("OutboundLink")],1)])]),e._v(" "),a("h4",{attrs:{id:"bug-fixes"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#bug-fixes"}},[e._v("#")]),e._v(" Bug fixes")]),e._v(" "),a("p",[e._v("See "),a("a",{attrs:{href:"https://github.com/ontop/ontop/milestone/23?closed=1",target:"_blank",rel:"noopener"}},[e._v("https://github.com/ontop/ontop/milestone/23?closed=1"),a("OutboundLink")],1)]),e._v(" "),a("h2",{attrs:{id:"_5-1-0-august-15-2023"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-1-0-august-15-2023"}},[e._v("#")]),e._v(" 5.1.0 (August 15, 2023)")]),e._v(" "),a("h4",{attrs:{id:"new-features-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#new-features-2"}},[e._v("#")]),e._v(" New features")]),e._v(" "),a("ul",[a("li",[e._v("Support for "),a("RouterLink",{attrs:{to:"/guide/advanced/lenses.html#flattenlens"}},[e._v("flatten lenses")]),e._v(" added "),a("em",[e._v("(beta)")]),e._v(" "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/622",target:"_blank",rel:"noopener"}},[e._v("#622"),a("OutboundLink")],1),e._v(", "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/625",target:"_blank",rel:"noopener"}},[e._v("#625"),a("OutboundLink")],1),e._v(", "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/628",target:"_blank",rel:"noopener"}},[e._v("#628"),a("OutboundLink")],1),e._v(", "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/629",target:"_blank",rel:"noopener"}},[e._v("#629"),a("OutboundLink")],1),e._v(", "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/633",target:"_blank",rel:"noopener"}},[e._v("#633"),a("OutboundLink")],1),e._v(", "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/635",target:"_blank",rel:"noopener"}},[e._v("#635"),a("OutboundLink")],1),e._v(", "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/636",target:"_blank",rel:"noopener"}},[e._v("#636"),a("OutboundLink")],1),e._v(", "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/637",target:"_blank",rel:"noopener"}},[e._v("#637"),a("OutboundLink")],1),e._v(", "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/638",target:"_blank",rel:"noopener"}},[e._v("#638"),a("OutboundLink")],1),e._v(", "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/639",target:"_blank",rel:"noopener"}},[e._v("#639"),a("OutboundLink")],1),e._v(", "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/640",target:"_blank",rel:"noopener"}},[e._v("#640"),a("OutboundLink")],1),e._v(", "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/641",target:"_blank",rel:"noopener"}},[e._v("#641"),a("OutboundLink")],1),e._v(", "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/642",target:"_blank",rel:"noopener"}},[e._v("#642"),a("OutboundLink")],1),e._v(", "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/643",target:"_blank",rel:"noopener"}},[e._v("#643"),a("OutboundLink")],1),e._v(", "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/661",target:"_blank",rel:"noopener"}},[e._v("#661"),a("OutboundLink")],1),e._v(", "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/715",target:"_blank",rel:"noopener"}},[e._v("#715"),a("OutboundLink")],1)],1),e._v(" "),a("li",[e._v("Support for "),a("RouterLink",{attrs:{to:"/guide/advanced/lenses.html#unionlens"}},[e._v("union lenses")]),e._v(" added "),a("em",[e._v("(beta)")]),e._v(" "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/612",target:"_blank",rel:"noopener"}},[e._v("#612"),a("OutboundLink")],1)],1),e._v(" "),a("li",[e._v("Support for XSD cast functions added "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/630",target:"_blank",rel:"noopener"}},[e._v("#630"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Support for date-trunc and more date extraction functions added "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/705",target:"_blank",rel:"noopener"}},[e._v("#705"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Support for a separate RDF file for facts added "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/666",target:"_blank",rel:"noopener"}},[e._v("#666"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Options to ignore invalid mapping entries "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/631",target:"_blank",rel:"noopener"}},[e._v("#631"),a("OutboundLink")],1),e._v(" and lenses "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/709",target:"_blank",rel:"noopener"}},[e._v("#709"),a("OutboundLink")],1),e._v(" added")]),e._v(" "),a("li",[e._v("Partial support for regular expressions in SQL Server added "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/702",target:"_blank",rel:"noopener"}},[e._v("#702"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Support for DynamoDB using the CData connector added "),a("em",[e._v("(beta)")]),e._v(" "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/693",target:"_blank",rel:"noopener"}},[e._v("#693"),a("OutboundLink")],1)])]),e._v(" "),a("h4",{attrs:{id:"optimizations"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#optimizations"}},[e._v("#")]),e._v(" Optimizations")]),e._v(" "),a("ul",[a("li",[e._v("Upwards propagation of lens unique constraints added "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/668",target:"_blank",rel:"noopener"}},[e._v("#668"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Left join optimizations:\n"),a("ul",[a("li",[e._v("Reducing left joins to inner joins when the right child has a left join "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/662",target:"_blank",rel:"noopener"}},[e._v("#662"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Merging left joins nested on the left "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/663",target:"_blank",rel:"noopener"}},[e._v("#663"),a("OutboundLink")],1),e._v(", "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/686",target:"_blank",rel:"noopener"}},[e._v("#686"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Robustness to nullable joining columns "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/667",target:"_blank",rel:"noopener"}},[e._v("#667"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Pruning the right of a left join when not contributing")])])]),e._v(" "),a("li",[e._v("VALUES node decomposition added "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/680",target:"_blank",rel:"noopener"}},[e._v("#680"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Functional dependency inference added "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/681",target:"_blank",rel:"noopener"}},[e._v("#681"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Reduction of aggregation nodes with no aggregation functional terms to distinct added")]),e._v(" "),a("li",[e._v("Transitive closure of functional dependencies added "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/732",target:"_blank",rel:"noopener"}},[e._v("#732"),a("OutboundLink")],1)])]),e._v(" "),a("h4",{attrs:{id:"refactoring"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#refactoring"}},[e._v("#")]),e._v(" Refactoring")]),e._v(" "),a("ul",[a("li",[e._v("Substitutions refactored "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/616",target:"_blank",rel:"noopener"}},[e._v("#616"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Typing for math operators added "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/706",target:"_blank",rel:"noopener"}},[e._v("#706"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("QuotedIDFactory refactored "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/644",target:"_blank",rel:"noopener"}},[e._v("#644"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Removal of non-required variables improved "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/669",target:"_blank",rel:"noopener"}},[e._v("#669"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Support for the STRING datatype for DuckDB added "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/646",target:"_blank",rel:"noopener"}},[e._v("#646"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Support for SAMPLE at the database level added "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/660",target:"_blank",rel:"noopener"}},[e._v("#660"),a("OutboundLink")],1)])]),e._v(" "),a("h4",{attrs:{id:"bug-fixes-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#bug-fixes-2"}},[e._v("#")]),e._v(" Bug fixes")]),e._v(" "),a("ul",[a("li",[e._v("Support LIMIT/OFFSET in SQL Server improved "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/676",target:"_blank",rel:"noopener"}},[e._v("#676"),a("OutboundLink")],1),e._v(", "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/679",target:"_blank",rel:"noopener"}},[e._v("#679"),a("OutboundLink")],1),e._v(", "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/682",target:"_blank",rel:"noopener"}},[e._v("#682"),a("OutboundLink")],1),e._v(", "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/721",target:"_blank",rel:"noopener"}},[e._v("#721"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Extraction of unique constraints in Oracle made more consistent "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/695",target:"_blank",rel:"noopener"}},[e._v("#695"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Metadata extraction for DuckDB made more robust "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/687",target:"_blank",rel:"noopener"}},[e._v("#687"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Missing casts when using Bnode templates added "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/657",target:"_blank",rel:"noopener"}},[e._v("#657"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Invalid SPARQL UNION translation fixed "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/651",target:"_blank",rel:"noopener"}},[e._v("#651"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Empty results for CONSTRUCT queries with unions and different variables fixed "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/652",target:"_blank",rel:"noopener"}},[e._v("#652"),a("OutboundLink")],1)])]),e._v(" "),a("h4",{attrs:{id:"documentation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#documentation"}},[e._v("#")]),e._v(" Documentation")]),e._v(" "),a("ul",[a("li",[e._v("Dedicated pages for each supported database (for instance "),a("a",{attrs:{href:"https://ontop-vkg.org/guide/databases/athena",target:"_blank",rel:"noopener"}},[e._v("AWS Athena"),a("OutboundLink")],1),e._v(")")]),e._v(" "),a("li",[a("RouterLink",{attrs:{to:"/tutorial/lenses/"}},[e._v("Tutorial about lenses")])],1),e._v(" "),a("li",[a("a",{attrs:{href:"/tutorial/materialization/materialization"}},[e._v("Tutorial about materialization")])])]),e._v(" "),a("h2",{attrs:{id:"_5-0-2-march-9-2023"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-0-2-march-9-2023"}},[e._v("#")]),e._v(" 5.0.2 (March 9, 2023)")]),e._v(" "),a("h4",{attrs:{id:"new-features-3"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#new-features-3"}},[e._v("#")]),e._v(" New features")]),e._v(" "),a("ul",[a("li",[e._v("Support for Trino "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/599",target:"_blank",rel:"noopener"}},[e._v("#599"),a("OutboundLink")],1),e._v(", PrestoDB "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/601",target:"_blank",rel:"noopener"}},[e._v("#601"),a("OutboundLink")],1),e._v(", AWS Athena "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/602",target:"_blank",rel:"noopener"}},[e._v("#602"),a("OutboundLink")],1),e._v(", DuckDB "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/604",target:"_blank",rel:"noopener"}},[e._v("#604"),a("OutboundLink")],1),e._v(", AWS Redshift "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/605",target:"_blank",rel:"noopener"}},[e._v("#605"),a("OutboundLink")],1),e._v(" and Google BigQuery "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/615",target:"_blank",rel:"noopener"}},[e._v("#615"),a("OutboundLink")],1),e._v(" added")]),e._v(" "),a("li",[e._v("Declare some columns as IRI-safe in lenses "),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/587",target:"_blank",rel:"noopener"}},[e._v("#587"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Support for arbitrary JDBC properties added "),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/606",target:"_blank",rel:"noopener"}},[e._v("#606"),a("OutboundLink")],1)])]),e._v(" "),a("h4",{attrs:{id:"bugfixes"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#bugfixes"}},[e._v("#")]),e._v(" Bugfixes")]),e._v(" "),a("ul",[a("li",[e._v("Missing TLS cypher suite JRE modules added to the Docker image")]),e._v(" "),a("li",[e._v("More system schemas are now ignored in Oracle "),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/591",target:"_blank",rel:"noopener"}},[e._v("#591"),a("OutboundLink")],1)])]),e._v(" "),a("h4",{attrs:{id:"tooling"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#tooling"}},[e._v("#")]),e._v(" Tooling")]),e._v(" "),a("ul",[a("li",[a("a",{attrs:{href:"https://github.com/ontop/dialect-factory-scaffolding",target:"_blank",rel:"noopener"}},[e._v("Scaffolding tool"),a("OutboundLink")],1),e._v(" created to make it easier to implement a new SQL dialect adapter.")])]),e._v(" "),a("h2",{attrs:{id:"_5-0-1-january-29-2023"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-0-1-january-29-2023"}},[e._v("#")]),e._v(" 5.0.1 (January 29, 2023)")]),e._v(" "),a("h4",{attrs:{id:"new-feature"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#new-feature"}},[e._v("#")]),e._v(" New feature")]),e._v(" "),a("ul",[a("li",[e._v("DB metadata extraction for MS Access added "),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/589",target:"_blank",rel:"noopener"}},[e._v("#589"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("JRE-embedded Ontop-Protégé bundles with Protégé-5.6.0-beta-2 are now provided")])]),e._v(" "),a("h4",{attrs:{id:"refactoring-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#refactoring-2"}},[e._v("#")]),e._v(" Refactoring")]),e._v(" "),a("ul",[a("li",[e._v("Support for Spark SQL improved and tests added in the CI")]),e._v(" "),a("li",[e._v("All the tables (besides excluded ones) in Oracle are now extracted, not just the user's ones")])]),e._v(" "),a("p",[e._v("Several dependencies updated.")]),e._v(" "),a("h2",{attrs:{id:"_5-0-0-december-31-2022"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-0-0-december-31-2022"}},[e._v("#")]),e._v(" 5.0.0 (December 31, 2022)")]),e._v(" "),a("h4",{attrs:{id:"important-changes"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#important-changes"}},[e._v("#")]),e._v(" Important changes")]),e._v(" "),a("ul",[a("li",[e._v("Java 11 or newer is required")]),e._v(" "),a("li",[e._v("Ontop's Protégé plugin now requires at least Protégé 5.6-beta")]),e._v(" "),a("li",[e._v("RDF4J bindings updated to 4.1.0")]),e._v(" "),a("li",[e._v("The module "),a("code",[e._v("ontop-owlapi")]),e._v(" is not published anymore. We recommend using "),a("code",[e._v("ontop-rdf4j")]),e._v(" instead")]),e._v(" "),a("li",[e._v("RDF4J workbench modules removed")]),e._v(" "),a("li",[e._v("Docker image moved to "),a("a",{attrs:{href:"https://hub.docker.com/r/ontop/ontop",target:"_blank",rel:"noopener"}},[a("code",[e._v("ontop/ontop")]),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Ontop views renamed "),a("a",{attrs:{href:"/guide/advanced/lenses"}},[e._v("lenses")])])]),e._v(" "),a("h4",{attrs:{id:"new-features-4"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#new-features-4"}},[e._v("#")]),e._v(" New features")]),e._v(" "),a("ul",[a("li",[e._v("Support for SPARQL rules for the extending the VKG added "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/576",target:"_blank",rel:"noopener"}},[e._v("#576"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("The "),a("a",{attrs:{href:"https://hub.docker.com/r/ontop/ontop",target:"_blank",rel:"noopener"}},[e._v("Docker image"),a("OutboundLink")],1),e._v(" now also supported the ARM64 architecture and allows to run all the CLI commands "),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/532",target:"_blank",rel:"noopener"}},[e._v("#532"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Support for Snowflake added "),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/520",target:"_blank",rel:"noopener"}},[e._v("#520"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Support for MariaDB added "),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/271",target:"_blank",rel:"noopener"}},[e._v("#271"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("N-Triples and N-quads are now supported by the SPARQL endpoint "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/566",target:"_blank",rel:"noopener"}},[e._v("#566"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Option to fully reformulate the SPARQL query into SQL added "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/577",target:"_blank",rel:"noopener"}},[e._v("#577"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Experimental support for flatten lenses added (only for PostgreSQL)")])]),e._v(" "),a("h4",{attrs:{id:"new-optimizations"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#new-optimizations"}},[e._v("#")]),e._v(" New optimizations")]),e._v(" "),a("ul",[a("li",[e._v("Optimization of joins with a union of class definitions added "),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/543",target:"_blank",rel:"noopener"}},[e._v("#543"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Optimizations for generic queries with limit added "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/578",target:"_blank",rel:"noopener"}},[e._v("#578"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Optimization for queries retrieving all the properties or classes in use in the VKG added "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/581",target:"_blank",rel:"noopener"}},[e._v("#581"),a("OutboundLink")],1)])]),e._v(" "),a("h4",{attrs:{id:"refactoring-3"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#refactoring-3"}},[e._v("#")]),e._v(" Refactoring")]),e._v(" "),a("ul",[a("li",[e._v("New module for testing dialects in the Github CI pipeline added "),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/568",target:"_blank",rel:"noopener"}},[e._v("#568"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("JSQLParser updated to 4.4")]),e._v(" "),a("li",[e._v("Ontop's Protégé plugin isolated from Ontop modules "),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/278",target:"_blank",rel:"noopener"}},[e._v("#278"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Support for Databricks (Apache Spark) improved")])]),e._v(" "),a("p",[e._v("Many bugfixes. See also "),a("a",{attrs:{href:"https://github.com/ontop/ontop/milestone/16?closed=1",target:"_blank",rel:"noopener"}},[e._v("its milestone on Github"),a("OutboundLink")],1),e._v(".")]),e._v(" "),a("h2",{attrs:{id:"_4-2-2-november-18-2022"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-2-november-18-2022"}},[e._v("#")]),e._v(" 4.2.2 (November 18, 2022)")]),e._v(" "),a("h4",{attrs:{id:"new-features-5"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#new-features-5"}},[e._v("#")]),e._v(" New features")]),e._v(" "),a("ul",[a("li",[e._v("Support for Protege 5.6-beta under Java 11 and Java 17")]),e._v(" "),a("li",[e._v("Support for the Databricks-specific JDBC driver "),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/554",target:"_blank",rel:"noopener"}},[e._v("#554"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Support for LIMIT/OFFSET in SQL Server 2008 "),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/531",target:"_blank",rel:"noopener"}},[e._v("#531"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Support for materialized views in PostgreSQL "),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/541",target:"_blank",rel:"noopener"}},[e._v("#541"),a("OutboundLink")],1)])]),e._v(" "),a("h4",{attrs:{id:"bugfixes-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#bugfixes-2"}},[e._v("#")]),e._v(" Bugfixes")]),e._v(" "),a("ul",[a("li",[e._v("VALUES handling with Teiid "),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/525",target:"_blank",rel:"noopener"}},[e._v("#525"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Metadata extraction for Dremio of schema names with dots")]),e._v(" "),a("li",[e._v("Typo in registration of Oracle factories "),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/557",target:"_blank",rel:"noopener"}},[e._v("#557"),a("OutboundLink")],1)])]),e._v(" "),a("p",[e._v("Preventive update of dependencies including Jackson and Gson to address potential vulnerabilities.")]),e._v(" "),a("h2",{attrs:{id:"_4-2-1-april-20-2022"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-1-april-20-2022"}},[e._v("#")]),e._v(" 4.2.1 (April 20, 2022)")]),e._v(" "),a("h4",{attrs:{id:"new-feature-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#new-feature-2"}},[e._v("#")]),e._v(" New feature")]),e._v(" "),a("ul",[a("li",[e._v("Support for partial serialized DB metadata, when "),a("code",[e._v("ontop.allowRetrievingBlackBoxViewMetadataFromDB")]),e._v(" is enabled.")])]),e._v(" "),a("h4",{attrs:{id:"bugfixes-3"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#bugfixes-3"}},[e._v("#")]),e._v(" Bugfixes")]),e._v(" "),a("ul",[a("li",[e._v("Not renamed variable in sub-query with a distinct ("),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/417",target:"_blank",rel:"noopener"}},[e._v("#417"),a("OutboundLink")],1),e._v(").")]),e._v(" "),a("li",[e._v("OBDA to R2RML conversion: require mapping entry IDs to be unique.")]),e._v(" "),a("li",[e._v("Lang tags for constants in R2RML were ignored.")]),e._v(" "),a("li",[e._v("Several fixes related to VALUES.")]),e._v(" "),a("li",[e._v("Better HTTP codes for the ontology download endpoint.")])]),e._v(" "),a("p",[e._v("The Jackson and Spring Boot dependencies have been preventively updated (to 2.13.2.2 and 2.6.6 respectively) to address potential vulnerabilities ("),a("a",{attrs:{href:"https://nvd.nist.gov/vuln/detail/CVE-2020-36518",target:"_blank",rel:"noopener"}},[e._v("CVE-2020-36518"),a("OutboundLink")],1),e._v(" and "),a("a",{attrs:{href:"https://nvd.nist.gov/vuln/detail/cve-2022-22965",target:"_blank",rel:"noopener"}},[e._v("CVE-2022-22965"),a("OutboundLink")],1),e._v(").")]),e._v(" "),a("h2",{attrs:{id:"_4-2-0-december-30-2021"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-0-december-30-2021"}},[e._v("#")]),e._v(" 4.2.0 (December 30, 2021)")]),e._v(" "),a("h4",{attrs:{id:"new-features-6"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#new-features-6"}},[e._v("#")]),e._v(" New features")]),e._v(" "),a("ul",[a("li",[e._v("Support for Apache Spark ("),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/422",target:"_blank",rel:"noopener"}},[e._v("#422"),a("OutboundLink")],1),e._v(").")]),e._v(" "),a("li",[e._v("Support for time functions added ("),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/478",target:"_blank",rel:"noopener"}},[e._v("#478"),a("OutboundLink")],1),e._v(").")]),e._v(" "),a("li",[e._v("Support for the "),a("code",[e._v("IN")]),e._v(" SPARQL function added.")]),e._v(" "),a("li",[e._v('Datatypes can be extracted from non-supported source queries in the mapping (treated internally as "black-box" views). Disabled by default (see '),a("a",{attrs:{href:"/guide/advanced/configuration"}},[a("code",[e._v("ontop.allowRetrievingBlackBoxViewMetadataFromDB")])]),e._v(").")]),e._v(" "),a("li",[e._v("TBox triples (e.g. sub-classes, domains and ranges) can be added to the default RDF graph. Disabled by default (see "),a("a",{attrs:{href:"/guide/advanced/configuration"}},[a("code",[e._v("ontop.enableFactExtractionWithTBox")])]),e._v(").")]),e._v(" "),a("li",[e._v("Support for "),a("a",{attrs:{href:"/guide/advanced/views"}},[e._v("Ontop join views")]),e._v(" added.")]),e._v(" "),a("li",[e._v("Support for arbitrary levels of Ontop views added (views over views).")]),e._v(" "),a("li",[e._v("Better integrity constraint extraction for Ontop basic and join views.")]),e._v(" "),a("li",[e._v("Non-null information can now be specified for Ontop views.")]),e._v(" "),a("li",[e._v("Support for b-node facts added.")]),e._v(" "),a("li",[e._v("The default query of the SPARQL endpoint portal is now configurable ("),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/454",target:"_blank",rel:"noopener"}},[e._v("#454"),a("OutboundLink")],1),e._v(").")]),e._v(" "),a("li",[e._v("Contextually injective IRI templates with numeric or UUID arguments are now decomposed ("),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/363",target:"_blank",rel:"noopener"}},[e._v("#363"),a("OutboundLink")],1),e._v(").")]),e._v(" "),a("li",[e._v("JSON-LD serialization now supported by the materializer ("),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/481",target:"_blank",rel:"noopener"}},[e._v("#481"),a("OutboundLink")],1),e._v(").")])]),e._v(" "),a("h4",{attrs:{id:"refactoring-4"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#refactoring-4"}},[e._v("#")]),e._v(" Refactoring")]),e._v(" "),a("ul",[a("li",[e._v("Support for Java >= 8. Ontop decoupled from Protégé so as to update several common libraries ("),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/467",target:"_blank",rel:"noopener"}},[e._v("#467"),a("OutboundLink")],1),e._v(").")]),e._v(" "),a("li",[e._v('RDF facts provided by the ontology file are now internally grouped together into values blocks (sorts of "in-memory tables") instead of being splitted into large unions. Enabled by default (see '),a("a",{attrs:{href:"/guide/advanced/configuration"}},[a("code",[e._v("ontop.enableValuesNode")])]),e._v(").")]),e._v(" "),a("li",[e._v("Unions are lifted above aggregations when possible.")]),e._v(" "),a("li",[e._v("Docker image updated to JRE 11.")]),e._v(" "),a("li",[e._v("Mutable intermediate queries are not used anymore.")]),e._v(" "),a("li",[e._v("Stronger handling of non well-designed "),a("code",[e._v("OPTIONAL")]),e._v(" blocks.")]),e._v(" "),a("li",[e._v("Stronger handling of "),a("code",[e._v("ORDER BY")]),e._v(" in sub-queries.")]),e._v(" "),a("li",[e._v("Type extractor relaxed ("),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/438",target:"_blank",rel:"noopener"}},[e._v("#438"),a("OutboundLink")],1),e._v(") to tolerate slightly different datatypes.")]),e._v(" "),a("li",[e._v("JDBC distinct result set removed.")]),e._v(" "),a("li",[e._v("JDBC user name and password are not required anymore. Useful when passed in the JDBC URL.")]),e._v(" "),a("li",[e._v("The Command-Line Interface of the bootstrapper has been refactored (invalid options removed, comments improved).")])]),e._v(" "),a("p",[e._v("Many bugfixes (see for instance "),a("a",{attrs:{href:"https://github.com/ontop/ontop/milestone/14?closed=1",target:"_blank",rel:"noopener"}},[e._v("our Github bugtracker"),a("OutboundLink")],1),e._v(").")]),e._v(" "),a("h2",{attrs:{id:"_4-1-1-july-23-2021"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-1-july-23-2021"}},[e._v("#")]),e._v(" 4.1.1 (July 23, 2021)")]),e._v(" "),a("h4",{attrs:{id:"bugfixes-4"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#bugfixes-4"}},[e._v("#")]),e._v(" Bugfixes")]),e._v(" "),a("ul",[a("li",[e._v("Bugs related to GeoSPARQL support ("),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/428",target:"_blank",rel:"noopener"}},[e._v("#428"),a("OutboundLink")],1),e._v(","),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/434",target:"_blank",rel:"noopener"}},[e._v("#434"),a("OutboundLink")],1),e._v(" )")]),e._v(" "),a("li",[e._v("Issue with ORDER BY and LIMIT for MS SQL ("),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/225",target:"_blank",rel:"noopener"}},[e._v("#225"),a("OutboundLink")],1),e._v(","),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/412",target:"_blank",rel:"noopener"}},[e._v("#412"),a("OutboundLink")],1),e._v(")")])]),e._v(" "),a("h4",{attrs:{id:"new-features-7"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#new-features-7"}},[e._v("#")]),e._v(" New features")]),e._v(" "),a("ul",[a("li",[e._v("Teiid support ("),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/336",target:"_blank",rel:"noopener"}},[e._v("#336"),a("OutboundLink")],1),e._v(")")]),e._v(" "),a("li",[e._v("Various improvements of the Protégé plugin")])]),e._v(" "),a("h2",{attrs:{id:"_4-1-0-february-28-2021"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-0-february-28-2021"}},[e._v("#")]),e._v(" 4.1.0 (February 28, 2021)")]),e._v(" "),a("h4",{attrs:{id:"changed-behavior"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#changed-behavior"}},[e._v("#")]),e._v(" Changed behavior")]),e._v(" "),a("ul",[a("li",[a("a",{attrs:{href:"/guide%C3%A9cli#ontop-mapping-to-r2rml"}},[e._v("OBDA to R2RML mapping conversion")]),e._v(" now requires by default access to DB metadata (through credentials or as a serialized file). This requirement can be bypassed with the argument "),a("code",[e._v("--force")]),e._v(".")]),e._v(" "),a("li",[e._v("By default, DESCRIBE queries only return the triples where the described IRI appears as subject. To also consider the triples where it appears as object, set the parameter "),a("code",[e._v("ontop.includeFixedObjectPositionInDescribe")]),e._v(" to true.")]),e._v(" "),a("li",[e._v("The Docker endpoint image is now based on Debian ("),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/394",target:"_blank",rel:"noopener"}},[e._v("#394"),a("OutboundLink")],1),e._v("), not on Alpine anymore.")])]),e._v(" "),a("h4",{attrs:{id:"new-features-8"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#new-features-8"}},[e._v("#")]),e._v(" New features")]),e._v(" "),a("ul",[a("li",[e._v("Support for GeoSPARQL functions added ("),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/335",target:"_blank",rel:"noopener"}},[e._v("#335"),a("OutboundLink")],1),e._v(").")]),e._v(" "),a("li",[a("a",{attrs:{href:"/guide/advanced/logging"}},[e._v("Rich JSON-based query logging")]),e._v(" added.")]),e._v(" "),a("li",[a("a",{attrs:{href:"/guide/advanced/predefined"}},[e._v("New endpoint for predefined queries")]),e._v(" added (beta). It enables the specification of custom low-latency Web APIs in a declarative manner.")]),e._v(" "),a("li",[e._v("Support for the "),a("code",[e._v("IF")]),e._v(", "),a("code",[e._v("IRI")]),e._v(", "),a("code",[e._v("BNODE")]),e._v(" SPARQL functions added.")]),e._v(" "),a("li",[e._v("Support for Dremio added.")]),e._v(" "),a("li",[e._v("DB metadata can now be loaded from files instead of connecting to the database.")]),e._v(" "),a("li",[e._v("Bnode labels are now anonymized on-the-fly. Bnode templates can safely use PII.")]),e._v(" "),a("li",[e._v("Sensitive JDBC information (user name, password, URL) can now be passed as arguments or environment variables (for Docker) instead of being written in the properties file. Docker secrets are also supported for further security.")]),e._v(" "),a("li",[e._v("New left join optimization techniques added. General functional dependencies are now taken into account. Sensitivity to left join ordering reduced.")]),e._v(" "),a("li",[a("a",{attrs:{href:"/guide/advanced/caching"}},[e._v("HTTP caching")]),e._v(" headers can now be returned by the Ontop SPARQL endpoint.")]),e._v(" "),a("li",[e._v("Native Protégé bundles for each platform (Windows, MacOS, Linux) with JRE 8 embedded.")]),e._v(" "),a("li",[e._v("Basic support for Ontop views added (experimental), which, in particular, allows specifying integrity constraints on views defined at the Ontop level.")])]),e._v(" "),a("h4",{attrs:{id:"removal"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#removal"}},[e._v("#")]),e._v(" Removal")]),e._v(" "),a("ul",[a("li",[e._v("As announced earlier, the RDF4J Workbench-based bundles are not shipped anymore. However, the webapps war file can still be built with Maven.")])]),e._v(" "),a("h4",{attrs:{id:"refactoring-5"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#refactoring-5"}},[e._v("#")]),e._v(" Refactoring")]),e._v(" "),a("ul",[a("li",[e._v("Drastic reduction of memory consumption when processing SPARQL queries ("),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/370",target:"_blank",rel:"noopener"}},[e._v("#370"),a("OutboundLink")],1),e._v("), which is significant for materializing large RDF graphs.")]),e._v(" "),a("li",[e._v("Better file resource handling ("),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/368",target:"_blank",rel:"noopener"}},[e._v("#368"),a("OutboundLink")],1),e._v(").")]),e._v(" "),a("li",[e._v("Distinct lifting improved.")]),e._v(" "),a("li",[e._v("Self-join elimination based on functional dependencies re-implemented.")]),e._v(" "),a("li",[e._v("Decomposition of heterogeneous IRI templates enabled.")]),e._v(" "),a("li",[e._v("Lexical value space is now considered when decomposing IRIs.")]),e._v(" "),a("li",[e._v("Protégé plugin codebase cleaned, with parts of UI streamlined and redesigned. Improved syntax highlighting in target and source queries. Mapping validation extended. Multiple open ontologies supported ("),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/282",target:"_blank",rel:"noopener"}},[e._v("#282"),a("OutboundLink")],1),e._v(" and "),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/175",target:"_blank",rel:"noopener"}},[e._v("#175"),a("OutboundLink")],1),e._v(").")]),e._v(" "),a("li",[e._v("RDF4J external binding management refactored.")]),e._v(" "),a("li",[e._v("Bnode handling refactored.")]),e._v(" "),a("li",[e._v("Java 11 support.")]),e._v(" "),a("li",[e._v("Better handling of column names when converting OBDA mappings into R2RML, which now uses DB metadata.")]),e._v(" "),a("li",[e._v("CONSTRUCT and DESCRIBE query handling refactored.")]),e._v(" "),a("li",[e._v("Parser for OBDA mappings refactored.")]),e._v(" "),a("li",[e._v("Character encoding in R2RML templates refactored.")]),e._v(" "),a("li",[e._v("Default file encoding set to UTF-8. Particularly useful on Windows. Can be overridden if needed.")]),e._v(" "),a("li",[a("a",{attrs:{href:"/dev/build"}},[e._v("Build script")]),e._v(" refactored. Now fully based on Maven ("),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/393",target:"_blank",rel:"noopener"}},[e._v("#393"),a("OutboundLink")],1),e._v(").")]),e._v(" "),a("li",[e._v("Base Docker image updated.")]),e._v(" "),a("li",[e._v("PostgreSQL transaction handling (in streaming mode) improved.")]),e._v(" "),a("li",[e._v("Timeout support extended to non-SELECT queries.")])]),e._v(" "),a("p",[e._v("Many bugfixes.")]),e._v(" "),a("h2",{attrs:{id:"_4-0-3-october-16-2020"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-0-3-october-16-2020"}},[e._v("#")]),e._v(" 4.0.3 (October 16, 2020)")]),e._v(" "),a("h4",{attrs:{id:"bugfixes-5"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#bugfixes-5"}},[e._v("#")]),e._v(" Bugfixes")]),e._v(" "),a("ul",[a("li",[e._v("Wrong IRI decomposition ("),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/358",target:"_blank",rel:"noopener"}},[e._v("#358"),a("OutboundLink")],1),e._v(")")]),e._v(" "),a("li",[e._v("Logback config file ignored by Ontop CLI ("),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/361",target:"_blank",rel:"noopener"}},[e._v("#361"),a("OutboundLink")],1),e._v(")")])]),e._v(" "),a("h2",{attrs:{id:"_4-0-2-september-3-2020"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-0-2-september-3-2020"}},[e._v("#")]),e._v(" 4.0.2 (September 3, 2020)")]),e._v(" "),a("ul",[a("li",[e._v("Fixed Named Graphs (quad) grammar in the target of the Ontop native mapping language.")])]),e._v(" "),a("h2",{attrs:{id:"_4-0-1-august-28-2020"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-0-1-august-28-2020"}},[e._v("#")]),e._v(" 4.0.1 (August 28, 2020)")]),e._v(" "),a("h4",{attrs:{id:"new-features-and-bugfixes"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#new-features-and-bugfixes"}},[e._v("#")]),e._v(" New features and bugfixes")]),e._v(" "),a("ul",[a("li",[e._v("Named Graphs (quad) are supported in materialization ("),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/343",target:"_blank",rel:"noopener"}},[e._v("#343"),a("OutboundLink")],1),e._v(")")]),e._v(" "),a("li",[e._v("Removal of Jena as a dependency ("),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/349",target:"_blank",rel:"noopener"}},[e._v("#349"),a("OutboundLink")],1),e._v(")")]),e._v(" "),a("li",[a("code",[e._v("com.mysql.cj.jdbc.Driver")]),e._v(" is now also recognized. Non-recognized drivers now use the default SQL factories instead of the mock-up one.")])]),e._v(" "),a("h2",{attrs:{id:"_4-0-0-july-31-2020"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-0-0-july-31-2020"}},[e._v("#")]),e._v(" 4.0.0 (July 31, 2020)")]),e._v(" "),a("h4",{attrs:{id:"refactoring-6"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#refactoring-6"}},[e._v("#")]),e._v(" Refactoring")]),e._v(" "),a("ul",[a("li",[e._v("Dependencies updated (e.g. RDF4J 3.3.0)")]),e._v(" "),a("li",[e._v("SERIAL datatypes of PostgreSQL better handled")]),e._v(" "),a("li",[e._v("Anonymous blank nodes are now supported in CONSTRUCT blocks")]),e._v(" "),a("li",[e._v("JSON-LD now supported for graph queries")]),e._v(" "),a("li",[e._v("Denodo support improved.")])]),e._v(" "),a("p",[e._v("Few bugfixes.")]),e._v(" "),a("h2",{attrs:{id:"_4-0-0-rc-1-july-8-2020"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-0-0-rc-1-july-8-2020"}},[e._v("#")]),e._v(" 4.0.0-rc-1 (July 8, 2020)")]),e._v(" "),a("h4",{attrs:{id:"changed-behavior-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#changed-behavior-2"}},[e._v("#")]),e._v(" Changed behavior")]),e._v(" "),a("ul",[a("li",[e._v("Streaming mode is enabled by default for query answering. It fetches data by batches of 500 results.")])]),e._v(" "),a("h4",{attrs:{id:"new-features-9"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#new-features-9"}},[e._v("#")]),e._v(" New features")]),e._v(" "),a("ul",[a("li",[e._v("Support of GROUP_CONCAT added. All the standard SPARQL aggregation functions are now supported.")]),e._v(" "),a("li",[e._v("Named graphs are now supported.")]),e._v(" "),a("li",[e._v("Support of Denodo added. Support of Dremio is postponed to 4.1.")]),e._v(" "),a("li",[e._v("Support XML catalog file added (beta). It enables resolving "),a("code",[e._v("owl:imports")]),e._v(" assertions from the ontology by loading local files instead of fetching remote URLs. It is available in Protégé and with the "),a("code",[e._v("ontop endpoint")]),e._v(" CLI command.")]),e._v(" "),a("li",[e._v("DB metadata extraction CLI command added (experimental).")]),e._v(" "),a("li",[e._v("CASE and CAST is now supported in the mapping.")]),e._v(" "),a("li",[e._v("Streaming mode for query answering added.")])]),e._v(" "),a("h4",{attrs:{id:"deprecation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#deprecation"}},[e._v("#")]),e._v(" Deprecation")]),e._v(" "),a("ul",[a("li",[e._v("The RDF4J Workbench-based SPARQL endpint is deprecated. Tomcat, Jetty bundles and webapps (.war files) will be removed in a future version. Users are recommended to switch to the "),a("code",[e._v("ontop endpoint")]),e._v(" CLI or its Docker image.")])]),e._v(" "),a("h4",{attrs:{id:"removal-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#removal-2"}},[e._v("#")]),e._v(" Removal")]),e._v(" "),a("ul",[a("li",[e._v("The Mapping Assistant panel has been removed from the Ontop Protégé plugin.")])]),e._v(" "),a("h4",{attrs:{id:"refactoring-7"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#refactoring-7"}},[e._v("#")]),e._v(" Refactoring")]),e._v(" "),a("ul",[a("li",[e._v("SQL parsing of the mapping improved. JSQLParser's version has been updated.")]),e._v(" "),a("li",[e._v("Metadata extraction refactored, and SQLDialectAdapter has been eliminated.")]),e._v(" "),a("li",[e._v("Meta-mapping management improved.")]),e._v(" "),a("li",[e._v("Non-recognized SQL functions in the mapping are now only assumed to be deterministic. Other assumptions have been removed.")]),e._v(" "),a("li",[e._v("Internal data nodes now create variables only for database columns that are used in the query. This sparse usage of variables strongly improve reformulation time and log readibility when using tables with 100+ columns in the mapping.")])]),e._v(" "),a("p",[e._v("Many bugfixes.")]),e._v(" "),a("h2",{attrs:{id:"_4-0-0-beta-1-december-23-2019"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-0-0-beta-1-december-23-2019"}},[e._v("#")]),e._v(" 4.0.0-beta-1 (December 23, 2019)")]),e._v(" "),a("h4",{attrs:{id:"changed-behaviors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#changed-behaviors"}},[e._v("#")]),e._v(" Changed behaviors")]),e._v(" "),a("ul",[a("li",[e._v("Cardinality is now enforced by default (duplicates are removed at\nthe mapping level). This is required to support most of the\naggregation functions.")]),e._v(" "),a("li",[e._v("Functions in the SQL queries of the mapping that are unknown to\nOntop do no cause the creation of SQL views anymore. The strategy\nregarding SQL functions moved from white-list to black-list.")]),e._v(" "),a("li",[e._v("Types returned by supported SPARQL functions now strictly follow the\nSPARQL 1.1 specification.")])]),e._v(" "),a("h4",{attrs:{id:"new-features-10"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#new-features-10"}},[e._v("#")]),e._v(" New features")]),e._v(" "),a("ul",[a("li",[e._v("SPARQL Aggregation functions SUM, COUNT, AVG, MIN, MAX are now\nsupported. SAMPLE is currently implemented as MIN.")]),e._v(" "),a("li",[e._v("Joins over terms that are constructed using different functions are\nnow supported.")]),e._v(" "),a("li",[e._v("Some functions (such as IRI templates) can now be post-processed\n(that is, they are not always included in the SQL query anymore).\nGenerated SQL queries are generally less verbose than before.")]),e._v(" "),a("li",[e._v("The Ontop endpoint now has the portal option, where predefined\nqueries are shown in the Web interface.")]),e._v(" "),a("li",[e._v("The NULLIF SQL function is now supported and optimized. Useful for\nfiltering out some unwanted values in the mapping assertions.")]),e._v(" "),a("li",[e._v("OPTIONALs outside the well-designed fragment are now supported.\nWeakly well-designed queries encoding preferences are optimized.")])]),e._v(" "),a("h4",{attrs:{id:"refactoring-8"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#refactoring-8"}},[e._v("#")]),e._v(" Refactoring")]),e._v(" "),a("ul",[a("li",[e._v("The typing system have been entirely redesigned. RDF types and\ndatabase types are now clearly separated. Each database engine can\nnow bring in its own data types.")]),e._v(" "),a("li",[e._v("The Datalog data structure (from version 1.x) for representing\nqueries internally has been removed.")]),e._v(" "),a("li",[e._v("Function symbol creation and optimization has been entirely\nrefactored. They are constructed by two factories, the\nFunctionSymbolFactory and the DBFunctionSymbolFactory.")]),e._v(" "),a("li",[e._v("Most of the logic of SQLDialectAdapter has been moved to\nDBFunctionSymbolFactory and DBTypeFactory. Each database engine is\nexpected to have its own implementation of these new interfaces.")]),e._v(" "),a("li",[e._v("The SPARQL translation has been rewritten (was formerly translating\ninto Datalog).")]),e._v(" "),a("li",[e._v("The SQL generator has been rewritten (was formerly translating from\nDatalog).")])]),e._v(" "),a("h4",{attrs:{id:"temporary-limitation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#temporary-limitation"}},[e._v("#")]),e._v(" Temporary limitation")]),e._v(" "),a("ul",[a("li",[e._v("Due to a complete refactoring of the SQL dialect management, only\nthe H2, MySQL, PostgreSQL, Oracle, SQL server and DB2 dialects are\nsupported in this beta. Dremio and Denodo dialects are expected to\nbe supported in a next beta release.")])]),e._v(" "),a("p",[e._v("Many bugfixes.")]),e._v(" "),a("h2",{attrs:{id:"_3-0-1-december-9-2019"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-0-1-december-9-2019"}},[e._v("#")]),e._v(" 3.0.1 (December 9, 2019)")]),e._v(" "),a("h4",{attrs:{id:"changed-behaviors-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#changed-behaviors-2"}},[e._v("#")]),e._v(" Changed behaviors")]),e._v(" "),a("ul",[a("li",[e._v("Protégé: no property file (resp. mapping file) is created if no data\nsource (resp. mapping assertion) is specified by the user.")])]),e._v(" "),a("h4",{attrs:{id:"new-features-11"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#new-features-11"}},[e._v("#")]),e._v(" New features")]),e._v(" "),a("ul",[a("li",[e._v("Ontop endpoint now supports R2RML files and doesn't require an\nontology.")]),e._v(" "),a("li",[e._v("Materialization: N-triples format is now supported.")])]),e._v(" "),a("h4",{attrs:{id:"refactoring-9"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#refactoring-9"}},[e._v("#")]),e._v(" Refactoring")]),e._v(" "),a("ul",[a("li",[e._v("Rewriting of the tree-witness rewriter (now independent from\nDatalog)")])]),e._v(" "),a("h4",{attrs:{id:"bug-fixes-3"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#bug-fixes-3"}},[e._v("#")]),e._v(" Bug fixes")]),e._v(" "),a("ul",[a("li",[e._v("Protégé: fixed issues related to prefix management.")]),e._v(" "),a("li",[e._v("Reasoning: issue related to the handling of inverse properties\nfixed.")])]),e._v(" "),a("h2",{attrs:{id:"_3-0-0-august-23-2019"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-0-0-august-23-2019"}},[e._v("#")]),e._v(" 3.0.0 (August 23, 2019)")]),e._v(" "),a("h4",{attrs:{id:"changed-behaviors-3"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#changed-behaviors-3"}},[e._v("#")]),e._v(" Changed behaviors")]),e._v(" "),a("ul",[a("li",[e._v("The `rdfs:range` of a data property is not used anymore for\ninferring the non-specified datatype in a mapping assertion but for\nvalidating the datatype once specified or inferred. Datatype\ninference is now based on the DB datatype and follows the R2RML\nnatural mapping (https://www.w3.org/TR/r2rml/#natural-mapping)")])]),e._v(" "),a("h4",{attrs:{id:"new-features-12"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#new-features-12"}},[e._v("#")]),e._v(" New features")]),e._v(" "),a("ul",[a("li",[e._v("Support of Protege 5.5")]),e._v(" "),a("li",[e._v("Support of BNode in R2RML")]),e._v(" "),a("li",[e._v("Basic support for the `geo:wktLiteral` datatype (#256)")]),e._v(" "),a("li",[e._v("New command-line interface for SPARQL endpoint")]),e._v(" "),a("li",[e._v("Docker container for SPARQL endpoint\n(https://hub.docker.com/r/ontop/ontop-endpoint)")]),e._v(" "),a("li",[e._v("Preliminary support of Dremio")]),e._v(" "),a("li",[e._v("Preliminary support of Denodo")]),e._v(" "),a("li",[e._v("The ordering of SPARQL variables is now preserved (#291)")]),e._v(" "),a("li",[e._v("N-Triples output for materialization added")]),e._v(" "),a("li",[e._v("The SQL translation now appears as a sub-tab in the Protégé Ontop\nSPARQL tab")])]),e._v(" "),a("h4",{attrs:{id:"refactoring-10"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#refactoring-10"}},[e._v("#")]),e._v(" Refactoring")]),e._v(" "),a("ul",[a("li",[e._v("The triple predicate is now systematically used in the mapping and\nduring query unfolding")]),e._v(" "),a("li",[e._v("Atom predicates and function symbols are now clearly distinguished")]),e._v(" "),a("li",[e._v("The Datalog-based data structure is not used anymore at mapping\nprocessing time and by the default rewriter")]),e._v(" "),a("li",[e._v("Query containment-based optimizations applied to the mapping after\nsaturation improved")]),e._v(" "),a("li",[e._v("The materializer is now based on RDF4J (instead of OWLAPI)")])]),e._v(" "),a("h4",{attrs:{id:"project-organisation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#project-organisation"}},[e._v("#")]),e._v(" Project organisation")]),e._v(" "),a("ul",[a("li",[e._v("Release of Ontop on both SourceForge and GitHub (#274)")]),e._v(" "),a("li",[e._v("A new repository for the tutorial\n(https://github.com/ontop/ontop-tutorial)")])]),e._v(" "),a("p",[e._v("Many bugfixes.")]),e._v(" "),a("h2",{attrs:{id:"_3-0-0-beta-2-february-28-2018"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-0-0-beta-2-february-28-2018"}},[e._v("#")]),e._v(" 3.0.0-beta-2 (February 28, 2018)")]),e._v(" "),a("h4",{attrs:{id:"changed-behaviours"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#changed-behaviours"}},[e._v("#")]),e._v(" Changed Behaviours")]),e._v(" "),a("ul",[a("li",[e._v("The JDBC driver class name is now required in Protégé (issue #248)")])]),e._v(" "),a("h4",{attrs:{id:"new-features-13"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#new-features-13"}},[e._v("#")]),e._v(" New features")]),e._v(" "),a("ul",[a("li",[e._v("Novel left join optimization techniques (issue #230)")]),e._v(" "),a("li",[e._v("LIMIT appended to test SQL queries and SPARQL queries in Protégé")]),e._v(" "),a("li",[e._v("Report illegal usage of Fully qualified column names (FQDN) in the\ntarget part of a mapping assertion")]),e._v(" "),a("li",[e._v("Support for the SPARQL isNumeric function")])]),e._v(" "),a("h4",{attrs:{id:"refactoring-11"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#refactoring-11"}},[e._v("#")]),e._v(" Refactoring")]),e._v(" "),a("ul",[a("li",[e._v("Internal representation of the ontology improved")]),e._v(" "),a("li",[e._v("Improvement of the intermediate query representation (issues #235,\n#236)")]),e._v(" "),a("li",[e._v("Switch to ANTLR4 to parse ontop native mapping (issues #238, #239)")]),e._v(" "),a("li",[e._v("Make ResultSet.next() robust (issue #219)")]),e._v(" "),a("li",[e._v("More robust handling of IRI-safe encoding (issue #245)")])]),e._v(" "),a("h4",{attrs:{id:"bug-fixes-4"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#bug-fixes-4"}},[e._v("#")]),e._v(" Bug Fixes")]),e._v(" "),a("p",[e._v("Many, see "),a("a",{attrs:{href:"https://github.com/ontop/ontop/milestone/7?closed=1",target:"_blank",rel:"noopener"}},[e._v("closed issues"),a("OutboundLink")],1),e._v(".")]),e._v(" "),a("h2",{attrs:{id:"_3-0-0-beta-1-august-11-2017"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-0-0-beta-1-august-11-2017"}},[e._v("#")]),e._v(" 3.0.0-beta-1 (August 11, 2017)")]),e._v(" "),a("p",[e._v("Note that this is the first release from version 3 series with many\ninternal refactoring and improvements, and bug fixes. However, these\nchanges also cause incompatibility with Ontop v1. See "),a("a",{attrs:{href:"MigrationGuideV1toV3",title:"wikilink"}},[e._v("the migration\nguide")]),e._v(".")]),e._v(" "),a("h4",{attrs:{id:"changed-behaviours-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#changed-behaviours-2"}},[e._v("#")]),e._v(" Changed Behaviours")]),e._v(" "),a("ul",[a("li",[e._v("JDBC connection information is stored in a separate properties file")]),e._v(" "),a("li",[e._v("Fully qualified columns (table.column) are not allowed in the target\npart of the mapping language. One has to explicitly create an alias\n(e.g. table.column AS table_column) and use the alias in the\ntarget. (complying with R2RML)")]),e._v(" "),a("li",[e._v("The rules for datatype type inference and checking are changed. Now\nwe use only mapping and database to infer the datatypes (complying\nwith R2RML), and the (range axioms) in the ontologies to check the\ncompatibility (complying with OWL).")])]),e._v(" "),a("h4",{attrs:{id:"new-features-14"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#new-features-14"}},[e._v("#")]),e._v(" New features")]),e._v(" "),a("ul",[a("li",[e._v("Major refactoring of the internal structure of the Ontop system")]),e._v(" "),a("li",[e._v("Databases for Integration Tests have been dockerized.")]),e._v(" "),a("li",[e._v("Upgrade Sesame to the latest version of RDF4J (v2.2.2).")]),e._v(" "),a("li",[e._v("The redesigned OWLAPI and RDF4J API bindings of Ontop API (see\nexamples: "),a("a",{attrs:{href:"https://github.com/ontop/ontop-api-examples",target:"_blank",rel:"noopener"}},[e._v("https://github.com/ontop/ontop-api-examples"),a("OutboundLink")],1),e._v(")")]),e._v(" "),a("li",[e._v("Upgrade of R2RML API to v0.6.0")]),e._v(" "),a("li",[e._v("Official support of both Tomcat and Jetty (v9) for deploying a\nSPARQL endpoint")]),e._v(" "),a("li",[e._v("Better support of Optional (bugfix #190)")]),e._v(" "),a("li",[e._v('Protege: support for "Synchronize Reasoner" in the Reasoner menu')]),e._v(" "),a("li",[e._v("Improved error messages for incorrect mapping")]),e._v(" "),a("li",[e._v("CLI tool for converting Mapping from v1 to v3")])]),e._v(" "),a("h2",{attrs:{id:"_1-18-1-june-16-2017"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-18-1-june-16-2017"}},[e._v("#")]),e._v(" 1.18.1 (June 16, 2017)")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Return a correct extension for files in ontop cli materializer\n(issue #145)")])]),e._v(" "),a("li",[a("p",[e._v("Materialize support non-http resource uris")])]),e._v(" "),a("li",[a("p",[e._v("Bug Fixes")]),e._v(" "),a("ul",[a("li",[e._v("Small fixes in cli (issues #127, #141, #188)")]),e._v(" "),a("li",[e._v("PostgreSQL JDBC driver fix for quotation marks")]),e._v(" "),a("li",[e._v("Remove unknown property warning for owl:sameAs")]),e._v(" "),a("li",[e._v("Remove duplicate annotations during materialization (issues\n#183 #186)")]),e._v(" "),a("li",[e._v("Generate different file names for properties and classes during\nmaterialization with separate files (issue #165)")]),e._v(" "),a("li",[e._v("R2RML\n"),a("ul",[a("li",[e._v("Small changes in api")]),e._v(" "),a("li",[e._v("Fix R2RML import of SQL query (issues #181 #182)")]),e._v(" "),a("li",[e._v("Fix export from OBDA mapping to R2RML (issues #158 #159\n#160)")])])]),e._v(" "),a("li",[e._v("Fix in SPARQL use of filter and values with a IRI (issue #191)")]),e._v(" "),a("li",[e._v("Fix handling of mysql metadata with lower_case_table_names\nsetting on (issue #192)")])])])]),e._v(" "),a("h2",{attrs:{id:"_1-18-0-may-26-2016"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-18-0-may-26-2016"}},[e._v("#")]),e._v(" 1.18.0 (May 26, 2016)")]),e._v(" "),a("ul",[a("li",[e._v("Protege\n"),a("ul",[a("li",[e._v("Redesigned materialization gui")]),e._v(" "),a("li",[e._v("Upgrade to Protege 5.0.0")])])]),e._v(" "),a("li",[e._v("Support of querying annotation property from ontology (issue #105)\n(disabled by default)")]),e._v(" "),a("li",[e._v("Support of the use of owl:sameAs in mappings (disabled by default)")]),e._v(" "),a("li",[e._v("Package names have been unified to it.unibz.inf.ontop")]),e._v(" "),a("li",[e._v("Upgrade OWLAPI to v4.2.5")]),e._v(" "),a("li",[e._v("Bug Fixes\n"),a("ul",[a("li",[e._v("Fix obda-to-r2rml convert for template like <{uri}> (issue\n#97)")]),e._v(" "),a("li",[e._v("Fix an issue in Protege when renaming data source.")]),e._v(" "),a("li",[e._v("Fix error messages in protege mapping assistant panel and SPARQL\nquery")]),e._v(" "),a("li",[e._v("Fix issue with multiple schemas (issue #99)")]),e._v(" "),a("li",[e._v("Fix internal SQL conversion for Teiid jdbc driver")]),e._v(" "),a("li",[e._v("Fix support of anonymous ontology (issue #101)")]),e._v(" "),a("li",[e._v("Fix warning message in Protege (issue #102)")]),e._v(" "),a("li",[e._v("Fix xml uri (issue #104)")]),e._v(" "),a("li",[e._v("Fix r2rml api, error predicateMap with template (issue #107)")]),e._v(" "),a("li",[e._v("Fix in Protege import of additional ontology and add classes and\nproperties of imported ontologies at runtime (issues #106\n#108)")]),e._v(" "),a("li",[e._v("Fix querying URI constants (issue #111)")]),e._v(" "),a("li",[e._v("Fix error message creating new mapping (issue #120)")])])])]),e._v(" "),a("h2",{attrs:{id:"_1-17-1-february-16-2016"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-17-1-february-16-2016"}},[e._v("#")]),e._v(" 1.17.1 (February 16, 2016)")]),e._v(" "),a("ul",[a("li",[e._v("Bug Fixes\n"),a("ul",[a("li",[e._v("Fix an issue when creating new datasource in Protege")])])])]),e._v(" "),a("h2",{attrs:{id:"_1-17-0-february-4-2016"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-17-0-february-4-2016"}},[e._v("#")]),e._v(" 1.17.0 (February 4, 2016)")]),e._v(" "),a("ul",[a("li",[e._v("Protege\n"),a("ul",[a("li",[e._v("Ontop protege plugin now available on official Protege Plugin\nRepository!")]),e._v(" "),a("li",[e._v("Upgrade Protege to 5.0.0-beta-21 (latest version)")]),e._v(" "),a("li",[e._v("Ontop protege plugin is packed as one jar now -- no need for\nseparated OSGI JDBC configuration jars")]),e._v(" "),a("li",[e._v("do not generate .obda and .q file when no datasource is present")]),e._v(" "),a("li",[e._v("General improvement of UI -- more intuitive and less confusion")])])]),e._v(" "),a("li",[e._v("Support for Annotation Properties in mappings")]),e._v(" "),a("li",[e._v("Improvement of Ontop mapping language for URIs/Literals retrieved\nfrom DB columns")]),e._v(" "),a("li",[e._v("Support for SPARQL VALUES keyword for SPARQL federation")]),e._v(" "),a("li",[e._v("Java 8")]),e._v(" "),a("li",[e._v("Upgrade OWLAPI to v4.1.3 (latest version)")]),e._v(" "),a("li",[e._v("Bash Completion for command line interface")]),e._v(" "),a("li",[e._v("Better structured Wiki: "),a("a",{attrs:{href:"https://github.com/ontop/ontop/wiki",target:"_blank",rel:"noopener"}},[e._v("https://github.com/ontop/ontop/wiki"),a("OutboundLink")],1)])]),e._v(" "),a("h2",{attrs:{id:"_1-16-1-november-16-2015"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-16-1-november-16-2015"}},[e._v("#")]),e._v(" 1.16.1 (November 16, 2015)")]),e._v(" "),a("ul",[a("li",[e._v("Optimizations exploiting foreign key constraints over multiple\ncolumns")]),e._v(" "),a("li",[e._v("Improvement in the RDB2RDF compliance test (contributed by Evren\nSrin)")])]),e._v(" "),a("h2",{attrs:{id:"_1-16-0-october-14-2015"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-16-0-october-14-2015"}},[e._v("#")]),e._v(" 1.16.0 (October 14, 2015)")]),e._v(" "),a("ul",[a("li",[e._v("Support for "),a("a",{attrs:{href:"OntopSPARQLFunctions",title:"wikilink"}},[e._v(" SPARQL functions ")])]),e._v(" "),a("li",[e._v("Support for column oriented RDBMS "),a("a",{attrs:{href:"ObdalibPluginJDBC",title:"wikilink"}},[e._v("\nMonetDB")])]),e._v(" "),a("li",[e._v("Support for cloud RDBMS "),a("a",{attrs:{href:"ObdalibPluginJDBC",title:"wikilink"}},[e._v(" SAP HANA")])]),e._v(" "),a("li",[e._v("New Optimization technique: "),a("a",{attrs:{href:"Implicit-database-constraints",title:"wikilink"}},[e._v("\nImplicit-database-constraints")])]),e._v(" "),a("li",[e._v("New Optimization technique: "),a("a",{attrs:{href:"Exact-Mappings",title:"wikilink"}},[e._v("\nExact-Mappings")])]),e._v(" "),a("li",[e._v("Bug Fixes\n"),a("ul",[a("li",[e._v("Handling quotes in the WHERE clause of SQL query in mappings .")]),e._v(" "),a("li",[e._v("Allow multiple subjects in the target of mapping of Ontop native\nsyntax.")]),e._v(" "),a("li",[e._v("Return correct value from datetime columns using jtds driver")]),e._v(" "),a("li",[e._v("Fix the translation of LIMIT with ORDER BY in oracle database")]),e._v(" "),a("li",[e._v("Fix a bug in MetaMappingExpander")])])])]),e._v(" "),a("h2",{attrs:{id:"_1-15-0-may-13-2015"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-15-0-may-13-2015"}},[e._v("#")]),e._v(" 1.15.0 (May 13, 2015)")]),e._v(" "),a("ul",[a("li",[e._v("Upgrade the Protege plugin to Protégé 5")]),e._v(" "),a("li",[e._v("New Command line interface")]),e._v(" "),a("li",[e._v("Better support for SPARQL BIND")]),e._v(" "),a("li",[e._v("Support for SPARQL Concat and Replace")]),e._v(" "),a("li",[e._v("Support for SQL Concat and Replace (in the mappings)")]),e._v(" "),a("li",[e._v("Support for xsd:dateTimeStamp")]),e._v(" "),a("li",[e._v("Improved Optimization techniques (Contribution by Roman Konchakov)")]),e._v(" "),a("li",[e._v("Implementation of Autoclosable interface for core classes in the API\nto support `try with resource`.")]),e._v(" "),a("li",[e._v("Create a sub-query when SELECT DISTINCT is used in the mappings.")]),e._v(" "),a("li",[e._v("Bug Fixes\n"),a("ul",[a("li",[e._v("Handle the 30-characters limit for variable names in Oracle.")]),e._v(" "),a("li",[e._v("Fix the mapping render of Protege when multiple subjects are in\nthe target of mapping.")])])])]),e._v(" "),a("h2",{attrs:{id:"_1-14-0-november-4-2014"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-14-0-november-4-2014"}},[e._v("#")]),e._v(" 1.14.0 (November 4, 2014)")]),e._v(" "),a("ul",[a("li",[e._v("Added support in ontology and mappings for datatypes xsd:int,\nxsd:long, xsd:positiveInteger, xsd:negativeInteger,\nxsd:nonPositiveInteger, xsd:nonNegativeInteger, xsd:float")]),e._v(" "),a("li",[e._v("Optimized implementations of TBox classifications, and query\ncontainment checking, which are much faster than before")]),e._v(" "),a("li",[e._v("Validation for Sesame Workbench made stronger. It prevents\nrepositories with an invalid configuration to be created.")]),e._v(" "),a("li",[e._v("Bug Fixes:\n"),a("ul",[a("li",[e._v("Fix SPARQL functions (str(), lang()) to use rdfs:Literal instead\nof xsd:string")]),e._v(" "),a("li",[e._v("Issue converting datatypes of R2RML constants")]),e._v(" "),a("li",[e._v("Support UNICODE characters in TurtleParser")]),e._v(" "),a("li",[e._v("Catch exceptions for Protege R2RML Export")]),e._v(" "),a("li",[e._v("Fix conversion from ontop mappings to R2RML of language tag and\ntriples")])])])]),e._v(" "),a("h2",{attrs:{id:"_1-13-1-september-29-2014"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-13-1-september-29-2014"}},[e._v("#")]),e._v(" 1.13.1 (September 29, 2014)")]),e._v(" "),a("ul",[a("li",[e._v("Bug Fixes:\n"),a("ul",[a("li",[e._v("The redundant query elimination optimization sometimes does not\nhandle facts properly")]),e._v(" "),a("li",[e._v("Some warning messages related to datatype range axioms are\nambiguous")])])])]),e._v(" "),a("h2",{attrs:{id:"_1-13-0-september-25-2014"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-13-0-september-25-2014"}},[e._v("#")]),e._v(" 1.13.0 (September 25, 2014)")]),e._v(" "),a("ul",[a("li",[e._v("Support for providing implicit DB Constraints (e.g. foreign keys) to\nOntop to generate efficient SQL")]),e._v(" "),a("li",[e._v("Command line feature to generate pretty R2RML")]),e._v(" "),a("li",[e._v("Stream output in the Protege Plugin")]),e._v(" "),a("li",[e._v("Support for Regex in mappings")]),e._v(" "),a("li",[e._v("Proper handling of datatypes in ontology and mappings")]),e._v(" "),a("li",[e._v("Support for hsql database")]),e._v(" "),a("li",[e._v("Support for datatypes xsd:date, xsd:time and xsd:gYear")]),e._v(" "),a("li",[e._v("Bug Fixes:\n"),a("ul",[a("li",[e._v("Issue with nested equivalences in unfolder")]),e._v(" "),a("li",[e._v("Problem with multiple join conditions in R2RML")]),e._v(" "),a("li",[e._v("Cancelling running queries in Protege")]),e._v(" "),a("li",[e._v("Blank lines in generated sql causes problems for oracle")])])])]),e._v(" "),a("h2",{attrs:{id:"_1-12-0-june-26-2014"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-12-0-june-26-2014"}},[e._v("#")]),e._v(" 1.12.0 (June 26, 2014)")]),e._v(" "),a("ul",[a("li",[e._v("Support for finding empty concepts and properties")]),e._v(" "),a("li",[e._v("Integration with a new R2RML API")]),e._v(" "),a("li",[e._v("Less restrictive mode for JDBC driver validation")]),e._v(" "),a("li",[e._v("Faster TBox reasoner implementation")]),e._v(" "),a("li",[e._v('Optional "Replace" Statement in the SQL translation. When\n"Replace" is off the SQL performs much better.')]),e._v(" "),a("li",[e._v("Several Bug Fixes:\n"),a("ul",[a("li",[e._v("Issue with 'true' in Oracle")]),e._v(" "),a("li",[e._v("Meta-mapping editing in Protege")]),e._v(" "),a("li",[e._v("Problem with regex in Oracle")]),e._v(" "),a("li",[e._v("Several issues with R2RML")])])])]),e._v(" "),a("h2",{attrs:{id:"_1-11-0-february-19-2014"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-11-0-february-19-2014"}},[e._v("#")]),e._v(" 1.11.0 (February 19, 2014)")]),e._v(" "),a("ul",[a("li",[e._v("Support for Consistency Checking")]),e._v(" "),a("li",[e._v("Improved Performance")]),e._v(" "),a("li",[e._v("Support for Multi-schema queries")]),e._v(" "),a("li",[e._v("New SQL parser for the mapping based on JSQLParser.")]),e._v(" "),a("li",[e._v("Extended the supported SQL language: IN, BETWEEN, LIKE, etc.")]),e._v(" "),a("li",[e._v("Extended the supported SPARQL: BIND")]),e._v(" "),a("li",[e._v("Improved the Treewitness rewriting algorithm.")]),e._v(" "),a("li",[e._v("Upgraded to Sesame 2.7.10")]),e._v(" "),a("li",[e._v("General clean-up")]),e._v(" "),a("li",[e._v("Fixed a number of bugs:\n"),a("ul",[a("li",[e._v("Translation of SAPRQL REGEX into SQL")]),e._v(" "),a("li",[e._v("Infinite loop triggered by some nested Optionals")]),e._v(" "),a("li",[e._v("Several issues with Construct")]),e._v(" "),a("li",[e._v("Several issues with R2RML")])])])]),e._v(" "),a("h2",{attrs:{id:"_1-10-0-december-16-2013"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-10-0-december-16-2013"}},[e._v("#")]),e._v(" 1.10.0 (December 16, 2013)")]),e._v(" "),a("ul",[a("li",[e._v("Ontop under Apache license")]),e._v(" "),a("li",[e._v("Ontop packages in central maven repository")])]),e._v(" "),a("h2",{attrs:{id:"_1-9-0-september-18-2013"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-9-0-september-18-2013"}},[e._v("#")]),e._v(" 1.9.0 (September 18, 2013)")]),e._v(" "),a("ul",[a("li",[e._v("Update to Sesame 2.7.6 (latest)")]),e._v(" "),a("li",[e._v("Validation of datatypes w.r.t. XMLSchema specification")]),e._v(" "),a("li",[e._v("New hybrid Abox functionality support")]),e._v(" "),a("li",[e._v("Removed all dependencies to Jena")]),e._v(" "),a("li",[e._v("Removed wrong/unnecessary dependencies")]),e._v(" "),a("li",[e._v("Turtle parser can handle variables in the predicate")]),e._v(" "),a("li",[e._v("Mappings with URI templates in class or properties suppot")]),e._v(" "),a("li",[e._v("First version of mapping splitter")]),e._v(" "),a("li",[e._v("Bug fix: Null pointer exception when the URI in Protege plugin was\nempty")]),e._v(" "),a("li",[e._v("Bug fix: Literal and literal with language tag handling")]),e._v(" "),a("li",[e._v("Bug fix: Shutdown of Sesame repoConnection")]),e._v(" "),a("li",[e._v("Bug fix: Object column literal gerenation in R2RML")]),e._v(" "),a("li",[e._v("Bug fix: Queries that would not finish execution")]),e._v(" "),a("li",[e._v("Bug fix: Unexpected bindings in unfolder")]),e._v(" "),a("li",[e._v("Bug fix: Null pointer exception in ontology translation in the case\nof unsupported axiom")]),e._v(" "),a("li",[e._v("Bug fix: OWL class assertion generation, inverted arguments")]),e._v(" "),a("li",[e._v("Bug fix: SameTerm in sparql algebra to datalog translation")]),e._v(" "),a("li",[e._v("Bug fix: URI template matcher to find most specific matches first")]),e._v(" "),a("li",[e._v("Bug fix: Construct queries")]),e._v(" "),a("li",[e._v("Bug fix: Describe queries")])]),e._v(" "),a("h2",{attrs:{id:"_1-8-0-july-29-2013"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-8-0-july-29-2013"}},[e._v("#")]),e._v(" 1.8.0 (July 29, 2013)")]),e._v(" "),a("ul",[a("li",[e._v("Improve error message and better exception handling.")]),e._v(" "),a("li",[e._v("Change the representation of "),a("code",[e._v("null")]),e._v(" value in BindingSet")]),e._v(" "),a("li",[e._v("Modified the computation of the LeftJoin to support empty evaluation\nin its second argument.")]),e._v(" "),a("li",[e._v("Changed the type of the semantic index table for integer data\nproperty assertion from INT to BIGINT to be able to handle\n"),a("code",[e._v("xsd:integer")]),e._v(" type")]),e._v(" "),a("li",[e._v("Set index creation during Quest startup")]),e._v(" "),a("li",[e._v("Implement new feature for bootstrapping, command line scripts,\nintegration in ontoPro plugin")]),e._v(" "),a("li",[e._v("Updated the URI templates in Turtle mapping syntax to make it\nsimpler and closer to Turtle. Now quotes, question marks and\nclass/property declarations are no longer required")])]),e._v(" "),a("p",[e._v("For example, in the previous syntax:")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",[a("code",[e._v(' <"test;person/{?id}"> a :MyClass; :hasName {?name}.\n')])])]),a("p",[e._v("becomes simply")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",[a("code",[e._v(" test:person/{id} a :MyClass ; :hasName {name} .\n")])])]),a("ul",[a("li",[e._v('Support "%", "=", ";" characters in the URI template.')])]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",[a("code",[e._v(" :class/{id};{name}%{class type}\n")])])]),a("ul",[a("li",[e._v("Bug fix: Major bugs in execution handling SPARQL Construct and\nSPARQL Describe queries.")]),e._v(" "),a("li",[e._v("Bug fix: Issues related to commits and batch sizes in\nQuestOWLStatement")]),e._v(" "),a("li",[e._v("Bug fix: Issue with URI template matcher that generates "),a("code",[e._v("null")]),e._v(' in\ncase failed template (now it generates URI("xxxx") where xxx is\nthe URI that was being matched.)')]),e._v(" "),a("li",[e._v("Bug fix: Issue in existential clause in tree-witness algorithm")]),e._v(" "),a("li",[e._v("Bug fix: Issue in the maximum size of URI that has more than 400\ncharacters")]),e._v(" "),a("li",[e._v("Bug fix: Issue in some data that can not be tracked when inserted\ninto the database. In particular if the data comes from\nclasses/properties that were simplified by the equivalence\nresolution.")]),e._v(" "),a("li",[e._v("Bug fix: Issue in exception handling during index creation in\nsemantic index test.")]),e._v(" "),a("li",[e._v("Bug fix: Issue in SQL parser that it doesn't capture the scope\nwithin parentheses in the WHERE clause.")]),e._v(" "),a("li",[e._v("Remove table and column identifier quotes in the SQL target query\nstring so that the parser can parse properly. For example:")])]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",[a("code",[e._v(' SELECT "Student"."sid" from "Student"\n')])])]),a("p",[e._v("will become:")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",[a("code",[e._v(" SELECT Student.sid from Student\n")])])]),a("ul",[a("li",[e._v("New semantic index implementation with integer references for URIs\nfor faster query answering (faster joins on integers instead of\nstrings)")])]),e._v(" "),a("p",[a("strong",[e._v("Ontop source code")])]),e._v(" "),a("ul",[a("li",[e._v("Ontop is now in GitHub!")]),e._v(" "),a("li",[e._v("Cleaner and slimmer project structure. We removed obsolete classes\nand tests.")]),e._v(" "),a("li",[e._v("Code refactor in Materialiser API, MinimalCQProducer and\nConstruct-Describe query execution.")]),e._v(" "),a("li",[e._v("More complete test cases for testing Quest features, e.g.,\nTree-Witness rewriting, Data materialiser, SQL parser, SPARQL\nConstruct, SPARQL Describe, SPARQL Optional, Database metadata and\nQuery completeness.")]),e._v(" "),a("li",[e._v("Support JUnit4 test cases.")])]),e._v(" "),a("h2",{attrs:{id:"_1-7-alpha2-rev-2305-april-5-2013"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-7-alpha2-rev-2305-april-5-2013"}},[e._v("#")]),e._v(" 1.7-alpha2 (rev 2305, April 5, 2013)")]),e._v(" "),a("ul",[a("li",[e._v("Support for importing/exporting R2RML mappings")]),e._v(" "),a("li",[e._v('Support for automated mapping generation as defined by the "Direct\nMapping" W3C specification')]),e._v(" "),a("li",[e._v("Various options for data materialization (similar to dump-rdf in\nD2RQ)")]),e._v(" "),a("li",[e._v("Support for concurrent queries in the SPARQL endpoint through\nconnection pooling")]),e._v(" "),a("li",[e._v("Better support for Oracle, Postgres, SQL Server and DB2")]),e._v(" "),a("li",[e._v("Improved the SQL queries generated by Quest by avoiding some\noperations when unnecessary (e.g., casting), and placing optimally\nthe JOIN conditions in the SQL query.")])]),e._v(" "),a("h2",{attrs:{id:"_1-7-alpha2-rev-2178-february-7-2013"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-7-alpha2-rev-2178-february-7-2013"}},[e._v("#")]),e._v(" 1.7-alpha2 (rev 2178, February 7, 2013)")]),e._v(" "),a("p",[a("strong",[e._v("-ontopQuest-")])]),e._v(" "),a("ul",[a("li",[e._v("Mapping optimiser: improved the generation of OR mappings")]),e._v(" "),a("li",[e._v("Mapping optimiser: improved the simplification of mappings using\nFOREIGN KEYS")]),e._v(" "),a("li",[e._v("Query optimiser: Improved the query optimiser to avoid generation of\nredundant JOINs and redundant UNIONs w.r.t. FOREIGN KEYs")]),e._v(" "),a("li",[e._v("Support percent encoding in strings in URI templates as defined by\nthe R2RML standard.")]),e._v(" "),a("li",[e._v("Better propagation of Exception messages in the Sesame provider")]),e._v(" "),a("li",[e._v("New "),a("strong",[e._v("scripts for querying quest")]),e._v(" from the command line")])]),e._v(" "),a("p",[a("strong",[e._v("-ontopPro- plugin")])]),e._v(" "),a("ul",[a("li",[a("strong",[e._v("Introducing mapping assistant")]),e._v(". A new GUI-based tool for creating\nmappings. This is an experimental GUI to help you create mappings in\na faster way, please help us improve it by reporting any issues you\nmay find. (See "),a("a",{attrs:{href:"ObdalibPluginMappingAssistant",title:"wikilink"}},[e._v("\nguideliness")]),e._v(").")]),e._v(" "),a("li",[e._v('Users can set the max number of tuples returned in "OBDA Query"\ntab.')])]),e._v(" "),a("p",[a("strong",[e._v("Mapping language features (-ontopQuest- and -ontopCore-)")])]),e._v(" "),a("ul",[a("li",[e._v("Support URI identifier obtained directly from the database (no using\nURI template).")]),e._v(" "),a("li",[e._v("Support multiple lines when wrting SQL source query (See "),a("a",{attrs:{href:"ObdalibObdaFile#SourceandMappingDeclaration",title:"wikilink"}},[e._v(" feature\nnotes")]),e._v(")")])]),e._v(" "),a("p",[a("strong",[e._v("Bug fixes")])]),e._v(" "),a("ul",[a("li",[e._v("Bug fix: Issue with MySQL and UTF8 characters (Korean in particular)")]),e._v(" "),a("li",[e._v('Bug fix: Issue with "unbound variable freshX_X found while\ngenerating SQL" fixed.')]),e._v(" "),a("li",[e._v("Bug fix: Inverse minimum cardinality assertion was being ignored.")]),e._v(" "),a("li",[e._v("Bug fix: Source SQL query doesn't accept parenthesis in WHERE\nclause.")]),e._v(" "),a("li",[e._v("Bug fix: JDBC connection doesn't recover when connection lost.")]),e._v(" "),a("li",[e._v("Bug fix: Sesame virtual repository fails to read Quest preferences.")]),e._v(" "),a("li",[e._v("Bug fix: CSV export function only exports 101 tuples instead of all\nthe tuples.")]),e._v(" "),a("li",[e._v("Bug fix: Null pointer exception in the query result table.")])]),e._v(" "),a("h2",{attrs:{id:"_1-7-alpha-rev-2039-december-30-2012"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-7-alpha-rev-2039-december-30-2012"}},[e._v("#")]),e._v(" 1.7-alpha (rev 2039, December 30, 2012)")]),e._v(" "),a("p",[a("strong",[e._v("SPARQL support")])]),e._v(" "),a("ul",[a("li",[e._v("Support for most SPARQL built in functions, e.g., arithmetics, type\nchecking, etc.")]),e._v(" "),a("li",[e._v("Support for CONSTRUCT and DESCRIBE result forms")]),e._v(" "),a("li",[e._v("Support for OPTIONAL and bound, which allow you to have NEGATION in\nthe usual SPARQL 1.0 style.")]),e._v(" "),a("li",[e._v('Support for variables in ANY position, e.g., to allow queries such\nas SELECT ?p ?v WHERE { ?x :name "John Smith". ?x ?p ?v }')]),e._v(" "),a("li",[e._v("Stronger compliance to standard RDF and SPARQL semantics for FILTER\nexpressions")])]),e._v(" "),a("p",[a("strong",[e._v("Performance")])]),e._v(" "),a("ul",[a("li",[e._v("Multiple improvements to the SPARQL-to-rule translation, mapping and\nTBox optimization algorithms.")]),e._v(" "),a("li",[e._v("New algorithm for query rewriting w.r.t. the TBox that increases the\nperformance of query answering by many orders of magnitude when\ninference w.r.t. to existential constants is enabled. The\nimplementation has been contributed by Dr. Roman Kontchakov.")]),e._v(" "),a("li",[e._v("New benchmarks. We tested against Virtuoso triple store, Virtuoso\nRDF views and D2R Server using the BSBM and FishMark benchmarks.")])]),e._v(" "),a("p",[a("strong",[e._v("APIs and Accessibility")])]),e._v(" "),a("ul",[a("li",[e._v('Completely new Sesame API provider, now users of Sesame can create\n"Virtual RDF repositories" with -ontop-')]),e._v(" "),a("li",[e._v("SPARQL end-point support through integration with Sesame's\nworkbench")])]),e._v(" "),a("p",[a("strong",[e._v("Mapping language")])]),e._v(" "),a("ul",[a("li",[e._v('Improved support for default literal types, now it conforms with the\nR2RML "Natural Mapping" specification')]),e._v(" "),a("li",[e._v("Support for language tags obtained from the DB")]),e._v(" "),a("li",[e._v("Proper support for constants in the mappings")]),e._v(" "),a("li",[e._v("Proper internal handling of NULL values in the database (as\nrecommended by the R2RML standard)")])]),e._v(" "),a("p",[a("strong",[e._v("Database support")])]),e._v(" "),a("ul",[a("li",[e._v("Restored support for Oracle, DB2 and SQL Server")]),e._v(" "),a("li",[e._v("Improved support and performance over MySQL")])]),e._v(" "),a("p",[a("strong",[e._v("Documentation")])]),e._v(" "),a("ul",[a("li",[e._v("Revised and extended all technical documentation")])]),e._v(" "),a("h2",{attrs:{id:"_1-7-alpha-rev-1692-august-16-2012"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-7-alpha-rev-1692-august-16-2012"}},[e._v("#")]),e._v(" 1.7-alpha-rev-1692 (August 16, 2012)")]),e._v(" "),a("p",[a("strong",[e._v("-ontop- general")])]),e._v(" "),a("ul",[a("li",[e._v("New file content for the OBDA output file. The file is no longer in\nXML format but instead it uses plain text for simplicity (Issue:\n#244).")]),e._v(" "),a("li",[e._v("Improved error messages when the system initializes, parses\nmappings, fails to")])]),e._v(" "),a("p",[a("code",[e._v("execute queries, etc.")]),a("br"),e._v(" "),a("code")]),e._v(" "),a("p",[a("strong",[e._v("-ontopPro- Protege plugin")])]),e._v(" "),a("ul",[a("li",[e._v("Support Protégé 4.2")]),e._v(" "),a("li",[e._v("Add cancel button during query execution to terminate the process\nimmediately.")]),e._v(" "),a("li",[e._v("Add help button to guide filling data source parameters.")]),e._v(" "),a("li",[e._v("The plugin no longer introduces prefix definitions")]),e._v(" "),a("li",[e._v('Implemented "Cancel" function for query execution')]),e._v(" "),a("li",[e._v("New shortcut CONTROL + T to test mappings in the mapping creator")]),e._v(" "),a("li",[e._v("Fixed several issues with prefix management and rendering of")])]),e._v(" "),a("p",[a("code",[e._v("URIs short forms")])]),e._v(" "),a("ul",[a("li",[e._v("Improved GUI, hints and suggestions for JDBC connections, improved\nTAB navigation")])]),e._v(" "),a("p",[a("code",[e._v("in all dialogs")])]),e._v(" "),a("ul",[a("li",[e._v("Bug fix: Improve error reporting and stack trace printing (Issue:\n#255, #262)")]),e._v(" "),a("li",[e._v("Bug fix: The target and source string got saved partially if\nnewlines are used.")]),e._v(" "),a("li",[e._v("Bug fix: The OBDA model doesn't get loaded if the query has an\nexception.")]),e._v(" "),a("li",[e._v("Improved error management during .obda and query file load")]),e._v(" "),a("li",[e._v("Fixed null pointer exception and blank window that appear in cases\nwhere the .owl file")])]),e._v(" "),a("p",[a("code",[e._v("in OWL/RDF contained different default ns and a default prefix")])]),e._v(" "),a("p",[a("strong",[e._v("-ontopQuest- OWL Reasoner")])]),e._v(" "),a("ul",[a("li",[e._v("Added support for SPARQL query modifiers: ORDER BY, OFFSET and LIMIT\n(Issue: #261).")]),e._v(" "),a("li",[e._v("Add query caching to speed up the system performance, now repeated\nquery execution will not require SQL generation every time.")]),e._v(" "),a("li",[e._v("Relaxed on punning checks to allow loading of DBPedia and similar\nontologies.")]),e._v(" "),a("li",[e._v("EXPERIMENTAL: Added support for mixed ABoxes for class assertions,\ni.e., most data comes from the mappings but a bit of data is also\nallowed in the ABox, e.g., global facts Planet('mars')")]),e._v(" "),a("li",[e._v("Improved support for MySQL, Postgres, DB2 and SQL Server dialects")]),e._v(" "),a("li",[e._v("Added a warnings when axioms are being ignored because of being out\nof OWL 2 QL")]),e._v(" "),a("li",[e._v("Improved error reporting on failed connections")]),e._v(" "),a("li",[e._v("Improved support for SQL AS for table and column renaming in\nmappings")]),e._v(" "),a("li",[e._v("New way to generate SQL. SQL now includes typing information and is\npretty printed.")]),e._v(" "),a("li",[e._v("Bug fix: Fixed issue with INVALID URI that appeared when mappings\nused data that contained invalid characters for URI's (e.g., white\nspace) Now we call URIEncode (Jena's) before returning the value.")]),e._v(" "),a("li",[e._v("Bug fix: Exception when importing data as ABox individuals.")]),e._v(" "),a("li",[e._v("Bug fix: Exception when null values is used as constants.")]),e._v(" "),a("li",[e._v("Bug fix: Exception if ambiguous column names are used in SQL\nqueries.")]),e._v(" "),a("li",[e._v("Bug fix: Wrong URI shorten if there are two or more namespaces with\noverlapping strings.")]),e._v(" "),a("li",[e._v("Bug fix: Null pointer exception due to inconsistent OBDA model\nidentifier string.")]),e._v(" "),a("li",[e._v("Bug fix: Unknown signature in the SELECT clause if the name is a\nqualified name and it comes from a view (Issue: #259)")]),e._v(" "),a("li",[e._v("Bug fix: Exception when using URIs as a constant values in SPARQL.")]),e._v(" "),a("li",[e._v("Bug fix: Prefix Manager accepts any string including invalid prefix\nnames.")])]),e._v(" "),a("p",[e._v("Known issues:")]),e._v(" "),a("ul",[a("li",[e._v("The ORDER BY modifier is not ready for columns with literal datatype")]),e._v(" "),a("li",[e._v("Issues with MySQL in non-ANSI mode")]),e._v(" "),a("li",[e._v("DateTime data properties in Oracle can crash the system.")])]),e._v(" "),a("h2",{attrs:{id:"_1-7-alpha-rev-1529-june-12-2012"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-7-alpha-rev-1529-june-12-2012"}},[e._v("#")]),e._v(" 1.7-alpha-rev-1529 (June 12, 2012)")]),e._v(" "),a("p",[a("strong",[e._v("-ontopPro- plugin")])]),e._v(" "),a("ul",[a("li",[e._v("Better layout, fonts and command icons.")]),e._v(" "),a("li",[e._v("Better query saving mechanism (Issue: #248)")]),e._v(" "),a("li",[e._v("Better error reporting to users and crash handling (Issue:\n#255, 256)")]),e._v(" "),a("li",[e._v("Pretty printing of SQL queries (Issue: #254)")]),e._v(" "),a("li",[e._v("Re-enabled the export function in the Query Interface panel (Issue:\n#213, #250)")]),e._v(" "),a("li",[e._v("Improved syntax-error messages in the mapping editor tooltip")]),e._v(" "),a("li",[e._v("Cleaned console messages")]),e._v(" "),a("li",[e._v('Added "Number of sources" indicator to show how many sources are\nalready declared in the OBDA model.')]),e._v(" "),a("li",[e._v("Improved ESC and CONTROL+ENTER shortcuts in most dialogs in the GUI.")]),e._v(" "),a("li",[e._v("Replaced JDBC Driver text box with an editable Combo Box with\ndefault driver string.")]),e._v(" "),a("li",[e._v("Better OBDA statistics table (Issue: #251)")]),e._v(" "),a("li",[e._v("Bug fix: CRITICAL stability issue that would rise an end-less cycle\nof warning messages when Quest crashed.")]),e._v(" "),a("li",[e._v('Bug fix: issue with final dot "." in mappings.')])]),e._v(" "),a("p",[a("strong",[e._v("-ontopQuest-")])]),e._v(" "),a("ul",[a("li",[e._v("Added support for data-type UUIDs for SQL Server (Issue: #253)")]),e._v(" "),a("li",[e._v("Now we create forward-only and concur-read-only JDBC Statements by\ndefault to allow for server side cursors.")]),e._v(" "),a("li",[e._v("Bug fix: issue with SQL parser and table renamings in SQL queries\n(Issue: #259)")]),e._v(" "),a("li",[e._v("Bug fix: issue with NULL pointer when primary key optimization in\nunfolding when there is a join on primary condition but atoms are\nnot unifiable.")])]),e._v(" "),a("p",[e._v("Known issues:")]),e._v(" "),a("ul",[a("li",[e._v("Oracle is unstable")])]),e._v(" "),a("h2",{attrs:{id:"_1-7-alpha-rev-1479-may-22-2012"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-7-alpha-rev-1479-may-22-2012"}},[e._v("#")]),e._v(" 1.7-alpha-rev-1479 (May 22, 2012)")]),e._v(" "),a("p",[e._v("Quest performance and features:")]),e._v(" "),a("ul",[a("li",[e._v("T-Mappings algorithm optimization: Combine disjunctive conditions in\nOR clauses instead of multiple mappings. This reduces the size of\nthe final query and improves its performance. (Issue: #237)")])]),e._v(" "),a("p",[e._v("Mapping language features (Quest and ontopCore):")]),e._v(" "),a("ul",[a("li",[e._v("Support using IS NULL and IS NOT NULL in SQL query (Issue: #200).")]),e._v(" "),a("li",[e._v("Support using UNION in SPARQL queries.")])]),e._v(" "),a("p",[e._v("Bug Fixes:")]),e._v(" "),a("ul",[a("li",[e._v("Fix packing problem in Windows XP (Issue: #228)")]),e._v(" "),a("li",[e._v("Fix packing problem in Linux")]),e._v(" "),a("li",[e._v("Fix unresponsive plugin when using mapping filter (Issue: #217).")]),e._v(" "),a("li",[e._v("Fix unresponsive plugin when inserting a new mapping (Issue: #232).")]),e._v(" "),a("li",[e._v("Fix support for MySQL in both virtual and classic mode (Issue:\n#238).")]),e._v(" "),a("li",[e._v("Fix support for Oracle in virtual mode (Issue: #226).")]),e._v(" "),a("li",[e._v('Fix issue where creating or modifying a mapping would not trigger a\n"ontology out of synch" flag.')])]),e._v(" "),a("p",[e._v("Known Issue:")]),e._v(" "),a("ul",[a("li",[e._v("Oracle still has some issues in classic mode.")])]),e._v(" "),a("h2",{attrs:{id:"_1-7-alpha-rev-1446-may-4-2012"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-7-alpha-rev-1446-may-4-2012"}},[e._v("#")]),e._v(" 1.7-alpha-rev-1446 (May 4, 2012)")]),e._v(" "),a("p",[e._v("Mapping language features (Quest and ontopCore):")]),e._v(" "),a("ul",[a("li",[e._v("Add support on writing qualified name for atom predicates.")]),e._v(" "),a("li",[e._v("Add coloring for atoms typed Individual in the target query.")])]),e._v(" "),a("p",[e._v("Bug Fixes:")]),e._v(" "),a("ul",[a("li",[e._v('Fix the "Show Short URIs" feature in the query panel.')])]),e._v(" "),a("h2",{attrs:{id:"_1-7-alpha-rev-1440-may-2-2012"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-7-alpha-rev-1440-may-2-2012"}},[e._v("#")]),e._v(" 1.7-alpha-rev-1440 (May 2, 2012)")]),e._v(" "),a("p",[e._v("Mapping language features (Quest and ontopCore):")]),e._v(" "),a("ul",[a("li",[e._v("Support writing URI constants in target queries (Issue: #227)")])]),e._v(" "),a("p",[e._v("General:")]),e._v(" "),a("ul",[a("li",[e._v("Better system logging for recording exceptions.")])]),e._v(" "),a("p",[e._v("Bug Fixes:")]),e._v(" "),a("ul",[a("li",[e._v("Fix the null pointer exception due to the old OBDA preferences.")]),e._v(" "),a("li",[e._v("Fix bugs related to vocabulary prefixes.")])]),e._v(" "),a("h2",{attrs:{id:"_1-7-alpha-rev-1427-april-17-2012"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-7-alpha-rev-1427-april-17-2012"}},[e._v("#")]),e._v(" 1.7-alpha-rev-1427 (April 17, 2012)")]),e._v(" "),a("p",[e._v("Quest performance and features:")]),e._v(" "),a("ul",[a("li",[e._v("Implemented the T-Mappings mapping optimization algorithm improved\nperformance of query rewriting in Virtual Mode. Now query rewriting\nis as fast in virtual ABox mode as in classic ABox mode (Issue:\n#169)")]),e._v(" "),a("li",[e._v("Implemented a new query containment algorithm that is many times\nfaster than before.")]),e._v(" "),a("li",[e._v("Added data source analysis to obtain DB metadata for SQL query\ngeneration.")]),e._v(" "),a("li",[e._v("Added analysis of SQL queries in the mappings to produce better SQL\nqueries.")]),e._v(" "),a("li",[e._v("Added "),a("strong",[e._v("SQL JOIN ELIMINATION")]),e._v(" using PRIMARY KEY metadata.")]),e._v(" "),a("li",[e._v("Added mappings optimization using query containment w.r.t.\nconstraints")]),e._v(" "),a("li",[e._v("Added initial support for "),a("strong",[e._v("FILTER")])]),e._v(" "),a("li",[e._v("Added support for typed constants in SPARQL queries (Issue: #157)")]),e._v(" "),a("li",[e._v("Small updates to internal API for speed of equality, hash and clone\ncomputation")])]),e._v(" "),a("p",[e._v("Mapping language features (Quest and ontopCore):")]),e._v(" "),a("ul",[a("li",[e._v("New Turtle-like syntax for mappings allows for more succinct and\neasy to read mappings.")]),e._v(" "),a("li",[e._v("Added support for LANGUAGE tag for the Literal datatype (Issue:\n#198)")]),e._v(" "),a("li",[e._v("Added support for datatypes in the OBDA mapping axioms (Issue:\n#147, #194, #196)")]),e._v(" "),a("li",[e._v("Added URI templates for URI creation in mapping mapping axioms\n(Issue: #151)")]),e._v(" "),a("li",[e._v("New feature for typing literals in mapping axioms (Issue: #194,\n#207)")])]),e._v(" "),a("p",[e._v("General:")]),e._v(" "),a("ul",[a("li",[e._v("Added support for OWL API 3 (Issue: #98)")]),e._v(" "),a("li",[e._v("Internal refactoring of all modules and packages for a cleaner API")])]),e._v(" "),a("p",[e._v("ontopPro:")]),e._v(" "),a("ul",[a("li",[e._v("The plugin is now compatible with Protege 4.1 (Issue: #99)")]),e._v(" "),a("li",[e._v("The plugin has a new and fresh GUI display.")]),e._v(" "),a("li",[e._v("Stronger integration with Protege's refactoring mechanism")]),e._v(" "),a("li",[e._v("The ABox materializer can import data complete with datatype\ninformation (Issue: #195)")]),e._v(" "),a("li",[e._v("The target query use Turtle syntax for better display and management\n(Issue: #204)")]),e._v(" "),a("li",[e._v("The plugin has Class/Property panel for better navigation and\nfiltering.")])]),e._v(" "),a("p",[e._v("Bug Fixes:")]),e._v(" "),a("ul",[a("li",[e._v("Fixed a problem with the encoding of axioms of the form\nsubClassOf(Person, hasFather some Person)")]),e._v(" "),a("li",[e._v("Fixed issues with open and dead JDBC connections")]),e._v(" "),a("li",[e._v("Cleaned OWLReasoner synchronization issue")]),e._v(" "),a("li",[e._v("Fixed null pointer exceptions related to incorrect mappings")]),e._v(" "),a("li",[e._v("Proper error handling for translating an empty datalog program\n(Issue: #197)")]),e._v(" "),a("li",[e._v('Fixed the "Attach Prefixes" feature in the OBDA Query panel\n(Issue: #211)')]),e._v(" "),a("li",[e._v("Fixed issue regarding xsd:dateTime (Issue: #199)")])]),e._v(" "),a("h2",{attrs:{id:"_1-6-1-october-19-2011"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-6-1-october-19-2011"}},[e._v("#")]),e._v(" 1.6.1 (October 19, 2011)")]),e._v(" "),a("ul",[a("li",[e._v("Fast patch in the query translation module.")])]),e._v(" "),a("h2",{attrs:{id:"_1-6-october-18-2011"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-6-october-18-2011"}},[e._v("#")]),e._v(" 1.6 (October 18, 2011)")]),e._v(" "),a("ul",[a("li",[e._v("Allow fast navigation using TAB key in the new mapping form (Issue:\n#92)")]),e._v(" "),a("li",[e._v("Allow SQL query execution in the mapping tree (Issue: #104)")]),e._v(" "),a("li",[e._v("Improvement in the error message deliveries (Issues: #107, #112,\n#118)")]),e._v(" "),a("li",[e._v('Improvement in the data source management tab, including adding\n"Test Connection" button (Issues: #108, #111, #114)')]),e._v(" "),a("li",[e._v("Add OBDA model statistics report (Issues: #106, #117)")]),e._v(" "),a("li",[e._v("Add support for adding integrated data source in Teiid (Issue: #89)")]),e._v(" "),a("li",[e._v("Fix the unresponsive cancel button during importing OWL Individuals\n(Issue: #88)")]),e._v(" "),a("li",[e._v("Fix CSV header in the exported query result (Issue: #120)")]),e._v(" "),a("li",[e._v("Fix connection failure when users change the parameters (Issue:\n#121)")]),e._v(" "),a("li",[e._v("Fix the password field so now the text is hidden (Issue: #113)")]),e._v(" "),a("li",[e._v("Fix query selection in the OBDA query tab (Issue: #91)")]),e._v(" "),a("li",[e._v("Fix import failure when storing very long record values (Issue:\n#95)")]),e._v(" "),a("li",[e._v("Fix import failure when storing records that contain single quotes\n(Issue: #96)")])]),e._v(" "),a("h2",{attrs:{id:"_1-5-1-rc1-july-15-2011"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-5-1-rc1-july-15-2011"}},[e._v("#")]),e._v(" 1.5.1-RC1 (July 15, 2011)")]),e._v(" "),a("ul",[a("li",[e._v("Significant code refactoring in the plugin. This effort makes the\ncode easier to debug and to extend, and is almost ready for Protege\n4.1 and OWL-API 3.0 support.")]),e._v(" "),a("li",[e._v("Term renaming. Modified the term 'Mapping Head' to 'Target\nQuery' and 'Mapping Body' to 'Source Query' to maintain the\nconsistency with the literature.")]),e._v(" "),a("li",[e._v("Temporarly disabled the SPARQL query coloring.")]),e._v(" "),a("li",[e._v("Temporarly disabled the 'Load OWL Individuals into DB'\nfunctionality.")]),e._v(" "),a("li",[e._v("Add improved search filters in the mapping manager (Issues: #37,\n#54).")]),e._v(" "),a("li",[e._v("Add 'show short URIs' option in the query results to hide long URI\nstrings.")]),e._v(" "),a("li",[e._v("Add 'select all', 'select none', 'expand all' and 'collapse\nall' buttons for easy browsing in the mapping tree (Issues: #35,\n#36).")]),e._v(" "),a("li",[e._v("Add mapping validation with respect to the vocabulary in the\nontology (Issues: #42).")]),e._v(" "),a("li",[e._v("Add input validation to many parts of the GUI (Issues: #63, #64,\n#65, #67, #68, #69, #70, #71, #76).")]),e._v(" "),a("li",[e._v("Fix the save query functionality in the Query manager (Issues:\n#57).")]),e._v(" "),a("li",[e._v("Fix the persistency of user preferences when opening/closing Protege\n(Issues: #58).")]),e._v(" "),a("li",[e._v("Fix the exceptions that appeared when loading/saving/reloading\nontologies (Issues: #59, #60, #61, #75).")]),e._v(" "),a("li",[e._v("Fix problems with several progress dialogs in the GUI (Issues: #50,\n#87).")]),e._v(" "),a("li",[e._v("Fix problems in the 'tuple count' functionality (Issues: #82,\n#84).")])])])}),[],!1,null,null,null);t.default=i.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[61],{440:function(e,t,a){"use strict";a.r(t);var n=a(51),i=Object(n.a)({},(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[a("h1",{attrs:{id:"release-notes"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#release-notes"}},[e._v("#")]),e._v(" Release notes")]),e._v(" "),a("h2",{attrs:{id:"_5-1-1-november-22-2023"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-1-1-november-22-2023"}},[e._v("#")]),e._v(" 5.1.1 (November 22, 2023)")]),e._v(" "),a("h4",{attrs:{id:"new-features"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#new-features"}},[e._v("#")]),e._v(" New features")]),e._v(" "),a("ul",[a("li",[e._v("Option to expose system tables added "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/744",target:"_blank",rel:"noopener"}},[e._v("#744"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Standard deviation and variance functions added "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/735",target:"_blank",rel:"noopener"}},[e._v("#735"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Option to disable the registration of custom SPARQL aggregation functions "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/746",target:"_blank",rel:"noopener"}},[e._v("#746"),a("OutboundLink")],1)])]),e._v(" "),a("h4",{attrs:{id:"bug-fixes"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#bug-fixes"}},[e._v("#")]),e._v(" Bug fixes")]),e._v(" "),a("p",[e._v("See "),a("a",{attrs:{href:"https://github.com/ontop/ontop/milestone/23?closed=1",target:"_blank",rel:"noopener"}},[e._v("https://github.com/ontop/ontop/milestone/23?closed=1"),a("OutboundLink")],1)]),e._v(" "),a("h2",{attrs:{id:"_5-1-0-august-15-2023"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-1-0-august-15-2023"}},[e._v("#")]),e._v(" 5.1.0 (August 15, 2023)")]),e._v(" "),a("h4",{attrs:{id:"new-features-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#new-features-2"}},[e._v("#")]),e._v(" New features")]),e._v(" "),a("ul",[a("li",[e._v("Support for "),a("RouterLink",{attrs:{to:"/guide/advanced/lenses.html#flattenlens"}},[e._v("flatten lenses")]),e._v(" added "),a("em",[e._v("(beta)")]),e._v(" "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/622",target:"_blank",rel:"noopener"}},[e._v("#622"),a("OutboundLink")],1),e._v(", "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/625",target:"_blank",rel:"noopener"}},[e._v("#625"),a("OutboundLink")],1),e._v(", "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/628",target:"_blank",rel:"noopener"}},[e._v("#628"),a("OutboundLink")],1),e._v(", "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/629",target:"_blank",rel:"noopener"}},[e._v("#629"),a("OutboundLink")],1),e._v(", "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/633",target:"_blank",rel:"noopener"}},[e._v("#633"),a("OutboundLink")],1),e._v(", "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/635",target:"_blank",rel:"noopener"}},[e._v("#635"),a("OutboundLink")],1),e._v(", "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/636",target:"_blank",rel:"noopener"}},[e._v("#636"),a("OutboundLink")],1),e._v(", "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/637",target:"_blank",rel:"noopener"}},[e._v("#637"),a("OutboundLink")],1),e._v(", "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/638",target:"_blank",rel:"noopener"}},[e._v("#638"),a("OutboundLink")],1),e._v(", "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/639",target:"_blank",rel:"noopener"}},[e._v("#639"),a("OutboundLink")],1),e._v(", "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/640",target:"_blank",rel:"noopener"}},[e._v("#640"),a("OutboundLink")],1),e._v(", "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/641",target:"_blank",rel:"noopener"}},[e._v("#641"),a("OutboundLink")],1),e._v(", "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/642",target:"_blank",rel:"noopener"}},[e._v("#642"),a("OutboundLink")],1),e._v(", "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/643",target:"_blank",rel:"noopener"}},[e._v("#643"),a("OutboundLink")],1),e._v(", "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/661",target:"_blank",rel:"noopener"}},[e._v("#661"),a("OutboundLink")],1),e._v(", "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/715",target:"_blank",rel:"noopener"}},[e._v("#715"),a("OutboundLink")],1)],1),e._v(" "),a("li",[e._v("Support for "),a("RouterLink",{attrs:{to:"/guide/advanced/lenses.html#unionlens"}},[e._v("union lenses")]),e._v(" added "),a("em",[e._v("(beta)")]),e._v(" "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/612",target:"_blank",rel:"noopener"}},[e._v("#612"),a("OutboundLink")],1)],1),e._v(" "),a("li",[e._v("Support for XSD cast functions added "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/630",target:"_blank",rel:"noopener"}},[e._v("#630"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Support for date-trunc and more date extraction functions added "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/705",target:"_blank",rel:"noopener"}},[e._v("#705"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Support for a separate RDF file for facts added "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/666",target:"_blank",rel:"noopener"}},[e._v("#666"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Options to ignore invalid mapping entries "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/631",target:"_blank",rel:"noopener"}},[e._v("#631"),a("OutboundLink")],1),e._v(" and lenses "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/709",target:"_blank",rel:"noopener"}},[e._v("#709"),a("OutboundLink")],1),e._v(" added")]),e._v(" "),a("li",[e._v("Partial support for regular expressions in SQL Server added "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/702",target:"_blank",rel:"noopener"}},[e._v("#702"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Support for DynamoDB using the CData connector added "),a("em",[e._v("(beta)")]),e._v(" "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/693",target:"_blank",rel:"noopener"}},[e._v("#693"),a("OutboundLink")],1)])]),e._v(" "),a("h4",{attrs:{id:"optimizations"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#optimizations"}},[e._v("#")]),e._v(" Optimizations")]),e._v(" "),a("ul",[a("li",[e._v("Upwards propagation of lens unique constraints added "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/668",target:"_blank",rel:"noopener"}},[e._v("#668"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Left join optimizations:\n"),a("ul",[a("li",[e._v("Reducing left joins to inner joins when the right child has a left join "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/662",target:"_blank",rel:"noopener"}},[e._v("#662"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Merging left joins nested on the left "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/663",target:"_blank",rel:"noopener"}},[e._v("#663"),a("OutboundLink")],1),e._v(", "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/686",target:"_blank",rel:"noopener"}},[e._v("#686"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Robustness to nullable joining columns "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/667",target:"_blank",rel:"noopener"}},[e._v("#667"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Pruning the right of a left join when not contributing")])])]),e._v(" "),a("li",[e._v("VALUES node decomposition added "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/680",target:"_blank",rel:"noopener"}},[e._v("#680"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Functional dependency inference added "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/681",target:"_blank",rel:"noopener"}},[e._v("#681"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Reduction of aggregation nodes with no aggregation functional terms to distinct added")]),e._v(" "),a("li",[e._v("Transitive closure of functional dependencies added "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/732",target:"_blank",rel:"noopener"}},[e._v("#732"),a("OutboundLink")],1)])]),e._v(" "),a("h4",{attrs:{id:"refactoring"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#refactoring"}},[e._v("#")]),e._v(" Refactoring")]),e._v(" "),a("ul",[a("li",[e._v("Substitutions refactored "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/616",target:"_blank",rel:"noopener"}},[e._v("#616"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Typing for math operators added "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/706",target:"_blank",rel:"noopener"}},[e._v("#706"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("QuotedIDFactory refactored "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/644",target:"_blank",rel:"noopener"}},[e._v("#644"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Removal of non-required variables improved "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/669",target:"_blank",rel:"noopener"}},[e._v("#669"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Support for the STRING datatype for DuckDB added "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/646",target:"_blank",rel:"noopener"}},[e._v("#646"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Support for SAMPLE at the database level added "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/660",target:"_blank",rel:"noopener"}},[e._v("#660"),a("OutboundLink")],1)])]),e._v(" "),a("h4",{attrs:{id:"bug-fixes-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#bug-fixes-2"}},[e._v("#")]),e._v(" Bug fixes")]),e._v(" "),a("ul",[a("li",[e._v("Support LIMIT/OFFSET in SQL Server improved "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/676",target:"_blank",rel:"noopener"}},[e._v("#676"),a("OutboundLink")],1),e._v(", "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/679",target:"_blank",rel:"noopener"}},[e._v("#679"),a("OutboundLink")],1),e._v(", "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/682",target:"_blank",rel:"noopener"}},[e._v("#682"),a("OutboundLink")],1),e._v(", "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/721",target:"_blank",rel:"noopener"}},[e._v("#721"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Extraction of unique constraints in Oracle made more consistent "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/695",target:"_blank",rel:"noopener"}},[e._v("#695"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Metadata extraction for DuckDB made more robust "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/687",target:"_blank",rel:"noopener"}},[e._v("#687"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Missing casts when using Bnode templates added "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/657",target:"_blank",rel:"noopener"}},[e._v("#657"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Invalid SPARQL UNION translation fixed "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/651",target:"_blank",rel:"noopener"}},[e._v("#651"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Empty results for CONSTRUCT queries with unions and different variables fixed "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/652",target:"_blank",rel:"noopener"}},[e._v("#652"),a("OutboundLink")],1)])]),e._v(" "),a("h4",{attrs:{id:"documentation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#documentation"}},[e._v("#")]),e._v(" Documentation")]),e._v(" "),a("ul",[a("li",[e._v("Dedicated pages for each supported database (for instance "),a("a",{attrs:{href:"https://ontop-vkg.org/guide/databases/athena",target:"_blank",rel:"noopener"}},[e._v("AWS Athena"),a("OutboundLink")],1),e._v(")")]),e._v(" "),a("li",[a("RouterLink",{attrs:{to:"/tutorial/lenses/"}},[e._v("Tutorial about lenses")])],1),e._v(" "),a("li",[a("a",{attrs:{href:"/tutorial/materialization/materialization"}},[e._v("Tutorial about materialization")])])]),e._v(" "),a("h2",{attrs:{id:"_5-0-2-march-9-2023"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-0-2-march-9-2023"}},[e._v("#")]),e._v(" 5.0.2 (March 9, 2023)")]),e._v(" "),a("h4",{attrs:{id:"new-features-3"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#new-features-3"}},[e._v("#")]),e._v(" New features")]),e._v(" "),a("ul",[a("li",[e._v("Support for Trino "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/599",target:"_blank",rel:"noopener"}},[e._v("#599"),a("OutboundLink")],1),e._v(", PrestoDB "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/601",target:"_blank",rel:"noopener"}},[e._v("#601"),a("OutboundLink")],1),e._v(", AWS Athena "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/602",target:"_blank",rel:"noopener"}},[e._v("#602"),a("OutboundLink")],1),e._v(", DuckDB "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/604",target:"_blank",rel:"noopener"}},[e._v("#604"),a("OutboundLink")],1),e._v(", AWS Redshift "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/605",target:"_blank",rel:"noopener"}},[e._v("#605"),a("OutboundLink")],1),e._v(" and Google BigQuery "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/615",target:"_blank",rel:"noopener"}},[e._v("#615"),a("OutboundLink")],1),e._v(" added")]),e._v(" "),a("li",[e._v("Declare some columns as IRI-safe in lenses "),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/587",target:"_blank",rel:"noopener"}},[e._v("#587"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Support for arbitrary JDBC properties added "),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/606",target:"_blank",rel:"noopener"}},[e._v("#606"),a("OutboundLink")],1)])]),e._v(" "),a("h4",{attrs:{id:"bugfixes"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#bugfixes"}},[e._v("#")]),e._v(" Bugfixes")]),e._v(" "),a("ul",[a("li",[e._v("Missing TLS cypher suite JRE modules added to the Docker image")]),e._v(" "),a("li",[e._v("More system schemas are now ignored in Oracle "),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/591",target:"_blank",rel:"noopener"}},[e._v("#591"),a("OutboundLink")],1)])]),e._v(" "),a("h4",{attrs:{id:"tooling"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#tooling"}},[e._v("#")]),e._v(" Tooling")]),e._v(" "),a("ul",[a("li",[a("a",{attrs:{href:"https://github.com/ontop/dialect-factory-scaffolding",target:"_blank",rel:"noopener"}},[e._v("Scaffolding tool"),a("OutboundLink")],1),e._v(" created to make it easier to implement a new SQL dialect adapter.")])]),e._v(" "),a("h2",{attrs:{id:"_5-0-1-january-29-2023"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-0-1-january-29-2023"}},[e._v("#")]),e._v(" 5.0.1 (January 29, 2023)")]),e._v(" "),a("h4",{attrs:{id:"new-feature"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#new-feature"}},[e._v("#")]),e._v(" New feature")]),e._v(" "),a("ul",[a("li",[e._v("DB metadata extraction for MS Access added "),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/589",target:"_blank",rel:"noopener"}},[e._v("#589"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("JRE-embedded Ontop-Protégé bundles with Protégé-5.6.0-beta-2 are now provided")])]),e._v(" "),a("h4",{attrs:{id:"refactoring-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#refactoring-2"}},[e._v("#")]),e._v(" Refactoring")]),e._v(" "),a("ul",[a("li",[e._v("Support for Spark SQL improved and tests added in the CI")]),e._v(" "),a("li",[e._v("All the tables (besides excluded ones) in Oracle are now extracted, not just the user's ones")])]),e._v(" "),a("p",[e._v("Several dependencies updated.")]),e._v(" "),a("h2",{attrs:{id:"_5-0-0-december-31-2022"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-0-0-december-31-2022"}},[e._v("#")]),e._v(" 5.0.0 (December 31, 2022)")]),e._v(" "),a("h4",{attrs:{id:"important-changes"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#important-changes"}},[e._v("#")]),e._v(" Important changes")]),e._v(" "),a("ul",[a("li",[e._v("Java 11 or newer is required")]),e._v(" "),a("li",[e._v("Ontop's Protégé plugin now requires at least Protégé 5.6-beta")]),e._v(" "),a("li",[e._v("RDF4J bindings updated to 4.1.0")]),e._v(" "),a("li",[e._v("The module "),a("code",[e._v("ontop-owlapi")]),e._v(" is not published anymore. We recommend using "),a("code",[e._v("ontop-rdf4j")]),e._v(" instead")]),e._v(" "),a("li",[e._v("RDF4J workbench modules removed")]),e._v(" "),a("li",[e._v("Docker image moved to "),a("a",{attrs:{href:"https://hub.docker.com/r/ontop/ontop",target:"_blank",rel:"noopener"}},[a("code",[e._v("ontop/ontop")]),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Ontop views renamed "),a("a",{attrs:{href:"/guide/advanced/lenses"}},[e._v("lenses")])])]),e._v(" "),a("h4",{attrs:{id:"new-features-4"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#new-features-4"}},[e._v("#")]),e._v(" New features")]),e._v(" "),a("ul",[a("li",[e._v("Support for SPARQL rules for the extending the VKG added "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/576",target:"_blank",rel:"noopener"}},[e._v("#576"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("The "),a("a",{attrs:{href:"https://hub.docker.com/r/ontop/ontop",target:"_blank",rel:"noopener"}},[e._v("Docker image"),a("OutboundLink")],1),e._v(" now also supported the ARM64 architecture and allows to run all the CLI commands "),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/532",target:"_blank",rel:"noopener"}},[e._v("#532"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Support for Snowflake added "),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/520",target:"_blank",rel:"noopener"}},[e._v("#520"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Support for MariaDB added "),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/271",target:"_blank",rel:"noopener"}},[e._v("#271"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("N-Triples and N-quads are now supported by the SPARQL endpoint "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/566",target:"_blank",rel:"noopener"}},[e._v("#566"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Option to fully reformulate the SPARQL query into SQL added "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/577",target:"_blank",rel:"noopener"}},[e._v("#577"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Experimental support for flatten lenses added (only for PostgreSQL)")])]),e._v(" "),a("h4",{attrs:{id:"new-optimizations"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#new-optimizations"}},[e._v("#")]),e._v(" New optimizations")]),e._v(" "),a("ul",[a("li",[e._v("Optimization of joins with a union of class definitions added "),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/543",target:"_blank",rel:"noopener"}},[e._v("#543"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Optimizations for generic queries with limit added "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/578",target:"_blank",rel:"noopener"}},[e._v("#578"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Optimization for queries retrieving all the properties or classes in use in the VKG added "),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/581",target:"_blank",rel:"noopener"}},[e._v("#581"),a("OutboundLink")],1)])]),e._v(" "),a("h4",{attrs:{id:"refactoring-3"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#refactoring-3"}},[e._v("#")]),e._v(" Refactoring")]),e._v(" "),a("ul",[a("li",[e._v("New module for testing dialects in the Github CI pipeline added "),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/568",target:"_blank",rel:"noopener"}},[e._v("#568"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("JSQLParser updated to 4.4")]),e._v(" "),a("li",[e._v("Ontop's Protégé plugin isolated from Ontop modules "),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/278",target:"_blank",rel:"noopener"}},[e._v("#278"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Support for Databricks (Apache Spark) improved")])]),e._v(" "),a("p",[e._v("Many bugfixes. See also "),a("a",{attrs:{href:"https://github.com/ontop/ontop/milestone/16?closed=1",target:"_blank",rel:"noopener"}},[e._v("its milestone on Github"),a("OutboundLink")],1),e._v(".")]),e._v(" "),a("h2",{attrs:{id:"_4-2-2-november-18-2022"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-2-november-18-2022"}},[e._v("#")]),e._v(" 4.2.2 (November 18, 2022)")]),e._v(" "),a("h4",{attrs:{id:"new-features-5"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#new-features-5"}},[e._v("#")]),e._v(" New features")]),e._v(" "),a("ul",[a("li",[e._v("Support for Protege 5.6-beta under Java 11 and Java 17")]),e._v(" "),a("li",[e._v("Support for the Databricks-specific JDBC driver "),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/554",target:"_blank",rel:"noopener"}},[e._v("#554"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Support for LIMIT/OFFSET in SQL Server 2008 "),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/531",target:"_blank",rel:"noopener"}},[e._v("#531"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Support for materialized views in PostgreSQL "),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/541",target:"_blank",rel:"noopener"}},[e._v("#541"),a("OutboundLink")],1)])]),e._v(" "),a("h4",{attrs:{id:"bugfixes-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#bugfixes-2"}},[e._v("#")]),e._v(" Bugfixes")]),e._v(" "),a("ul",[a("li",[e._v("VALUES handling with Teiid "),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/525",target:"_blank",rel:"noopener"}},[e._v("#525"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Metadata extraction for Dremio of schema names with dots")]),e._v(" "),a("li",[e._v("Typo in registration of Oracle factories "),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/557",target:"_blank",rel:"noopener"}},[e._v("#557"),a("OutboundLink")],1)])]),e._v(" "),a("p",[e._v("Preventive update of dependencies including Jackson and Gson to address potential vulnerabilities.")]),e._v(" "),a("h2",{attrs:{id:"_4-2-1-april-20-2022"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-1-april-20-2022"}},[e._v("#")]),e._v(" 4.2.1 (April 20, 2022)")]),e._v(" "),a("h4",{attrs:{id:"new-feature-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#new-feature-2"}},[e._v("#")]),e._v(" New feature")]),e._v(" "),a("ul",[a("li",[e._v("Support for partial serialized DB metadata, when "),a("code",[e._v("ontop.allowRetrievingBlackBoxViewMetadataFromDB")]),e._v(" is enabled.")])]),e._v(" "),a("h4",{attrs:{id:"bugfixes-3"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#bugfixes-3"}},[e._v("#")]),e._v(" Bugfixes")]),e._v(" "),a("ul",[a("li",[e._v("Not renamed variable in sub-query with a distinct ("),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/417",target:"_blank",rel:"noopener"}},[e._v("#417"),a("OutboundLink")],1),e._v(").")]),e._v(" "),a("li",[e._v("OBDA to R2RML conversion: require mapping entry IDs to be unique.")]),e._v(" "),a("li",[e._v("Lang tags for constants in R2RML were ignored.")]),e._v(" "),a("li",[e._v("Several fixes related to VALUES.")]),e._v(" "),a("li",[e._v("Better HTTP codes for the ontology download endpoint.")])]),e._v(" "),a("p",[e._v("The Jackson and Spring Boot dependencies have been preventively updated (to 2.13.2.2 and 2.6.6 respectively) to address potential vulnerabilities ("),a("a",{attrs:{href:"https://nvd.nist.gov/vuln/detail/CVE-2020-36518",target:"_blank",rel:"noopener"}},[e._v("CVE-2020-36518"),a("OutboundLink")],1),e._v(" and "),a("a",{attrs:{href:"https://nvd.nist.gov/vuln/detail/cve-2022-22965",target:"_blank",rel:"noopener"}},[e._v("CVE-2022-22965"),a("OutboundLink")],1),e._v(").")]),e._v(" "),a("h2",{attrs:{id:"_4-2-0-december-30-2021"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-0-december-30-2021"}},[e._v("#")]),e._v(" 4.2.0 (December 30, 2021)")]),e._v(" "),a("h4",{attrs:{id:"new-features-6"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#new-features-6"}},[e._v("#")]),e._v(" New features")]),e._v(" "),a("ul",[a("li",[e._v("Support for Apache Spark ("),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/422",target:"_blank",rel:"noopener"}},[e._v("#422"),a("OutboundLink")],1),e._v(").")]),e._v(" "),a("li",[e._v("Support for time functions added ("),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/478",target:"_blank",rel:"noopener"}},[e._v("#478"),a("OutboundLink")],1),e._v(").")]),e._v(" "),a("li",[e._v("Support for the "),a("code",[e._v("IN")]),e._v(" SPARQL function added.")]),e._v(" "),a("li",[e._v('Datatypes can be extracted from non-supported source queries in the mapping (treated internally as "black-box" views). Disabled by default (see '),a("a",{attrs:{href:"/guide/advanced/configuration"}},[a("code",[e._v("ontop.allowRetrievingBlackBoxViewMetadataFromDB")])]),e._v(").")]),e._v(" "),a("li",[e._v("TBox triples (e.g. sub-classes, domains and ranges) can be added to the default RDF graph. Disabled by default (see "),a("a",{attrs:{href:"/guide/advanced/configuration"}},[a("code",[e._v("ontop.enableFactExtractionWithTBox")])]),e._v(").")]),e._v(" "),a("li",[e._v("Support for "),a("a",{attrs:{href:"/guide/advanced/views"}},[e._v("Ontop join views")]),e._v(" added.")]),e._v(" "),a("li",[e._v("Support for arbitrary levels of Ontop views added (views over views).")]),e._v(" "),a("li",[e._v("Better integrity constraint extraction for Ontop basic and join views.")]),e._v(" "),a("li",[e._v("Non-null information can now be specified for Ontop views.")]),e._v(" "),a("li",[e._v("Support for b-node facts added.")]),e._v(" "),a("li",[e._v("The default query of the SPARQL endpoint portal is now configurable ("),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/454",target:"_blank",rel:"noopener"}},[e._v("#454"),a("OutboundLink")],1),e._v(").")]),e._v(" "),a("li",[e._v("Contextually injective IRI templates with numeric or UUID arguments are now decomposed ("),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/363",target:"_blank",rel:"noopener"}},[e._v("#363"),a("OutboundLink")],1),e._v(").")]),e._v(" "),a("li",[e._v("JSON-LD serialization now supported by the materializer ("),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/481",target:"_blank",rel:"noopener"}},[e._v("#481"),a("OutboundLink")],1),e._v(").")])]),e._v(" "),a("h4",{attrs:{id:"refactoring-4"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#refactoring-4"}},[e._v("#")]),e._v(" Refactoring")]),e._v(" "),a("ul",[a("li",[e._v("Support for Java >= 8. Ontop decoupled from Protégé so as to update several common libraries ("),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/467",target:"_blank",rel:"noopener"}},[e._v("#467"),a("OutboundLink")],1),e._v(").")]),e._v(" "),a("li",[e._v('RDF facts provided by the ontology file are now internally grouped together into values blocks (sorts of "in-memory tables") instead of being splitted into large unions. Enabled by default (see '),a("a",{attrs:{href:"/guide/advanced/configuration"}},[a("code",[e._v("ontop.enableValuesNode")])]),e._v(").")]),e._v(" "),a("li",[e._v("Unions are lifted above aggregations when possible.")]),e._v(" "),a("li",[e._v("Docker image updated to JRE 11.")]),e._v(" "),a("li",[e._v("Mutable intermediate queries are not used anymore.")]),e._v(" "),a("li",[e._v("Stronger handling of non well-designed "),a("code",[e._v("OPTIONAL")]),e._v(" blocks.")]),e._v(" "),a("li",[e._v("Stronger handling of "),a("code",[e._v("ORDER BY")]),e._v(" in sub-queries.")]),e._v(" "),a("li",[e._v("Type extractor relaxed ("),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/438",target:"_blank",rel:"noopener"}},[e._v("#438"),a("OutboundLink")],1),e._v(") to tolerate slightly different datatypes.")]),e._v(" "),a("li",[e._v("JDBC distinct result set removed.")]),e._v(" "),a("li",[e._v("JDBC user name and password are not required anymore. Useful when passed in the JDBC URL.")]),e._v(" "),a("li",[e._v("The Command-Line Interface of the bootstrapper has been refactored (invalid options removed, comments improved).")])]),e._v(" "),a("p",[e._v("Many bugfixes (see for instance "),a("a",{attrs:{href:"https://github.com/ontop/ontop/milestone/14?closed=1",target:"_blank",rel:"noopener"}},[e._v("our Github bugtracker"),a("OutboundLink")],1),e._v(").")]),e._v(" "),a("h2",{attrs:{id:"_4-1-1-july-23-2021"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-1-july-23-2021"}},[e._v("#")]),e._v(" 4.1.1 (July 23, 2021)")]),e._v(" "),a("h4",{attrs:{id:"bugfixes-4"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#bugfixes-4"}},[e._v("#")]),e._v(" Bugfixes")]),e._v(" "),a("ul",[a("li",[e._v("Bugs related to GeoSPARQL support ("),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/428",target:"_blank",rel:"noopener"}},[e._v("#428"),a("OutboundLink")],1),e._v(","),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/434",target:"_blank",rel:"noopener"}},[e._v("#434"),a("OutboundLink")],1),e._v(" )")]),e._v(" "),a("li",[e._v("Issue with ORDER BY and LIMIT for MS SQL ("),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/225",target:"_blank",rel:"noopener"}},[e._v("#225"),a("OutboundLink")],1),e._v(","),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/412",target:"_blank",rel:"noopener"}},[e._v("#412"),a("OutboundLink")],1),e._v(")")])]),e._v(" "),a("h4",{attrs:{id:"new-features-7"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#new-features-7"}},[e._v("#")]),e._v(" New features")]),e._v(" "),a("ul",[a("li",[e._v("Teiid support ("),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/336",target:"_blank",rel:"noopener"}},[e._v("#336"),a("OutboundLink")],1),e._v(")")]),e._v(" "),a("li",[e._v("Various improvements of the Protégé plugin")])]),e._v(" "),a("h2",{attrs:{id:"_4-1-0-february-28-2021"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-0-february-28-2021"}},[e._v("#")]),e._v(" 4.1.0 (February 28, 2021)")]),e._v(" "),a("h4",{attrs:{id:"changed-behavior"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#changed-behavior"}},[e._v("#")]),e._v(" Changed behavior")]),e._v(" "),a("ul",[a("li",[a("a",{attrs:{href:"/guide%C3%A9cli#ontop-mapping-to-r2rml"}},[e._v("OBDA to R2RML mapping conversion")]),e._v(" now requires by default access to DB metadata (through credentials or as a serialized file). This requirement can be bypassed with the argument "),a("code",[e._v("--force")]),e._v(".")]),e._v(" "),a("li",[e._v("By default, DESCRIBE queries only return the triples where the described IRI appears as subject. To also consider the triples where it appears as object, set the parameter "),a("code",[e._v("ontop.includeFixedObjectPositionInDescribe")]),e._v(" to true.")]),e._v(" "),a("li",[e._v("The Docker endpoint image is now based on Debian ("),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/394",target:"_blank",rel:"noopener"}},[e._v("#394"),a("OutboundLink")],1),e._v("), not on Alpine anymore.")])]),e._v(" "),a("h4",{attrs:{id:"new-features-8"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#new-features-8"}},[e._v("#")]),e._v(" New features")]),e._v(" "),a("ul",[a("li",[e._v("Support for GeoSPARQL functions added ("),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/335",target:"_blank",rel:"noopener"}},[e._v("#335"),a("OutboundLink")],1),e._v(").")]),e._v(" "),a("li",[a("a",{attrs:{href:"/guide/advanced/logging"}},[e._v("Rich JSON-based query logging")]),e._v(" added.")]),e._v(" "),a("li",[a("a",{attrs:{href:"/guide/advanced/predefined"}},[e._v("New endpoint for predefined queries")]),e._v(" added (beta). It enables the specification of custom low-latency Web APIs in a declarative manner.")]),e._v(" "),a("li",[e._v("Support for the "),a("code",[e._v("IF")]),e._v(", "),a("code",[e._v("IRI")]),e._v(", "),a("code",[e._v("BNODE")]),e._v(" SPARQL functions added.")]),e._v(" "),a("li",[e._v("Support for Dremio added.")]),e._v(" "),a("li",[e._v("DB metadata can now be loaded from files instead of connecting to the database.")]),e._v(" "),a("li",[e._v("Bnode labels are now anonymized on-the-fly. Bnode templates can safely use PII.")]),e._v(" "),a("li",[e._v("Sensitive JDBC information (user name, password, URL) can now be passed as arguments or environment variables (for Docker) instead of being written in the properties file. Docker secrets are also supported for further security.")]),e._v(" "),a("li",[e._v("New left join optimization techniques added. General functional dependencies are now taken into account. Sensitivity to left join ordering reduced.")]),e._v(" "),a("li",[a("a",{attrs:{href:"/guide/advanced/caching"}},[e._v("HTTP caching")]),e._v(" headers can now be returned by the Ontop SPARQL endpoint.")]),e._v(" "),a("li",[e._v("Native Protégé bundles for each platform (Windows, MacOS, Linux) with JRE 8 embedded.")]),e._v(" "),a("li",[e._v("Basic support for Ontop views added (experimental), which, in particular, allows specifying integrity constraints on views defined at the Ontop level.")])]),e._v(" "),a("h4",{attrs:{id:"removal"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#removal"}},[e._v("#")]),e._v(" Removal")]),e._v(" "),a("ul",[a("li",[e._v("As announced earlier, the RDF4J Workbench-based bundles are not shipped anymore. However, the webapps war file can still be built with Maven.")])]),e._v(" "),a("h4",{attrs:{id:"refactoring-5"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#refactoring-5"}},[e._v("#")]),e._v(" Refactoring")]),e._v(" "),a("ul",[a("li",[e._v("Drastic reduction of memory consumption when processing SPARQL queries ("),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/370",target:"_blank",rel:"noopener"}},[e._v("#370"),a("OutboundLink")],1),e._v("), which is significant for materializing large RDF graphs.")]),e._v(" "),a("li",[e._v("Better file resource handling ("),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/368",target:"_blank",rel:"noopener"}},[e._v("#368"),a("OutboundLink")],1),e._v(").")]),e._v(" "),a("li",[e._v("Distinct lifting improved.")]),e._v(" "),a("li",[e._v("Self-join elimination based on functional dependencies re-implemented.")]),e._v(" "),a("li",[e._v("Decomposition of heterogeneous IRI templates enabled.")]),e._v(" "),a("li",[e._v("Lexical value space is now considered when decomposing IRIs.")]),e._v(" "),a("li",[e._v("Protégé plugin codebase cleaned, with parts of UI streamlined and redesigned. Improved syntax highlighting in target and source queries. Mapping validation extended. Multiple open ontologies supported ("),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/282",target:"_blank",rel:"noopener"}},[e._v("#282"),a("OutboundLink")],1),e._v(" and "),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/175",target:"_blank",rel:"noopener"}},[e._v("#175"),a("OutboundLink")],1),e._v(").")]),e._v(" "),a("li",[e._v("RDF4J external binding management refactored.")]),e._v(" "),a("li",[e._v("Bnode handling refactored.")]),e._v(" "),a("li",[e._v("Java 11 support.")]),e._v(" "),a("li",[e._v("Better handling of column names when converting OBDA mappings into R2RML, which now uses DB metadata.")]),e._v(" "),a("li",[e._v("CONSTRUCT and DESCRIBE query handling refactored.")]),e._v(" "),a("li",[e._v("Parser for OBDA mappings refactored.")]),e._v(" "),a("li",[e._v("Character encoding in R2RML templates refactored.")]),e._v(" "),a("li",[e._v("Default file encoding set to UTF-8. Particularly useful on Windows. Can be overridden if needed.")]),e._v(" "),a("li",[a("a",{attrs:{href:"/dev/build"}},[e._v("Build script")]),e._v(" refactored. Now fully based on Maven ("),a("a",{attrs:{href:"https://github.com/ontop/ontop/pull/393",target:"_blank",rel:"noopener"}},[e._v("#393"),a("OutboundLink")],1),e._v(").")]),e._v(" "),a("li",[e._v("Base Docker image updated.")]),e._v(" "),a("li",[e._v("PostgreSQL transaction handling (in streaming mode) improved.")]),e._v(" "),a("li",[e._v("Timeout support extended to non-SELECT queries.")])]),e._v(" "),a("p",[e._v("Many bugfixes.")]),e._v(" "),a("h2",{attrs:{id:"_4-0-3-october-16-2020"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-0-3-october-16-2020"}},[e._v("#")]),e._v(" 4.0.3 (October 16, 2020)")]),e._v(" "),a("h4",{attrs:{id:"bugfixes-5"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#bugfixes-5"}},[e._v("#")]),e._v(" Bugfixes")]),e._v(" "),a("ul",[a("li",[e._v("Wrong IRI decomposition ("),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/358",target:"_blank",rel:"noopener"}},[e._v("#358"),a("OutboundLink")],1),e._v(")")]),e._v(" "),a("li",[e._v("Logback config file ignored by Ontop CLI ("),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/361",target:"_blank",rel:"noopener"}},[e._v("#361"),a("OutboundLink")],1),e._v(")")])]),e._v(" "),a("h2",{attrs:{id:"_4-0-2-september-3-2020"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-0-2-september-3-2020"}},[e._v("#")]),e._v(" 4.0.2 (September 3, 2020)")]),e._v(" "),a("ul",[a("li",[e._v("Fixed Named Graphs (quad) grammar in the target of the Ontop native mapping language.")])]),e._v(" "),a("h2",{attrs:{id:"_4-0-1-august-28-2020"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-0-1-august-28-2020"}},[e._v("#")]),e._v(" 4.0.1 (August 28, 2020)")]),e._v(" "),a("h4",{attrs:{id:"new-features-and-bugfixes"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#new-features-and-bugfixes"}},[e._v("#")]),e._v(" New features and bugfixes")]),e._v(" "),a("ul",[a("li",[e._v("Named Graphs (quad) are supported in materialization ("),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/343",target:"_blank",rel:"noopener"}},[e._v("#343"),a("OutboundLink")],1),e._v(")")]),e._v(" "),a("li",[e._v("Removal of Jena as a dependency ("),a("a",{attrs:{href:"https://github.com/ontop/ontop/issues/349",target:"_blank",rel:"noopener"}},[e._v("#349"),a("OutboundLink")],1),e._v(")")]),e._v(" "),a("li",[a("code",[e._v("com.mysql.cj.jdbc.Driver")]),e._v(" is now also recognized. Non-recognized drivers now use the default SQL factories instead of the mock-up one.")])]),e._v(" "),a("h2",{attrs:{id:"_4-0-0-july-31-2020"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-0-0-july-31-2020"}},[e._v("#")]),e._v(" 4.0.0 (July 31, 2020)")]),e._v(" "),a("h4",{attrs:{id:"refactoring-6"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#refactoring-6"}},[e._v("#")]),e._v(" Refactoring")]),e._v(" "),a("ul",[a("li",[e._v("Dependencies updated (e.g. RDF4J 3.3.0)")]),e._v(" "),a("li",[e._v("SERIAL datatypes of PostgreSQL better handled")]),e._v(" "),a("li",[e._v("Anonymous blank nodes are now supported in CONSTRUCT blocks")]),e._v(" "),a("li",[e._v("JSON-LD now supported for graph queries")]),e._v(" "),a("li",[e._v("Denodo support improved.")])]),e._v(" "),a("p",[e._v("Few bugfixes.")]),e._v(" "),a("h2",{attrs:{id:"_4-0-0-rc-1-july-8-2020"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-0-0-rc-1-july-8-2020"}},[e._v("#")]),e._v(" 4.0.0-rc-1 (July 8, 2020)")]),e._v(" "),a("h4",{attrs:{id:"changed-behavior-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#changed-behavior-2"}},[e._v("#")]),e._v(" Changed behavior")]),e._v(" "),a("ul",[a("li",[e._v("Streaming mode is enabled by default for query answering. It fetches data by batches of 500 results.")])]),e._v(" "),a("h4",{attrs:{id:"new-features-9"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#new-features-9"}},[e._v("#")]),e._v(" New features")]),e._v(" "),a("ul",[a("li",[e._v("Support of GROUP_CONCAT added. All the standard SPARQL aggregation functions are now supported.")]),e._v(" "),a("li",[e._v("Named graphs are now supported.")]),e._v(" "),a("li",[e._v("Support of Denodo added. Support of Dremio is postponed to 4.1.")]),e._v(" "),a("li",[e._v("Support XML catalog file added (beta). It enables resolving "),a("code",[e._v("owl:imports")]),e._v(" assertions from the ontology by loading local files instead of fetching remote URLs. It is available in Protégé and with the "),a("code",[e._v("ontop endpoint")]),e._v(" CLI command.")]),e._v(" "),a("li",[e._v("DB metadata extraction CLI command added (experimental).")]),e._v(" "),a("li",[e._v("CASE and CAST is now supported in the mapping.")]),e._v(" "),a("li",[e._v("Streaming mode for query answering added.")])]),e._v(" "),a("h4",{attrs:{id:"deprecation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#deprecation"}},[e._v("#")]),e._v(" Deprecation")]),e._v(" "),a("ul",[a("li",[e._v("The RDF4J Workbench-based SPARQL endpint is deprecated. Tomcat, Jetty bundles and webapps (.war files) will be removed in a future version. Users are recommended to switch to the "),a("code",[e._v("ontop endpoint")]),e._v(" CLI or its Docker image.")])]),e._v(" "),a("h4",{attrs:{id:"removal-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#removal-2"}},[e._v("#")]),e._v(" Removal")]),e._v(" "),a("ul",[a("li",[e._v("The Mapping Assistant panel has been removed from the Ontop Protégé plugin.")])]),e._v(" "),a("h4",{attrs:{id:"refactoring-7"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#refactoring-7"}},[e._v("#")]),e._v(" Refactoring")]),e._v(" "),a("ul",[a("li",[e._v("SQL parsing of the mapping improved. JSQLParser's version has been updated.")]),e._v(" "),a("li",[e._v("Metadata extraction refactored, and SQLDialectAdapter has been eliminated.")]),e._v(" "),a("li",[e._v("Meta-mapping management improved.")]),e._v(" "),a("li",[e._v("Non-recognized SQL functions in the mapping are now only assumed to be deterministic. Other assumptions have been removed.")]),e._v(" "),a("li",[e._v("Internal data nodes now create variables only for database columns that are used in the query. This sparse usage of variables strongly improve reformulation time and log readibility when using tables with 100+ columns in the mapping.")])]),e._v(" "),a("p",[e._v("Many bugfixes.")]),e._v(" "),a("h2",{attrs:{id:"_4-0-0-beta-1-december-23-2019"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-0-0-beta-1-december-23-2019"}},[e._v("#")]),e._v(" 4.0.0-beta-1 (December 23, 2019)")]),e._v(" "),a("h4",{attrs:{id:"changed-behaviors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#changed-behaviors"}},[e._v("#")]),e._v(" Changed behaviors")]),e._v(" "),a("ul",[a("li",[e._v("Cardinality is now enforced by default (duplicates are removed at\nthe mapping level). This is required to support most of the\naggregation functions.")]),e._v(" "),a("li",[e._v("Functions in the SQL queries of the mapping that are unknown to\nOntop do no cause the creation of SQL views anymore. The strategy\nregarding SQL functions moved from white-list to black-list.")]),e._v(" "),a("li",[e._v("Types returned by supported SPARQL functions now strictly follow the\nSPARQL 1.1 specification.")])]),e._v(" "),a("h4",{attrs:{id:"new-features-10"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#new-features-10"}},[e._v("#")]),e._v(" New features")]),e._v(" "),a("ul",[a("li",[e._v("SPARQL Aggregation functions SUM, COUNT, AVG, MIN, MAX are now\nsupported. SAMPLE is currently implemented as MIN.")]),e._v(" "),a("li",[e._v("Joins over terms that are constructed using different functions are\nnow supported.")]),e._v(" "),a("li",[e._v("Some functions (such as IRI templates) can now be post-processed\n(that is, they are not always included in the SQL query anymore).\nGenerated SQL queries are generally less verbose than before.")]),e._v(" "),a("li",[e._v("The Ontop endpoint now has the portal option, where predefined\nqueries are shown in the Web interface.")]),e._v(" "),a("li",[e._v("The NULLIF SQL function is now supported and optimized. Useful for\nfiltering out some unwanted values in the mapping assertions.")]),e._v(" "),a("li",[e._v("OPTIONALs outside the well-designed fragment are now supported.\nWeakly well-designed queries encoding preferences are optimized.")])]),e._v(" "),a("h4",{attrs:{id:"refactoring-8"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#refactoring-8"}},[e._v("#")]),e._v(" Refactoring")]),e._v(" "),a("ul",[a("li",[e._v("The typing system have been entirely redesigned. RDF types and\ndatabase types are now clearly separated. Each database engine can\nnow bring in its own data types.")]),e._v(" "),a("li",[e._v("The Datalog data structure (from version 1.x) for representing\nqueries internally has been removed.")]),e._v(" "),a("li",[e._v("Function symbol creation and optimization has been entirely\nrefactored. They are constructed by two factories, the\nFunctionSymbolFactory and the DBFunctionSymbolFactory.")]),e._v(" "),a("li",[e._v("Most of the logic of SQLDialectAdapter has been moved to\nDBFunctionSymbolFactory and DBTypeFactory. Each database engine is\nexpected to have its own implementation of these new interfaces.")]),e._v(" "),a("li",[e._v("The SPARQL translation has been rewritten (was formerly translating\ninto Datalog).")]),e._v(" "),a("li",[e._v("The SQL generator has been rewritten (was formerly translating from\nDatalog).")])]),e._v(" "),a("h4",{attrs:{id:"temporary-limitation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#temporary-limitation"}},[e._v("#")]),e._v(" Temporary limitation")]),e._v(" "),a("ul",[a("li",[e._v("Due to a complete refactoring of the SQL dialect management, only\nthe H2, MySQL, PostgreSQL, Oracle, SQL server and DB2 dialects are\nsupported in this beta. Dremio and Denodo dialects are expected to\nbe supported in a next beta release.")])]),e._v(" "),a("p",[e._v("Many bugfixes.")]),e._v(" "),a("h2",{attrs:{id:"_3-0-1-december-9-2019"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-0-1-december-9-2019"}},[e._v("#")]),e._v(" 3.0.1 (December 9, 2019)")]),e._v(" "),a("h4",{attrs:{id:"changed-behaviors-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#changed-behaviors-2"}},[e._v("#")]),e._v(" Changed behaviors")]),e._v(" "),a("ul",[a("li",[e._v("Protégé: no property file (resp. mapping file) is created if no data\nsource (resp. mapping assertion) is specified by the user.")])]),e._v(" "),a("h4",{attrs:{id:"new-features-11"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#new-features-11"}},[e._v("#")]),e._v(" New features")]),e._v(" "),a("ul",[a("li",[e._v("Ontop endpoint now supports R2RML files and doesn't require an\nontology.")]),e._v(" "),a("li",[e._v("Materialization: N-triples format is now supported.")])]),e._v(" "),a("h4",{attrs:{id:"refactoring-9"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#refactoring-9"}},[e._v("#")]),e._v(" Refactoring")]),e._v(" "),a("ul",[a("li",[e._v("Rewriting of the tree-witness rewriter (now independent from\nDatalog)")])]),e._v(" "),a("h4",{attrs:{id:"bug-fixes-3"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#bug-fixes-3"}},[e._v("#")]),e._v(" Bug fixes")]),e._v(" "),a("ul",[a("li",[e._v("Protégé: fixed issues related to prefix management.")]),e._v(" "),a("li",[e._v("Reasoning: issue related to the handling of inverse properties\nfixed.")])]),e._v(" "),a("h2",{attrs:{id:"_3-0-0-august-23-2019"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-0-0-august-23-2019"}},[e._v("#")]),e._v(" 3.0.0 (August 23, 2019)")]),e._v(" "),a("h4",{attrs:{id:"changed-behaviors-3"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#changed-behaviors-3"}},[e._v("#")]),e._v(" Changed behaviors")]),e._v(" "),a("ul",[a("li",[e._v("The `rdfs:range` of a data property is not used anymore for\ninferring the non-specified datatype in a mapping assertion but for\nvalidating the datatype once specified or inferred. Datatype\ninference is now based on the DB datatype and follows the R2RML\nnatural mapping (https://www.w3.org/TR/r2rml/#natural-mapping)")])]),e._v(" "),a("h4",{attrs:{id:"new-features-12"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#new-features-12"}},[e._v("#")]),e._v(" New features")]),e._v(" "),a("ul",[a("li",[e._v("Support of Protege 5.5")]),e._v(" "),a("li",[e._v("Support of BNode in R2RML")]),e._v(" "),a("li",[e._v("Basic support for the `geo:wktLiteral` datatype (#256)")]),e._v(" "),a("li",[e._v("New command-line interface for SPARQL endpoint")]),e._v(" "),a("li",[e._v("Docker container for SPARQL endpoint\n(https://hub.docker.com/r/ontop/ontop-endpoint)")]),e._v(" "),a("li",[e._v("Preliminary support of Dremio")]),e._v(" "),a("li",[e._v("Preliminary support of Denodo")]),e._v(" "),a("li",[e._v("The ordering of SPARQL variables is now preserved (#291)")]),e._v(" "),a("li",[e._v("N-Triples output for materialization added")]),e._v(" "),a("li",[e._v("The SQL translation now appears as a sub-tab in the Protégé Ontop\nSPARQL tab")])]),e._v(" "),a("h4",{attrs:{id:"refactoring-10"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#refactoring-10"}},[e._v("#")]),e._v(" Refactoring")]),e._v(" "),a("ul",[a("li",[e._v("The triple predicate is now systematically used in the mapping and\nduring query unfolding")]),e._v(" "),a("li",[e._v("Atom predicates and function symbols are now clearly distinguished")]),e._v(" "),a("li",[e._v("The Datalog-based data structure is not used anymore at mapping\nprocessing time and by the default rewriter")]),e._v(" "),a("li",[e._v("Query containment-based optimizations applied to the mapping after\nsaturation improved")]),e._v(" "),a("li",[e._v("The materializer is now based on RDF4J (instead of OWLAPI)")])]),e._v(" "),a("h4",{attrs:{id:"project-organisation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#project-organisation"}},[e._v("#")]),e._v(" Project organisation")]),e._v(" "),a("ul",[a("li",[e._v("Release of Ontop on both SourceForge and GitHub (#274)")]),e._v(" "),a("li",[e._v("A new repository for the tutorial\n(https://github.com/ontop/ontop-tutorial)")])]),e._v(" "),a("p",[e._v("Many bugfixes.")]),e._v(" "),a("h2",{attrs:{id:"_3-0-0-beta-2-february-28-2018"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-0-0-beta-2-february-28-2018"}},[e._v("#")]),e._v(" 3.0.0-beta-2 (February 28, 2018)")]),e._v(" "),a("h4",{attrs:{id:"changed-behaviours"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#changed-behaviours"}},[e._v("#")]),e._v(" Changed Behaviours")]),e._v(" "),a("ul",[a("li",[e._v("The JDBC driver class name is now required in Protégé (issue #248)")])]),e._v(" "),a("h4",{attrs:{id:"new-features-13"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#new-features-13"}},[e._v("#")]),e._v(" New features")]),e._v(" "),a("ul",[a("li",[e._v("Novel left join optimization techniques (issue #230)")]),e._v(" "),a("li",[e._v("LIMIT appended to test SQL queries and SPARQL queries in Protégé")]),e._v(" "),a("li",[e._v("Report illegal usage of Fully qualified column names (FQDN) in the\ntarget part of a mapping assertion")]),e._v(" "),a("li",[e._v("Support for the SPARQL isNumeric function")])]),e._v(" "),a("h4",{attrs:{id:"refactoring-11"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#refactoring-11"}},[e._v("#")]),e._v(" Refactoring")]),e._v(" "),a("ul",[a("li",[e._v("Internal representation of the ontology improved")]),e._v(" "),a("li",[e._v("Improvement of the intermediate query representation (issues #235,\n#236)")]),e._v(" "),a("li",[e._v("Switch to ANTLR4 to parse ontop native mapping (issues #238, #239)")]),e._v(" "),a("li",[e._v("Make ResultSet.next() robust (issue #219)")]),e._v(" "),a("li",[e._v("More robust handling of IRI-safe encoding (issue #245)")])]),e._v(" "),a("h4",{attrs:{id:"bug-fixes-4"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#bug-fixes-4"}},[e._v("#")]),e._v(" Bug Fixes")]),e._v(" "),a("p",[e._v("Many, see "),a("a",{attrs:{href:"https://github.com/ontop/ontop/milestone/7?closed=1",target:"_blank",rel:"noopener"}},[e._v("closed issues"),a("OutboundLink")],1),e._v(".")]),e._v(" "),a("h2",{attrs:{id:"_3-0-0-beta-1-august-11-2017"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-0-0-beta-1-august-11-2017"}},[e._v("#")]),e._v(" 3.0.0-beta-1 (August 11, 2017)")]),e._v(" "),a("p",[e._v("Note that this is the first release from version 3 series with many\ninternal refactoring and improvements, and bug fixes. However, these\nchanges also cause incompatibility with Ontop v1. See "),a("a",{attrs:{href:"MigrationGuideV1toV3",title:"wikilink"}},[e._v("the migration\nguide")]),e._v(".")]),e._v(" "),a("h4",{attrs:{id:"changed-behaviours-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#changed-behaviours-2"}},[e._v("#")]),e._v(" Changed Behaviours")]),e._v(" "),a("ul",[a("li",[e._v("JDBC connection information is stored in a separate properties file")]),e._v(" "),a("li",[e._v("Fully qualified columns (table.column) are not allowed in the target\npart of the mapping language. One has to explicitly create an alias\n(e.g. table.column AS table_column) and use the alias in the\ntarget. (complying with R2RML)")]),e._v(" "),a("li",[e._v("The rules for datatype type inference and checking are changed. Now\nwe use only mapping and database to infer the datatypes (complying\nwith R2RML), and the (range axioms) in the ontologies to check the\ncompatibility (complying with OWL).")])]),e._v(" "),a("h4",{attrs:{id:"new-features-14"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#new-features-14"}},[e._v("#")]),e._v(" New features")]),e._v(" "),a("ul",[a("li",[e._v("Major refactoring of the internal structure of the Ontop system")]),e._v(" "),a("li",[e._v("Databases for Integration Tests have been dockerized.")]),e._v(" "),a("li",[e._v("Upgrade Sesame to the latest version of RDF4J (v2.2.2).")]),e._v(" "),a("li",[e._v("The redesigned OWLAPI and RDF4J API bindings of Ontop API (see\nexamples: "),a("a",{attrs:{href:"https://github.com/ontop/ontop-api-examples",target:"_blank",rel:"noopener"}},[e._v("https://github.com/ontop/ontop-api-examples"),a("OutboundLink")],1),e._v(")")]),e._v(" "),a("li",[e._v("Upgrade of R2RML API to v0.6.0")]),e._v(" "),a("li",[e._v("Official support of both Tomcat and Jetty (v9) for deploying a\nSPARQL endpoint")]),e._v(" "),a("li",[e._v("Better support of Optional (bugfix #190)")]),e._v(" "),a("li",[e._v('Protege: support for "Synchronize Reasoner" in the Reasoner menu')]),e._v(" "),a("li",[e._v("Improved error messages for incorrect mapping")]),e._v(" "),a("li",[e._v("CLI tool for converting Mapping from v1 to v3")])]),e._v(" "),a("h2",{attrs:{id:"_1-18-1-june-16-2017"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-18-1-june-16-2017"}},[e._v("#")]),e._v(" 1.18.1 (June 16, 2017)")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Return a correct extension for files in ontop cli materializer\n(issue #145)")])]),e._v(" "),a("li",[a("p",[e._v("Materialize support non-http resource uris")])]),e._v(" "),a("li",[a("p",[e._v("Bug Fixes")]),e._v(" "),a("ul",[a("li",[e._v("Small fixes in cli (issues #127, #141, #188)")]),e._v(" "),a("li",[e._v("PostgreSQL JDBC driver fix for quotation marks")]),e._v(" "),a("li",[e._v("Remove unknown property warning for owl:sameAs")]),e._v(" "),a("li",[e._v("Remove duplicate annotations during materialization (issues\n#183 #186)")]),e._v(" "),a("li",[e._v("Generate different file names for properties and classes during\nmaterialization with separate files (issue #165)")]),e._v(" "),a("li",[e._v("R2RML\n"),a("ul",[a("li",[e._v("Small changes in api")]),e._v(" "),a("li",[e._v("Fix R2RML import of SQL query (issues #181 #182)")]),e._v(" "),a("li",[e._v("Fix export from OBDA mapping to R2RML (issues #158 #159\n#160)")])])]),e._v(" "),a("li",[e._v("Fix in SPARQL use of filter and values with a IRI (issue #191)")]),e._v(" "),a("li",[e._v("Fix handling of mysql metadata with lower_case_table_names\nsetting on (issue #192)")])])])]),e._v(" "),a("h2",{attrs:{id:"_1-18-0-may-26-2016"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-18-0-may-26-2016"}},[e._v("#")]),e._v(" 1.18.0 (May 26, 2016)")]),e._v(" "),a("ul",[a("li",[e._v("Protege\n"),a("ul",[a("li",[e._v("Redesigned materialization gui")]),e._v(" "),a("li",[e._v("Upgrade to Protege 5.0.0")])])]),e._v(" "),a("li",[e._v("Support of querying annotation property from ontology (issue #105)\n(disabled by default)")]),e._v(" "),a("li",[e._v("Support of the use of owl:sameAs in mappings (disabled by default)")]),e._v(" "),a("li",[e._v("Package names have been unified to it.unibz.inf.ontop")]),e._v(" "),a("li",[e._v("Upgrade OWLAPI to v4.2.5")]),e._v(" "),a("li",[e._v("Bug Fixes\n"),a("ul",[a("li",[e._v("Fix obda-to-r2rml convert for template like <{uri}> (issue\n#97)")]),e._v(" "),a("li",[e._v("Fix an issue in Protege when renaming data source.")]),e._v(" "),a("li",[e._v("Fix error messages in protege mapping assistant panel and SPARQL\nquery")]),e._v(" "),a("li",[e._v("Fix issue with multiple schemas (issue #99)")]),e._v(" "),a("li",[e._v("Fix internal SQL conversion for Teiid jdbc driver")]),e._v(" "),a("li",[e._v("Fix support of anonymous ontology (issue #101)")]),e._v(" "),a("li",[e._v("Fix warning message in Protege (issue #102)")]),e._v(" "),a("li",[e._v("Fix xml uri (issue #104)")]),e._v(" "),a("li",[e._v("Fix r2rml api, error predicateMap with template (issue #107)")]),e._v(" "),a("li",[e._v("Fix in Protege import of additional ontology and add classes and\nproperties of imported ontologies at runtime (issues #106\n#108)")]),e._v(" "),a("li",[e._v("Fix querying URI constants (issue #111)")]),e._v(" "),a("li",[e._v("Fix error message creating new mapping (issue #120)")])])])]),e._v(" "),a("h2",{attrs:{id:"_1-17-1-february-16-2016"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-17-1-february-16-2016"}},[e._v("#")]),e._v(" 1.17.1 (February 16, 2016)")]),e._v(" "),a("ul",[a("li",[e._v("Bug Fixes\n"),a("ul",[a("li",[e._v("Fix an issue when creating new datasource in Protege")])])])]),e._v(" "),a("h2",{attrs:{id:"_1-17-0-february-4-2016"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-17-0-february-4-2016"}},[e._v("#")]),e._v(" 1.17.0 (February 4, 2016)")]),e._v(" "),a("ul",[a("li",[e._v("Protege\n"),a("ul",[a("li",[e._v("Ontop protege plugin now available on official Protege Plugin\nRepository!")]),e._v(" "),a("li",[e._v("Upgrade Protege to 5.0.0-beta-21 (latest version)")]),e._v(" "),a("li",[e._v("Ontop protege plugin is packed as one jar now -- no need for\nseparated OSGI JDBC configuration jars")]),e._v(" "),a("li",[e._v("do not generate .obda and .q file when no datasource is present")]),e._v(" "),a("li",[e._v("General improvement of UI -- more intuitive and less confusion")])])]),e._v(" "),a("li",[e._v("Support for Annotation Properties in mappings")]),e._v(" "),a("li",[e._v("Improvement of Ontop mapping language for URIs/Literals retrieved\nfrom DB columns")]),e._v(" "),a("li",[e._v("Support for SPARQL VALUES keyword for SPARQL federation")]),e._v(" "),a("li",[e._v("Java 8")]),e._v(" "),a("li",[e._v("Upgrade OWLAPI to v4.1.3 (latest version)")]),e._v(" "),a("li",[e._v("Bash Completion for command line interface")]),e._v(" "),a("li",[e._v("Better structured Wiki: "),a("a",{attrs:{href:"https://github.com/ontop/ontop/wiki",target:"_blank",rel:"noopener"}},[e._v("https://github.com/ontop/ontop/wiki"),a("OutboundLink")],1)])]),e._v(" "),a("h2",{attrs:{id:"_1-16-1-november-16-2015"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-16-1-november-16-2015"}},[e._v("#")]),e._v(" 1.16.1 (November 16, 2015)")]),e._v(" "),a("ul",[a("li",[e._v("Optimizations exploiting foreign key constraints over multiple\ncolumns")]),e._v(" "),a("li",[e._v("Improvement in the RDB2RDF compliance test (contributed by Evren\nSrin)")])]),e._v(" "),a("h2",{attrs:{id:"_1-16-0-october-14-2015"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-16-0-october-14-2015"}},[e._v("#")]),e._v(" 1.16.0 (October 14, 2015)")]),e._v(" "),a("ul",[a("li",[e._v("Support for "),a("a",{attrs:{href:"OntopSPARQLFunctions",title:"wikilink"}},[e._v(" SPARQL functions ")])]),e._v(" "),a("li",[e._v("Support for column oriented RDBMS "),a("a",{attrs:{href:"ObdalibPluginJDBC",title:"wikilink"}},[e._v("\nMonetDB")])]),e._v(" "),a("li",[e._v("Support for cloud RDBMS "),a("a",{attrs:{href:"ObdalibPluginJDBC",title:"wikilink"}},[e._v(" SAP HANA")])]),e._v(" "),a("li",[e._v("New Optimization technique: "),a("a",{attrs:{href:"Implicit-database-constraints",title:"wikilink"}},[e._v("\nImplicit-database-constraints")])]),e._v(" "),a("li",[e._v("New Optimization technique: "),a("a",{attrs:{href:"Exact-Mappings",title:"wikilink"}},[e._v("\nExact-Mappings")])]),e._v(" "),a("li",[e._v("Bug Fixes\n"),a("ul",[a("li",[e._v("Handling quotes in the WHERE clause of SQL query in mappings .")]),e._v(" "),a("li",[e._v("Allow multiple subjects in the target of mapping of Ontop native\nsyntax.")]),e._v(" "),a("li",[e._v("Return correct value from datetime columns using jtds driver")]),e._v(" "),a("li",[e._v("Fix the translation of LIMIT with ORDER BY in oracle database")]),e._v(" "),a("li",[e._v("Fix a bug in MetaMappingExpander")])])])]),e._v(" "),a("h2",{attrs:{id:"_1-15-0-may-13-2015"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-15-0-may-13-2015"}},[e._v("#")]),e._v(" 1.15.0 (May 13, 2015)")]),e._v(" "),a("ul",[a("li",[e._v("Upgrade the Protege plugin to Protégé 5")]),e._v(" "),a("li",[e._v("New Command line interface")]),e._v(" "),a("li",[e._v("Better support for SPARQL BIND")]),e._v(" "),a("li",[e._v("Support for SPARQL Concat and Replace")]),e._v(" "),a("li",[e._v("Support for SQL Concat and Replace (in the mappings)")]),e._v(" "),a("li",[e._v("Support for xsd:dateTimeStamp")]),e._v(" "),a("li",[e._v("Improved Optimization techniques (Contribution by Roman Konchakov)")]),e._v(" "),a("li",[e._v("Implementation of Autoclosable interface for core classes in the API\nto support `try with resource`.")]),e._v(" "),a("li",[e._v("Create a sub-query when SELECT DISTINCT is used in the mappings.")]),e._v(" "),a("li",[e._v("Bug Fixes\n"),a("ul",[a("li",[e._v("Handle the 30-characters limit for variable names in Oracle.")]),e._v(" "),a("li",[e._v("Fix the mapping render of Protege when multiple subjects are in\nthe target of mapping.")])])])]),e._v(" "),a("h2",{attrs:{id:"_1-14-0-november-4-2014"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-14-0-november-4-2014"}},[e._v("#")]),e._v(" 1.14.0 (November 4, 2014)")]),e._v(" "),a("ul",[a("li",[e._v("Added support in ontology and mappings for datatypes xsd:int,\nxsd:long, xsd:positiveInteger, xsd:negativeInteger,\nxsd:nonPositiveInteger, xsd:nonNegativeInteger, xsd:float")]),e._v(" "),a("li",[e._v("Optimized implementations of TBox classifications, and query\ncontainment checking, which are much faster than before")]),e._v(" "),a("li",[e._v("Validation for Sesame Workbench made stronger. It prevents\nrepositories with an invalid configuration to be created.")]),e._v(" "),a("li",[e._v("Bug Fixes:\n"),a("ul",[a("li",[e._v("Fix SPARQL functions (str(), lang()) to use rdfs:Literal instead\nof xsd:string")]),e._v(" "),a("li",[e._v("Issue converting datatypes of R2RML constants")]),e._v(" "),a("li",[e._v("Support UNICODE characters in TurtleParser")]),e._v(" "),a("li",[e._v("Catch exceptions for Protege R2RML Export")]),e._v(" "),a("li",[e._v("Fix conversion from ontop mappings to R2RML of language tag and\ntriples")])])])]),e._v(" "),a("h2",{attrs:{id:"_1-13-1-september-29-2014"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-13-1-september-29-2014"}},[e._v("#")]),e._v(" 1.13.1 (September 29, 2014)")]),e._v(" "),a("ul",[a("li",[e._v("Bug Fixes:\n"),a("ul",[a("li",[e._v("The redundant query elimination optimization sometimes does not\nhandle facts properly")]),e._v(" "),a("li",[e._v("Some warning messages related to datatype range axioms are\nambiguous")])])])]),e._v(" "),a("h2",{attrs:{id:"_1-13-0-september-25-2014"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-13-0-september-25-2014"}},[e._v("#")]),e._v(" 1.13.0 (September 25, 2014)")]),e._v(" "),a("ul",[a("li",[e._v("Support for providing implicit DB Constraints (e.g. foreign keys) to\nOntop to generate efficient SQL")]),e._v(" "),a("li",[e._v("Command line feature to generate pretty R2RML")]),e._v(" "),a("li",[e._v("Stream output in the Protege Plugin")]),e._v(" "),a("li",[e._v("Support for Regex in mappings")]),e._v(" "),a("li",[e._v("Proper handling of datatypes in ontology and mappings")]),e._v(" "),a("li",[e._v("Support for hsql database")]),e._v(" "),a("li",[e._v("Support for datatypes xsd:date, xsd:time and xsd:gYear")]),e._v(" "),a("li",[e._v("Bug Fixes:\n"),a("ul",[a("li",[e._v("Issue with nested equivalences in unfolder")]),e._v(" "),a("li",[e._v("Problem with multiple join conditions in R2RML")]),e._v(" "),a("li",[e._v("Cancelling running queries in Protege")]),e._v(" "),a("li",[e._v("Blank lines in generated sql causes problems for oracle")])])])]),e._v(" "),a("h2",{attrs:{id:"_1-12-0-june-26-2014"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-12-0-june-26-2014"}},[e._v("#")]),e._v(" 1.12.0 (June 26, 2014)")]),e._v(" "),a("ul",[a("li",[e._v("Support for finding empty concepts and properties")]),e._v(" "),a("li",[e._v("Integration with a new R2RML API")]),e._v(" "),a("li",[e._v("Less restrictive mode for JDBC driver validation")]),e._v(" "),a("li",[e._v("Faster TBox reasoner implementation")]),e._v(" "),a("li",[e._v('Optional "Replace" Statement in the SQL translation. When\n"Replace" is off the SQL performs much better.')]),e._v(" "),a("li",[e._v("Several Bug Fixes:\n"),a("ul",[a("li",[e._v("Issue with 'true' in Oracle")]),e._v(" "),a("li",[e._v("Meta-mapping editing in Protege")]),e._v(" "),a("li",[e._v("Problem with regex in Oracle")]),e._v(" "),a("li",[e._v("Several issues with R2RML")])])])]),e._v(" "),a("h2",{attrs:{id:"_1-11-0-february-19-2014"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-11-0-february-19-2014"}},[e._v("#")]),e._v(" 1.11.0 (February 19, 2014)")]),e._v(" "),a("ul",[a("li",[e._v("Support for Consistency Checking")]),e._v(" "),a("li",[e._v("Improved Performance")]),e._v(" "),a("li",[e._v("Support for Multi-schema queries")]),e._v(" "),a("li",[e._v("New SQL parser for the mapping based on JSQLParser.")]),e._v(" "),a("li",[e._v("Extended the supported SQL language: IN, BETWEEN, LIKE, etc.")]),e._v(" "),a("li",[e._v("Extended the supported SPARQL: BIND")]),e._v(" "),a("li",[e._v("Improved the Treewitness rewriting algorithm.")]),e._v(" "),a("li",[e._v("Upgraded to Sesame 2.7.10")]),e._v(" "),a("li",[e._v("General clean-up")]),e._v(" "),a("li",[e._v("Fixed a number of bugs:\n"),a("ul",[a("li",[e._v("Translation of SAPRQL REGEX into SQL")]),e._v(" "),a("li",[e._v("Infinite loop triggered by some nested Optionals")]),e._v(" "),a("li",[e._v("Several issues with Construct")]),e._v(" "),a("li",[e._v("Several issues with R2RML")])])])]),e._v(" "),a("h2",{attrs:{id:"_1-10-0-december-16-2013"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-10-0-december-16-2013"}},[e._v("#")]),e._v(" 1.10.0 (December 16, 2013)")]),e._v(" "),a("ul",[a("li",[e._v("Ontop under Apache license")]),e._v(" "),a("li",[e._v("Ontop packages in central maven repository")])]),e._v(" "),a("h2",{attrs:{id:"_1-9-0-september-18-2013"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-9-0-september-18-2013"}},[e._v("#")]),e._v(" 1.9.0 (September 18, 2013)")]),e._v(" "),a("ul",[a("li",[e._v("Update to Sesame 2.7.6 (latest)")]),e._v(" "),a("li",[e._v("Validation of datatypes w.r.t. XMLSchema specification")]),e._v(" "),a("li",[e._v("New hybrid Abox functionality support")]),e._v(" "),a("li",[e._v("Removed all dependencies to Jena")]),e._v(" "),a("li",[e._v("Removed wrong/unnecessary dependencies")]),e._v(" "),a("li",[e._v("Turtle parser can handle variables in the predicate")]),e._v(" "),a("li",[e._v("Mappings with URI templates in class or properties suppot")]),e._v(" "),a("li",[e._v("First version of mapping splitter")]),e._v(" "),a("li",[e._v("Bug fix: Null pointer exception when the URI in Protege plugin was\nempty")]),e._v(" "),a("li",[e._v("Bug fix: Literal and literal with language tag handling")]),e._v(" "),a("li",[e._v("Bug fix: Shutdown of Sesame repoConnection")]),e._v(" "),a("li",[e._v("Bug fix: Object column literal gerenation in R2RML")]),e._v(" "),a("li",[e._v("Bug fix: Queries that would not finish execution")]),e._v(" "),a("li",[e._v("Bug fix: Unexpected bindings in unfolder")]),e._v(" "),a("li",[e._v("Bug fix: Null pointer exception in ontology translation in the case\nof unsupported axiom")]),e._v(" "),a("li",[e._v("Bug fix: OWL class assertion generation, inverted arguments")]),e._v(" "),a("li",[e._v("Bug fix: SameTerm in sparql algebra to datalog translation")]),e._v(" "),a("li",[e._v("Bug fix: URI template matcher to find most specific matches first")]),e._v(" "),a("li",[e._v("Bug fix: Construct queries")]),e._v(" "),a("li",[e._v("Bug fix: Describe queries")])]),e._v(" "),a("h2",{attrs:{id:"_1-8-0-july-29-2013"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-8-0-july-29-2013"}},[e._v("#")]),e._v(" 1.8.0 (July 29, 2013)")]),e._v(" "),a("ul",[a("li",[e._v("Improve error message and better exception handling.")]),e._v(" "),a("li",[e._v("Change the representation of "),a("code",[e._v("null")]),e._v(" value in BindingSet")]),e._v(" "),a("li",[e._v("Modified the computation of the LeftJoin to support empty evaluation\nin its second argument.")]),e._v(" "),a("li",[e._v("Changed the type of the semantic index table for integer data\nproperty assertion from INT to BIGINT to be able to handle\n"),a("code",[e._v("xsd:integer")]),e._v(" type")]),e._v(" "),a("li",[e._v("Set index creation during Quest startup")]),e._v(" "),a("li",[e._v("Implement new feature for bootstrapping, command line scripts,\nintegration in ontoPro plugin")]),e._v(" "),a("li",[e._v("Updated the URI templates in Turtle mapping syntax to make it\nsimpler and closer to Turtle. Now quotes, question marks and\nclass/property declarations are no longer required")])]),e._v(" "),a("p",[e._v("For example, in the previous syntax:")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",[a("code",[e._v(' <"test;person/{?id}"> a :MyClass; :hasName {?name}.\n')])])]),a("p",[e._v("becomes simply")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",[a("code",[e._v(" test:person/{id} a :MyClass ; :hasName {name} .\n")])])]),a("ul",[a("li",[e._v('Support "%", "=", ";" characters in the URI template.')])]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",[a("code",[e._v(" :class/{id};{name}%{class type}\n")])])]),a("ul",[a("li",[e._v("Bug fix: Major bugs in execution handling SPARQL Construct and\nSPARQL Describe queries.")]),e._v(" "),a("li",[e._v("Bug fix: Issues related to commits and batch sizes in\nQuestOWLStatement")]),e._v(" "),a("li",[e._v("Bug fix: Issue with URI template matcher that generates "),a("code",[e._v("null")]),e._v(' in\ncase failed template (now it generates URI("xxxx") where xxx is\nthe URI that was being matched.)')]),e._v(" "),a("li",[e._v("Bug fix: Issue in existential clause in tree-witness algorithm")]),e._v(" "),a("li",[e._v("Bug fix: Issue in the maximum size of URI that has more than 400\ncharacters")]),e._v(" "),a("li",[e._v("Bug fix: Issue in some data that can not be tracked when inserted\ninto the database. In particular if the data comes from\nclasses/properties that were simplified by the equivalence\nresolution.")]),e._v(" "),a("li",[e._v("Bug fix: Issue in exception handling during index creation in\nsemantic index test.")]),e._v(" "),a("li",[e._v("Bug fix: Issue in SQL parser that it doesn't capture the scope\nwithin parentheses in the WHERE clause.")]),e._v(" "),a("li",[e._v("Remove table and column identifier quotes in the SQL target query\nstring so that the parser can parse properly. For example:")])]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",[a("code",[e._v(' SELECT "Student"."sid" from "Student"\n')])])]),a("p",[e._v("will become:")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",[a("code",[e._v(" SELECT Student.sid from Student\n")])])]),a("ul",[a("li",[e._v("New semantic index implementation with integer references for URIs\nfor faster query answering (faster joins on integers instead of\nstrings)")])]),e._v(" "),a("p",[a("strong",[e._v("Ontop source code")])]),e._v(" "),a("ul",[a("li",[e._v("Ontop is now in GitHub!")]),e._v(" "),a("li",[e._v("Cleaner and slimmer project structure. We removed obsolete classes\nand tests.")]),e._v(" "),a("li",[e._v("Code refactor in Materialiser API, MinimalCQProducer and\nConstruct-Describe query execution.")]),e._v(" "),a("li",[e._v("More complete test cases for testing Quest features, e.g.,\nTree-Witness rewriting, Data materialiser, SQL parser, SPARQL\nConstruct, SPARQL Describe, SPARQL Optional, Database metadata and\nQuery completeness.")]),e._v(" "),a("li",[e._v("Support JUnit4 test cases.")])]),e._v(" "),a("h2",{attrs:{id:"_1-7-alpha2-rev-2305-april-5-2013"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-7-alpha2-rev-2305-april-5-2013"}},[e._v("#")]),e._v(" 1.7-alpha2 (rev 2305, April 5, 2013)")]),e._v(" "),a("ul",[a("li",[e._v("Support for importing/exporting R2RML mappings")]),e._v(" "),a("li",[e._v('Support for automated mapping generation as defined by the "Direct\nMapping" W3C specification')]),e._v(" "),a("li",[e._v("Various options for data materialization (similar to dump-rdf in\nD2RQ)")]),e._v(" "),a("li",[e._v("Support for concurrent queries in the SPARQL endpoint through\nconnection pooling")]),e._v(" "),a("li",[e._v("Better support for Oracle, Postgres, SQL Server and DB2")]),e._v(" "),a("li",[e._v("Improved the SQL queries generated by Quest by avoiding some\noperations when unnecessary (e.g., casting), and placing optimally\nthe JOIN conditions in the SQL query.")])]),e._v(" "),a("h2",{attrs:{id:"_1-7-alpha2-rev-2178-february-7-2013"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-7-alpha2-rev-2178-february-7-2013"}},[e._v("#")]),e._v(" 1.7-alpha2 (rev 2178, February 7, 2013)")]),e._v(" "),a("p",[a("strong",[e._v("-ontopQuest-")])]),e._v(" "),a("ul",[a("li",[e._v("Mapping optimiser: improved the generation of OR mappings")]),e._v(" "),a("li",[e._v("Mapping optimiser: improved the simplification of mappings using\nFOREIGN KEYS")]),e._v(" "),a("li",[e._v("Query optimiser: Improved the query optimiser to avoid generation of\nredundant JOINs and redundant UNIONs w.r.t. FOREIGN KEYs")]),e._v(" "),a("li",[e._v("Support percent encoding in strings in URI templates as defined by\nthe R2RML standard.")]),e._v(" "),a("li",[e._v("Better propagation of Exception messages in the Sesame provider")]),e._v(" "),a("li",[e._v("New "),a("strong",[e._v("scripts for querying quest")]),e._v(" from the command line")])]),e._v(" "),a("p",[a("strong",[e._v("-ontopPro- plugin")])]),e._v(" "),a("ul",[a("li",[a("strong",[e._v("Introducing mapping assistant")]),e._v(". A new GUI-based tool for creating\nmappings. This is an experimental GUI to help you create mappings in\na faster way, please help us improve it by reporting any issues you\nmay find. (See "),a("a",{attrs:{href:"ObdalibPluginMappingAssistant",title:"wikilink"}},[e._v("\nguideliness")]),e._v(").")]),e._v(" "),a("li",[e._v('Users can set the max number of tuples returned in "OBDA Query"\ntab.')])]),e._v(" "),a("p",[a("strong",[e._v("Mapping language features (-ontopQuest- and -ontopCore-)")])]),e._v(" "),a("ul",[a("li",[e._v("Support URI identifier obtained directly from the database (no using\nURI template).")]),e._v(" "),a("li",[e._v("Support multiple lines when wrting SQL source query (See "),a("a",{attrs:{href:"ObdalibObdaFile#SourceandMappingDeclaration",title:"wikilink"}},[e._v(" feature\nnotes")]),e._v(")")])]),e._v(" "),a("p",[a("strong",[e._v("Bug fixes")])]),e._v(" "),a("ul",[a("li",[e._v("Bug fix: Issue with MySQL and UTF8 characters (Korean in particular)")]),e._v(" "),a("li",[e._v('Bug fix: Issue with "unbound variable freshX_X found while\ngenerating SQL" fixed.')]),e._v(" "),a("li",[e._v("Bug fix: Inverse minimum cardinality assertion was being ignored.")]),e._v(" "),a("li",[e._v("Bug fix: Source SQL query doesn't accept parenthesis in WHERE\nclause.")]),e._v(" "),a("li",[e._v("Bug fix: JDBC connection doesn't recover when connection lost.")]),e._v(" "),a("li",[e._v("Bug fix: Sesame virtual repository fails to read Quest preferences.")]),e._v(" "),a("li",[e._v("Bug fix: CSV export function only exports 101 tuples instead of all\nthe tuples.")]),e._v(" "),a("li",[e._v("Bug fix: Null pointer exception in the query result table.")])]),e._v(" "),a("h2",{attrs:{id:"_1-7-alpha-rev-2039-december-30-2012"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-7-alpha-rev-2039-december-30-2012"}},[e._v("#")]),e._v(" 1.7-alpha (rev 2039, December 30, 2012)")]),e._v(" "),a("p",[a("strong",[e._v("SPARQL support")])]),e._v(" "),a("ul",[a("li",[e._v("Support for most SPARQL built in functions, e.g., arithmetics, type\nchecking, etc.")]),e._v(" "),a("li",[e._v("Support for CONSTRUCT and DESCRIBE result forms")]),e._v(" "),a("li",[e._v("Support for OPTIONAL and bound, which allow you to have NEGATION in\nthe usual SPARQL 1.0 style.")]),e._v(" "),a("li",[e._v('Support for variables in ANY position, e.g., to allow queries such\nas SELECT ?p ?v WHERE { ?x :name "John Smith". ?x ?p ?v }')]),e._v(" "),a("li",[e._v("Stronger compliance to standard RDF and SPARQL semantics for FILTER\nexpressions")])]),e._v(" "),a("p",[a("strong",[e._v("Performance")])]),e._v(" "),a("ul",[a("li",[e._v("Multiple improvements to the SPARQL-to-rule translation, mapping and\nTBox optimization algorithms.")]),e._v(" "),a("li",[e._v("New algorithm for query rewriting w.r.t. the TBox that increases the\nperformance of query answering by many orders of magnitude when\ninference w.r.t. to existential constants is enabled. The\nimplementation has been contributed by Dr. Roman Kontchakov.")]),e._v(" "),a("li",[e._v("New benchmarks. We tested against Virtuoso triple store, Virtuoso\nRDF views and D2R Server using the BSBM and FishMark benchmarks.")])]),e._v(" "),a("p",[a("strong",[e._v("APIs and Accessibility")])]),e._v(" "),a("ul",[a("li",[e._v('Completely new Sesame API provider, now users of Sesame can create\n"Virtual RDF repositories" with -ontop-')]),e._v(" "),a("li",[e._v("SPARQL end-point support through integration with Sesame's\nworkbench")])]),e._v(" "),a("p",[a("strong",[e._v("Mapping language")])]),e._v(" "),a("ul",[a("li",[e._v('Improved support for default literal types, now it conforms with the\nR2RML "Natural Mapping" specification')]),e._v(" "),a("li",[e._v("Support for language tags obtained from the DB")]),e._v(" "),a("li",[e._v("Proper support for constants in the mappings")]),e._v(" "),a("li",[e._v("Proper internal handling of NULL values in the database (as\nrecommended by the R2RML standard)")])]),e._v(" "),a("p",[a("strong",[e._v("Database support")])]),e._v(" "),a("ul",[a("li",[e._v("Restored support for Oracle, DB2 and SQL Server")]),e._v(" "),a("li",[e._v("Improved support and performance over MySQL")])]),e._v(" "),a("p",[a("strong",[e._v("Documentation")])]),e._v(" "),a("ul",[a("li",[e._v("Revised and extended all technical documentation")])]),e._v(" "),a("h2",{attrs:{id:"_1-7-alpha-rev-1692-august-16-2012"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-7-alpha-rev-1692-august-16-2012"}},[e._v("#")]),e._v(" 1.7-alpha-rev-1692 (August 16, 2012)")]),e._v(" "),a("p",[a("strong",[e._v("-ontop- general")])]),e._v(" "),a("ul",[a("li",[e._v("New file content for the OBDA output file. The file is no longer in\nXML format but instead it uses plain text for simplicity (Issue:\n#244).")]),e._v(" "),a("li",[e._v("Improved error messages when the system initializes, parses\nmappings, fails to")])]),e._v(" "),a("p",[a("code",[e._v("execute queries, etc.")]),a("br"),e._v(" "),a("code")]),e._v(" "),a("p",[a("strong",[e._v("-ontopPro- Protege plugin")])]),e._v(" "),a("ul",[a("li",[e._v("Support Protégé 4.2")]),e._v(" "),a("li",[e._v("Add cancel button during query execution to terminate the process\nimmediately.")]),e._v(" "),a("li",[e._v("Add help button to guide filling data source parameters.")]),e._v(" "),a("li",[e._v("The plugin no longer introduces prefix definitions")]),e._v(" "),a("li",[e._v('Implemented "Cancel" function for query execution')]),e._v(" "),a("li",[e._v("New shortcut CONTROL + T to test mappings in the mapping creator")]),e._v(" "),a("li",[e._v("Fixed several issues with prefix management and rendering of")])]),e._v(" "),a("p",[a("code",[e._v("URIs short forms")])]),e._v(" "),a("ul",[a("li",[e._v("Improved GUI, hints and suggestions for JDBC connections, improved\nTAB navigation")])]),e._v(" "),a("p",[a("code",[e._v("in all dialogs")])]),e._v(" "),a("ul",[a("li",[e._v("Bug fix: Improve error reporting and stack trace printing (Issue:\n#255, #262)")]),e._v(" "),a("li",[e._v("Bug fix: The target and source string got saved partially if\nnewlines are used.")]),e._v(" "),a("li",[e._v("Bug fix: The OBDA model doesn't get loaded if the query has an\nexception.")]),e._v(" "),a("li",[e._v("Improved error management during .obda and query file load")]),e._v(" "),a("li",[e._v("Fixed null pointer exception and blank window that appear in cases\nwhere the .owl file")])]),e._v(" "),a("p",[a("code",[e._v("in OWL/RDF contained different default ns and a default prefix")])]),e._v(" "),a("p",[a("strong",[e._v("-ontopQuest- OWL Reasoner")])]),e._v(" "),a("ul",[a("li",[e._v("Added support for SPARQL query modifiers: ORDER BY, OFFSET and LIMIT\n(Issue: #261).")]),e._v(" "),a("li",[e._v("Add query caching to speed up the system performance, now repeated\nquery execution will not require SQL generation every time.")]),e._v(" "),a("li",[e._v("Relaxed on punning checks to allow loading of DBPedia and similar\nontologies.")]),e._v(" "),a("li",[e._v("EXPERIMENTAL: Added support for mixed ABoxes for class assertions,\ni.e., most data comes from the mappings but a bit of data is also\nallowed in the ABox, e.g., global facts Planet('mars')")]),e._v(" "),a("li",[e._v("Improved support for MySQL, Postgres, DB2 and SQL Server dialects")]),e._v(" "),a("li",[e._v("Added a warnings when axioms are being ignored because of being out\nof OWL 2 QL")]),e._v(" "),a("li",[e._v("Improved error reporting on failed connections")]),e._v(" "),a("li",[e._v("Improved support for SQL AS for table and column renaming in\nmappings")]),e._v(" "),a("li",[e._v("New way to generate SQL. SQL now includes typing information and is\npretty printed.")]),e._v(" "),a("li",[e._v("Bug fix: Fixed issue with INVALID URI that appeared when mappings\nused data that contained invalid characters for URI's (e.g., white\nspace) Now we call URIEncode (Jena's) before returning the value.")]),e._v(" "),a("li",[e._v("Bug fix: Exception when importing data as ABox individuals.")]),e._v(" "),a("li",[e._v("Bug fix: Exception when null values is used as constants.")]),e._v(" "),a("li",[e._v("Bug fix: Exception if ambiguous column names are used in SQL\nqueries.")]),e._v(" "),a("li",[e._v("Bug fix: Wrong URI shorten if there are two or more namespaces with\noverlapping strings.")]),e._v(" "),a("li",[e._v("Bug fix: Null pointer exception due to inconsistent OBDA model\nidentifier string.")]),e._v(" "),a("li",[e._v("Bug fix: Unknown signature in the SELECT clause if the name is a\nqualified name and it comes from a view (Issue: #259)")]),e._v(" "),a("li",[e._v("Bug fix: Exception when using URIs as a constant values in SPARQL.")]),e._v(" "),a("li",[e._v("Bug fix: Prefix Manager accepts any string including invalid prefix\nnames.")])]),e._v(" "),a("p",[e._v("Known issues:")]),e._v(" "),a("ul",[a("li",[e._v("The ORDER BY modifier is not ready for columns with literal datatype")]),e._v(" "),a("li",[e._v("Issues with MySQL in non-ANSI mode")]),e._v(" "),a("li",[e._v("DateTime data properties in Oracle can crash the system.")])]),e._v(" "),a("h2",{attrs:{id:"_1-7-alpha-rev-1529-june-12-2012"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-7-alpha-rev-1529-june-12-2012"}},[e._v("#")]),e._v(" 1.7-alpha-rev-1529 (June 12, 2012)")]),e._v(" "),a("p",[a("strong",[e._v("-ontopPro- plugin")])]),e._v(" "),a("ul",[a("li",[e._v("Better layout, fonts and command icons.")]),e._v(" "),a("li",[e._v("Better query saving mechanism (Issue: #248)")]),e._v(" "),a("li",[e._v("Better error reporting to users and crash handling (Issue:\n#255, 256)")]),e._v(" "),a("li",[e._v("Pretty printing of SQL queries (Issue: #254)")]),e._v(" "),a("li",[e._v("Re-enabled the export function in the Query Interface panel (Issue:\n#213, #250)")]),e._v(" "),a("li",[e._v("Improved syntax-error messages in the mapping editor tooltip")]),e._v(" "),a("li",[e._v("Cleaned console messages")]),e._v(" "),a("li",[e._v('Added "Number of sources" indicator to show how many sources are\nalready declared in the OBDA model.')]),e._v(" "),a("li",[e._v("Improved ESC and CONTROL+ENTER shortcuts in most dialogs in the GUI.")]),e._v(" "),a("li",[e._v("Replaced JDBC Driver text box with an editable Combo Box with\ndefault driver string.")]),e._v(" "),a("li",[e._v("Better OBDA statistics table (Issue: #251)")]),e._v(" "),a("li",[e._v("Bug fix: CRITICAL stability issue that would rise an end-less cycle\nof warning messages when Quest crashed.")]),e._v(" "),a("li",[e._v('Bug fix: issue with final dot "." in mappings.')])]),e._v(" "),a("p",[a("strong",[e._v("-ontopQuest-")])]),e._v(" "),a("ul",[a("li",[e._v("Added support for data-type UUIDs for SQL Server (Issue: #253)")]),e._v(" "),a("li",[e._v("Now we create forward-only and concur-read-only JDBC Statements by\ndefault to allow for server side cursors.")]),e._v(" "),a("li",[e._v("Bug fix: issue with SQL parser and table renamings in SQL queries\n(Issue: #259)")]),e._v(" "),a("li",[e._v("Bug fix: issue with NULL pointer when primary key optimization in\nunfolding when there is a join on primary condition but atoms are\nnot unifiable.")])]),e._v(" "),a("p",[e._v("Known issues:")]),e._v(" "),a("ul",[a("li",[e._v("Oracle is unstable")])]),e._v(" "),a("h2",{attrs:{id:"_1-7-alpha-rev-1479-may-22-2012"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-7-alpha-rev-1479-may-22-2012"}},[e._v("#")]),e._v(" 1.7-alpha-rev-1479 (May 22, 2012)")]),e._v(" "),a("p",[e._v("Quest performance and features:")]),e._v(" "),a("ul",[a("li",[e._v("T-Mappings algorithm optimization: Combine disjunctive conditions in\nOR clauses instead of multiple mappings. This reduces the size of\nthe final query and improves its performance. (Issue: #237)")])]),e._v(" "),a("p",[e._v("Mapping language features (Quest and ontopCore):")]),e._v(" "),a("ul",[a("li",[e._v("Support using IS NULL and IS NOT NULL in SQL query (Issue: #200).")]),e._v(" "),a("li",[e._v("Support using UNION in SPARQL queries.")])]),e._v(" "),a("p",[e._v("Bug Fixes:")]),e._v(" "),a("ul",[a("li",[e._v("Fix packing problem in Windows XP (Issue: #228)")]),e._v(" "),a("li",[e._v("Fix packing problem in Linux")]),e._v(" "),a("li",[e._v("Fix unresponsive plugin when using mapping filter (Issue: #217).")]),e._v(" "),a("li",[e._v("Fix unresponsive plugin when inserting a new mapping (Issue: #232).")]),e._v(" "),a("li",[e._v("Fix support for MySQL in both virtual and classic mode (Issue:\n#238).")]),e._v(" "),a("li",[e._v("Fix support for Oracle in virtual mode (Issue: #226).")]),e._v(" "),a("li",[e._v('Fix issue where creating or modifying a mapping would not trigger a\n"ontology out of synch" flag.')])]),e._v(" "),a("p",[e._v("Known Issue:")]),e._v(" "),a("ul",[a("li",[e._v("Oracle still has some issues in classic mode.")])]),e._v(" "),a("h2",{attrs:{id:"_1-7-alpha-rev-1446-may-4-2012"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-7-alpha-rev-1446-may-4-2012"}},[e._v("#")]),e._v(" 1.7-alpha-rev-1446 (May 4, 2012)")]),e._v(" "),a("p",[e._v("Mapping language features (Quest and ontopCore):")]),e._v(" "),a("ul",[a("li",[e._v("Add support on writing qualified name for atom predicates.")]),e._v(" "),a("li",[e._v("Add coloring for atoms typed Individual in the target query.")])]),e._v(" "),a("p",[e._v("Bug Fixes:")]),e._v(" "),a("ul",[a("li",[e._v('Fix the "Show Short URIs" feature in the query panel.')])]),e._v(" "),a("h2",{attrs:{id:"_1-7-alpha-rev-1440-may-2-2012"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-7-alpha-rev-1440-may-2-2012"}},[e._v("#")]),e._v(" 1.7-alpha-rev-1440 (May 2, 2012)")]),e._v(" "),a("p",[e._v("Mapping language features (Quest and ontopCore):")]),e._v(" "),a("ul",[a("li",[e._v("Support writing URI constants in target queries (Issue: #227)")])]),e._v(" "),a("p",[e._v("General:")]),e._v(" "),a("ul",[a("li",[e._v("Better system logging for recording exceptions.")])]),e._v(" "),a("p",[e._v("Bug Fixes:")]),e._v(" "),a("ul",[a("li",[e._v("Fix the null pointer exception due to the old OBDA preferences.")]),e._v(" "),a("li",[e._v("Fix bugs related to vocabulary prefixes.")])]),e._v(" "),a("h2",{attrs:{id:"_1-7-alpha-rev-1427-april-17-2012"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-7-alpha-rev-1427-april-17-2012"}},[e._v("#")]),e._v(" 1.7-alpha-rev-1427 (April 17, 2012)")]),e._v(" "),a("p",[e._v("Quest performance and features:")]),e._v(" "),a("ul",[a("li",[e._v("Implemented the T-Mappings mapping optimization algorithm improved\nperformance of query rewriting in Virtual Mode. Now query rewriting\nis as fast in virtual ABox mode as in classic ABox mode (Issue:\n#169)")]),e._v(" "),a("li",[e._v("Implemented a new query containment algorithm that is many times\nfaster than before.")]),e._v(" "),a("li",[e._v("Added data source analysis to obtain DB metadata for SQL query\ngeneration.")]),e._v(" "),a("li",[e._v("Added analysis of SQL queries in the mappings to produce better SQL\nqueries.")]),e._v(" "),a("li",[e._v("Added "),a("strong",[e._v("SQL JOIN ELIMINATION")]),e._v(" using PRIMARY KEY metadata.")]),e._v(" "),a("li",[e._v("Added mappings optimization using query containment w.r.t.\nconstraints")]),e._v(" "),a("li",[e._v("Added initial support for "),a("strong",[e._v("FILTER")])]),e._v(" "),a("li",[e._v("Added support for typed constants in SPARQL queries (Issue: #157)")]),e._v(" "),a("li",[e._v("Small updates to internal API for speed of equality, hash and clone\ncomputation")])]),e._v(" "),a("p",[e._v("Mapping language features (Quest and ontopCore):")]),e._v(" "),a("ul",[a("li",[e._v("New Turtle-like syntax for mappings allows for more succinct and\neasy to read mappings.")]),e._v(" "),a("li",[e._v("Added support for LANGUAGE tag for the Literal datatype (Issue:\n#198)")]),e._v(" "),a("li",[e._v("Added support for datatypes in the OBDA mapping axioms (Issue:\n#147, #194, #196)")]),e._v(" "),a("li",[e._v("Added URI templates for URI creation in mapping mapping axioms\n(Issue: #151)")]),e._v(" "),a("li",[e._v("New feature for typing literals in mapping axioms (Issue: #194,\n#207)")])]),e._v(" "),a("p",[e._v("General:")]),e._v(" "),a("ul",[a("li",[e._v("Added support for OWL API 3 (Issue: #98)")]),e._v(" "),a("li",[e._v("Internal refactoring of all modules and packages for a cleaner API")])]),e._v(" "),a("p",[e._v("ontopPro:")]),e._v(" "),a("ul",[a("li",[e._v("The plugin is now compatible with Protege 4.1 (Issue: #99)")]),e._v(" "),a("li",[e._v("The plugin has a new and fresh GUI display.")]),e._v(" "),a("li",[e._v("Stronger integration with Protege's refactoring mechanism")]),e._v(" "),a("li",[e._v("The ABox materializer can import data complete with datatype\ninformation (Issue: #195)")]),e._v(" "),a("li",[e._v("The target query use Turtle syntax for better display and management\n(Issue: #204)")]),e._v(" "),a("li",[e._v("The plugin has Class/Property panel for better navigation and\nfiltering.")])]),e._v(" "),a("p",[e._v("Bug Fixes:")]),e._v(" "),a("ul",[a("li",[e._v("Fixed a problem with the encoding of axioms of the form\nsubClassOf(Person, hasFather some Person)")]),e._v(" "),a("li",[e._v("Fixed issues with open and dead JDBC connections")]),e._v(" "),a("li",[e._v("Cleaned OWLReasoner synchronization issue")]),e._v(" "),a("li",[e._v("Fixed null pointer exceptions related to incorrect mappings")]),e._v(" "),a("li",[e._v("Proper error handling for translating an empty datalog program\n(Issue: #197)")]),e._v(" "),a("li",[e._v('Fixed the "Attach Prefixes" feature in the OBDA Query panel\n(Issue: #211)')]),e._v(" "),a("li",[e._v("Fixed issue regarding xsd:dateTime (Issue: #199)")])]),e._v(" "),a("h2",{attrs:{id:"_1-6-1-october-19-2011"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-6-1-october-19-2011"}},[e._v("#")]),e._v(" 1.6.1 (October 19, 2011)")]),e._v(" "),a("ul",[a("li",[e._v("Fast patch in the query translation module.")])]),e._v(" "),a("h2",{attrs:{id:"_1-6-october-18-2011"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-6-october-18-2011"}},[e._v("#")]),e._v(" 1.6 (October 18, 2011)")]),e._v(" "),a("ul",[a("li",[e._v("Allow fast navigation using TAB key in the new mapping form (Issue:\n#92)")]),e._v(" "),a("li",[e._v("Allow SQL query execution in the mapping tree (Issue: #104)")]),e._v(" "),a("li",[e._v("Improvement in the error message deliveries (Issues: #107, #112,\n#118)")]),e._v(" "),a("li",[e._v('Improvement in the data source management tab, including adding\n"Test Connection" button (Issues: #108, #111, #114)')]),e._v(" "),a("li",[e._v("Add OBDA model statistics report (Issues: #106, #117)")]),e._v(" "),a("li",[e._v("Add support for adding integrated data source in Teiid (Issue: #89)")]),e._v(" "),a("li",[e._v("Fix the unresponsive cancel button during importing OWL Individuals\n(Issue: #88)")]),e._v(" "),a("li",[e._v("Fix CSV header in the exported query result (Issue: #120)")]),e._v(" "),a("li",[e._v("Fix connection failure when users change the parameters (Issue:\n#121)")]),e._v(" "),a("li",[e._v("Fix the password field so now the text is hidden (Issue: #113)")]),e._v(" "),a("li",[e._v("Fix query selection in the OBDA query tab (Issue: #91)")]),e._v(" "),a("li",[e._v("Fix import failure when storing very long record values (Issue:\n#95)")]),e._v(" "),a("li",[e._v("Fix import failure when storing records that contain single quotes\n(Issue: #96)")])]),e._v(" "),a("h2",{attrs:{id:"_1-5-1-rc1-july-15-2011"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-5-1-rc1-july-15-2011"}},[e._v("#")]),e._v(" 1.5.1-RC1 (July 15, 2011)")]),e._v(" "),a("ul",[a("li",[e._v("Significant code refactoring in the plugin. This effort makes the\ncode easier to debug and to extend, and is almost ready for Protege\n4.1 and OWL-API 3.0 support.")]),e._v(" "),a("li",[e._v("Term renaming. Modified the term 'Mapping Head' to 'Target\nQuery' and 'Mapping Body' to 'Source Query' to maintain the\nconsistency with the literature.")]),e._v(" "),a("li",[e._v("Temporarly disabled the SPARQL query coloring.")]),e._v(" "),a("li",[e._v("Temporarly disabled the 'Load OWL Individuals into DB'\nfunctionality.")]),e._v(" "),a("li",[e._v("Add improved search filters in the mapping manager (Issues: #37,\n#54).")]),e._v(" "),a("li",[e._v("Add 'show short URIs' option in the query results to hide long URI\nstrings.")]),e._v(" "),a("li",[e._v("Add 'select all', 'select none', 'expand all' and 'collapse\nall' buttons for easy browsing in the mapping tree (Issues: #35,\n#36).")]),e._v(" "),a("li",[e._v("Add mapping validation with respect to the vocabulary in the\nontology (Issues: #42).")]),e._v(" "),a("li",[e._v("Add input validation to many parts of the GUI (Issues: #63, #64,\n#65, #67, #68, #69, #70, #71, #76).")]),e._v(" "),a("li",[e._v("Fix the save query functionality in the Query manager (Issues:\n#57).")]),e._v(" "),a("li",[e._v("Fix the persistency of user preferences when opening/closing Protege\n(Issues: #58).")]),e._v(" "),a("li",[e._v("Fix the exceptions that appeared when loading/saving/reloading\nontologies (Issues: #59, #60, #61, #75).")]),e._v(" "),a("li",[e._v("Fix problems with several progress dialogs in the GUI (Issues: #50,\n#87).")]),e._v(" "),a("li",[e._v("Fix problems in the 'tuple count' functionality (Issues: #82,\n#84).")])])])}),[],!1,null,null,null);t.default=i.exports}}]); \ No newline at end of file diff --git a/assets/js/62.da84513e.js b/assets/js/62.ed4817c7.js similarity index 99% rename from assets/js/62.da84513e.js rename to assets/js/62.ed4817c7.js index 04414d0f0..9be5c20d0 100644 --- a/assets/js/62.da84513e.js +++ b/assets/js/62.ed4817c7.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[62],{439:function(e,t,r){"use strict";r.r(t);var o=r(51),a=Object(o.a)({},(function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[r("h1",{attrs:{id:"faq"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#faq"}},[e._v("#")]),e._v(" FAQ")]),e._v(" "),r("p",[e._v("Some Frequently Asked Questions")]),e._v(" "),r("h2",{attrs:{id:"general"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#general"}},[e._v("#")]),e._v(" General")]),e._v(" "),r("h3",{attrs:{id:"which-mapping-syntaxes-are-supported"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#which-mapping-syntaxes-are-supported"}},[e._v("#")]),e._v(" Which mapping syntaxes are supported?")]),e._v(" "),r("p",[e._v("We support "),r("a",{attrs:{href:"https://www.w3.org/TR/r2rml/",target:"_blank",rel:"noopener"}},[e._v("R2RML"),r("OutboundLink")],1),e._v(" and our own mapping syntax, which can be automatically converted into R2RML using Ontop CLI command "),r("a",{attrs:{href:"/guide/cli#ontop-mapping-to-r2rml"}},[r("code",[e._v("ontop mapping to-r2rml")])])]),e._v(" "),r("h3",{attrs:{id:"is-it-open-source"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#is-it-open-source"}},[e._v("#")]),e._v(" Is it open source?")]),e._v(" "),r("p",[e._v("Yes! Ontop is available under the Apache License, Version 2.0.")]),e._v(" "),r("h3",{attrs:{id:"how-can-i-report-a-bug-or-ask-other-questions"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#how-can-i-report-a-bug-or-ask-other-questions"}},[e._v("#")]),e._v(" How can I report a bug or ask other questions?")]),e._v(" "),r("p",[e._v("You can get in touch with us through "),r("a",{attrs:{href:"/community/support"}},[e._v("our support channels")]),e._v(" and "),r("RouterLink",{attrs:{to:"/community/contributing/"}},[e._v("contribute to the project")]),e._v("\nby, for instance, filing a "),r("a",{attrs:{href:"/community/contributing/bug-report"}},[e._v("bug report")]),e._v(".")],1),e._v(" "),r("h3",{attrs:{id:"does-ontop-support-sparql-update"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#does-ontop-support-sparql-update"}},[e._v("#")]),e._v(" Does Ontop support SPARQL Update?")]),e._v(" "),r("p",[e._v("No, as for now, Ontop is a read-only system, it does not support "),r("a",{attrs:{href:"https://www.w3.org/TR/sparql11-update/",target:"_blank",rel:"noopener"}},[e._v("SPARQL Update queries"),r("OutboundLink")],1),e._v(" but only SELECT, CONSTRUCT, ASK and DESCRIBE queries. For more details, see "),r("a",{attrs:{href:"/guide/compliance"}},[e._v("the compliance page")]),e._v(".")]),e._v(" "),r("h2",{attrs:{id:"protege"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#protege"}},[e._v("#")]),e._v(" Protégé")]),e._v(" "),r("h3",{attrs:{id:"no-suitable-driver-found-for-driver"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#no-suitable-driver-found-for-driver"}},[e._v("#")]),e._v(" No suitable driver found for .. (driver)")]),e._v(" "),r("p",[e._v("You need to download and install the right JDBC driver in Protégé.\nThis is required in order to query using SPARQL and use other features of Ontop. To add a new JDBC Driver:")]),e._v(" "),r("ul",[r("li",[e._v("in Protégé, go to "),r("em",[e._v("Preference")]),e._v(" -> "),r("em",[e._v("JDBC Drivers")]),e._v(" tab;")]),e._v(" "),r("li",[e._v("add a new entry;")]),e._v(" "),r("li",[e._v("type a description, e.g., "),r("em",[e._v("PostgreSQL JDBC Driver")]),e._v(";")]),e._v(" "),r("li",[e._v("type the driver’s class string, e.g., "),r("em",[e._v("org.postgresql.Driver")]),e._v(";")]),e._v(" "),r("li",[e._v("type or select the location of the driver’s JAR file, e.g., "),r("em",[e._v("postgresql-8.4-701.jdbc4.jar")]),e._v(";")]),e._v(" "),r("li",[e._v("click OK .")])]),e._v(" "),r("p",[e._v("See also\n"),r("a",{attrs:{href:"https://github.com/ontop/ontop/wiki/ontopProInstallation#setting-up-the-jdbc-drivers-in-protege",target:"_blank",rel:"noopener"}},[e._v("Setting up JDBC Drivers"),r("OutboundLink")],1),e._v("\nand "),r("a",{attrs:{href:"https://github.com/ontop/ontop/wiki/ObdalibPluginJDBC",target:"_blank",rel:"noopener"}},[e._v("JDBC Information"),r("OutboundLink")],1),e._v(".")]),e._v(" "),r("h3",{attrs:{id:"no-jdbc-drivers-tab-in-the-preferences"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#no-jdbc-drivers-tab-in-the-preferences"}},[e._v("#")]),e._v(' No "JDBC drivers" tab in the preferences')]),e._v(" "),r("p",[e._v("You probably can see the following message in the Protégé console:")]),e._v(" "),r("div",{staticClass:"language- extra-class"},[r("pre",{pre:!0,attrs:{class:"language-text"}},[r("code",[e._v("org.osgi.framework.BundleException: Activator start error in bundle org.protege.osgi.jdbc.prefs [20].)\norg.protege.osgi.jdbc.RegistryException: java.lang.ClassNotFoundException: org.h2.Driver\n")])])]),r("p",[e._v("Please go to the "),r("em",[e._v("Preferences")]),e._v(" and click on "),r("em",[e._v('"Reset preferences"')]),e._v(".")]),e._v(" "),r("h3",{attrs:{id:"protege-does-not-show-the-ontop-tabs"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#protege-does-not-show-the-ontop-tabs"}},[e._v("#")]),e._v(" Protégé does not show the Ontop tabs")]),e._v(" "),r("p",[e._v("To see the tabs go to "),r("em",[e._v("Windows -> tabs -> Ontop Mappings and Ontop SPARQL")]),e._v(".")]),e._v(" "),r("h2",{attrs:{id:"rdf4j-workbench-not-supported-anymore"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#rdf4j-workbench-not-supported-anymore"}},[e._v("#")]),e._v(" RDF4J workbench (not supported anymore)")]),e._v(" "),r("h3",{attrs:{id:"why-rdf4j-workbench-refuses-to-delete-some-repositories"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#why-rdf4j-workbench-refuses-to-delete-some-repositories"}},[e._v("#")]),e._v(" Why RDF4J Workbench refuses to delete some repositories?")]),e._v(" "),r("p",[e._v("For deleting metadata about a repository, the RDF4J Workbench should be able to create an instance of this repository. However, if the repository configuration is invalid (due to, for instance to bad mapping and ontology files), such an instance cannot be created.\nTo avoid this situation, the configuration is validated in depth when a new repository is added to the Workbench. However, if the mapping and ontology files are changed afterwards, we offer no protection. One workaround is to create a valid repository with the same name and then to delete it. Another workaround is to delete it from the RDF4J console.")])])}),[],!1,null,null,null);t.default=a.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[62],{437:function(e,t,r){"use strict";r.r(t);var o=r(51),a=Object(o.a)({},(function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[r("h1",{attrs:{id:"faq"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#faq"}},[e._v("#")]),e._v(" FAQ")]),e._v(" "),r("p",[e._v("Some Frequently Asked Questions")]),e._v(" "),r("h2",{attrs:{id:"general"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#general"}},[e._v("#")]),e._v(" General")]),e._v(" "),r("h3",{attrs:{id:"which-mapping-syntaxes-are-supported"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#which-mapping-syntaxes-are-supported"}},[e._v("#")]),e._v(" Which mapping syntaxes are supported?")]),e._v(" "),r("p",[e._v("We support "),r("a",{attrs:{href:"https://www.w3.org/TR/r2rml/",target:"_blank",rel:"noopener"}},[e._v("R2RML"),r("OutboundLink")],1),e._v(" and our own mapping syntax, which can be automatically converted into R2RML using Ontop CLI command "),r("a",{attrs:{href:"/guide/cli#ontop-mapping-to-r2rml"}},[r("code",[e._v("ontop mapping to-r2rml")])])]),e._v(" "),r("h3",{attrs:{id:"is-it-open-source"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#is-it-open-source"}},[e._v("#")]),e._v(" Is it open source?")]),e._v(" "),r("p",[e._v("Yes! Ontop is available under the Apache License, Version 2.0.")]),e._v(" "),r("h3",{attrs:{id:"how-can-i-report-a-bug-or-ask-other-questions"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#how-can-i-report-a-bug-or-ask-other-questions"}},[e._v("#")]),e._v(" How can I report a bug or ask other questions?")]),e._v(" "),r("p",[e._v("You can get in touch with us through "),r("a",{attrs:{href:"/community/support"}},[e._v("our support channels")]),e._v(" and "),r("RouterLink",{attrs:{to:"/community/contributing/"}},[e._v("contribute to the project")]),e._v("\nby, for instance, filing a "),r("a",{attrs:{href:"/community/contributing/bug-report"}},[e._v("bug report")]),e._v(".")],1),e._v(" "),r("h3",{attrs:{id:"does-ontop-support-sparql-update"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#does-ontop-support-sparql-update"}},[e._v("#")]),e._v(" Does Ontop support SPARQL Update?")]),e._v(" "),r("p",[e._v("No, as for now, Ontop is a read-only system, it does not support "),r("a",{attrs:{href:"https://www.w3.org/TR/sparql11-update/",target:"_blank",rel:"noopener"}},[e._v("SPARQL Update queries"),r("OutboundLink")],1),e._v(" but only SELECT, CONSTRUCT, ASK and DESCRIBE queries. For more details, see "),r("a",{attrs:{href:"/guide/compliance"}},[e._v("the compliance page")]),e._v(".")]),e._v(" "),r("h2",{attrs:{id:"protege"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#protege"}},[e._v("#")]),e._v(" Protégé")]),e._v(" "),r("h3",{attrs:{id:"no-suitable-driver-found-for-driver"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#no-suitable-driver-found-for-driver"}},[e._v("#")]),e._v(" No suitable driver found for .. (driver)")]),e._v(" "),r("p",[e._v("You need to download and install the right JDBC driver in Protégé.\nThis is required in order to query using SPARQL and use other features of Ontop. To add a new JDBC Driver:")]),e._v(" "),r("ul",[r("li",[e._v("in Protégé, go to "),r("em",[e._v("Preference")]),e._v(" -> "),r("em",[e._v("JDBC Drivers")]),e._v(" tab;")]),e._v(" "),r("li",[e._v("add a new entry;")]),e._v(" "),r("li",[e._v("type a description, e.g., "),r("em",[e._v("PostgreSQL JDBC Driver")]),e._v(";")]),e._v(" "),r("li",[e._v("type the driver’s class string, e.g., "),r("em",[e._v("org.postgresql.Driver")]),e._v(";")]),e._v(" "),r("li",[e._v("type or select the location of the driver’s JAR file, e.g., "),r("em",[e._v("postgresql-8.4-701.jdbc4.jar")]),e._v(";")]),e._v(" "),r("li",[e._v("click OK .")])]),e._v(" "),r("p",[e._v("See also\n"),r("a",{attrs:{href:"https://github.com/ontop/ontop/wiki/ontopProInstallation#setting-up-the-jdbc-drivers-in-protege",target:"_blank",rel:"noopener"}},[e._v("Setting up JDBC Drivers"),r("OutboundLink")],1),e._v("\nand "),r("a",{attrs:{href:"https://github.com/ontop/ontop/wiki/ObdalibPluginJDBC",target:"_blank",rel:"noopener"}},[e._v("JDBC Information"),r("OutboundLink")],1),e._v(".")]),e._v(" "),r("h3",{attrs:{id:"no-jdbc-drivers-tab-in-the-preferences"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#no-jdbc-drivers-tab-in-the-preferences"}},[e._v("#")]),e._v(' No "JDBC drivers" tab in the preferences')]),e._v(" "),r("p",[e._v("You probably can see the following message in the Protégé console:")]),e._v(" "),r("div",{staticClass:"language- extra-class"},[r("pre",{pre:!0,attrs:{class:"language-text"}},[r("code",[e._v("org.osgi.framework.BundleException: Activator start error in bundle org.protege.osgi.jdbc.prefs [20].)\norg.protege.osgi.jdbc.RegistryException: java.lang.ClassNotFoundException: org.h2.Driver\n")])])]),r("p",[e._v("Please go to the "),r("em",[e._v("Preferences")]),e._v(" and click on "),r("em",[e._v('"Reset preferences"')]),e._v(".")]),e._v(" "),r("h3",{attrs:{id:"protege-does-not-show-the-ontop-tabs"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#protege-does-not-show-the-ontop-tabs"}},[e._v("#")]),e._v(" Protégé does not show the Ontop tabs")]),e._v(" "),r("p",[e._v("To see the tabs go to "),r("em",[e._v("Windows -> tabs -> Ontop Mappings and Ontop SPARQL")]),e._v(".")]),e._v(" "),r("h2",{attrs:{id:"rdf4j-workbench-not-supported-anymore"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#rdf4j-workbench-not-supported-anymore"}},[e._v("#")]),e._v(" RDF4J workbench (not supported anymore)")]),e._v(" "),r("h3",{attrs:{id:"why-rdf4j-workbench-refuses-to-delete-some-repositories"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#why-rdf4j-workbench-refuses-to-delete-some-repositories"}},[e._v("#")]),e._v(" Why RDF4J Workbench refuses to delete some repositories?")]),e._v(" "),r("p",[e._v("For deleting metadata about a repository, the RDF4J Workbench should be able to create an instance of this repository. However, if the repository configuration is invalid (due to, for instance to bad mapping and ontology files), such an instance cannot be created.\nTo avoid this situation, the configuration is validated in depth when a new repository is added to the Workbench. However, if the mapping and ontology files are changed afterwards, we offer no protection. One workaround is to create a valid repository with the same name and then to delete it. Another workaround is to delete it from the RDF4J console.")])])}),[],!1,null,null,null);t.default=a.exports}}]); \ No newline at end of file diff --git a/assets/js/63.88b74908.js b/assets/js/63.ab25da0d.js similarity index 97% rename from assets/js/63.88b74908.js rename to assets/js/63.ab25da0d.js index 9abbc6446..b805c854a 100644 --- a/assets/js/63.88b74908.js +++ b/assets/js/63.ab25da0d.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[63],{440:function(t,e,r){"use strict";r.r(e);var o=r(51),n=Object(o.a)({},(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[r("h1",{attrs:{id:"work-with-us"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#work-with-us"}},[t._v("#")]),t._v(" Work with us")]),t._v(" "),r("p",[t._v("if you are enthusiastic in the Ontop system and the Virtual Knowledge Graph technology,\nthere are many opportunities, which range from a small course project, to a complete PhD study, or a full time developer position.")]),t._v(" "),r("h2",{attrs:{id:"free-university-of-bozen-bolzano"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#free-university-of-bozen-bolzano"}},[t._v("#")]),t._v(" Free University of Bozen-Bolzano")]),t._v(" "),r("p",[t._v("At the "),r("a",{attrs:{href:"https://www.inf.unibz.it/krdb/in2data/",target:"_blank",rel:"noopener"}},[t._v("In2Data research group"),r("OutboundLink")],1),t._v(" at the KBDB group of Free University of Bozen-Bolzano, we are offering:")]),t._v(" "),r("ul",[r("li",[t._v("Student course project")]),t._v(" "),r("li",[t._v("Bachelor/Master thesis")]),t._v(" "),r("li",[t._v("PhD student positions ("),r("a",{attrs:{href:"https://www.inf.unibz.it/krdb/phd/",target:"_blank",rel:"noopener"}},[t._v("https://www.inf.unibz.it/krdb/phd/"),r("OutboundLink")],1),t._v(")")]),t._v(" "),r("li",[t._v("Research assistant / Scientific programmer / PostDoc researcher positions")])]),t._v(" "),r("p",[t._v("If you are interested, please get in touch with "),r("a",{attrs:{href:"http://www.inf.unibz.it/~calvanese/",target:"_blank",rel:"noopener"}},[t._v("Prof. Diego Calvanese"),r("OutboundLink")],1),t._v(" or "),r("a",{attrs:{href:"https://www.ghxiao.org/",target:"_blank",rel:"noopener"}},[t._v("Dr. Guohui Xiao"),r("OutboundLink")],1),t._v(".")]),t._v(" "),r("h2",{attrs:{id:"ontopic"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#ontopic"}},[t._v("#")]),t._v(" Ontopic")]),t._v(" "),r("p",[t._v("At the company "),r("a",{attrs:{href:"https://ontopic.ai/",target:"_blank",rel:"noopener"}},[t._v("Ontopic s.r.l."),r("OutboundLink")],1),t._v(", we are offering:")]),t._v(" "),r("ul",[r("li",[t._v("Student internship")]),t._v(" "),r("li",[t._v("Bachelor/Master thesis")]),t._v(" "),r("li",[t._v("Part time or full time developer positions.")])]),t._v(" "),r("p",[t._v("If you are interested, please get in touch with "),r("code",[t._v("inquiry@ontopic.ai")]),t._v(".")])])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[63],{439:function(t,e,r){"use strict";r.r(e);var o=r(51),n=Object(o.a)({},(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[r("h1",{attrs:{id:"work-with-us"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#work-with-us"}},[t._v("#")]),t._v(" Work with us")]),t._v(" "),r("p",[t._v("if you are enthusiastic in the Ontop system and the Virtual Knowledge Graph technology,\nthere are many opportunities, which range from a small course project, to a complete PhD study, or a full time developer position.")]),t._v(" "),r("h2",{attrs:{id:"free-university-of-bozen-bolzano"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#free-university-of-bozen-bolzano"}},[t._v("#")]),t._v(" Free University of Bozen-Bolzano")]),t._v(" "),r("p",[t._v("At the "),r("a",{attrs:{href:"https://www.inf.unibz.it/krdb/in2data/",target:"_blank",rel:"noopener"}},[t._v("In2Data research group"),r("OutboundLink")],1),t._v(" at the KBDB group of Free University of Bozen-Bolzano, we are offering:")]),t._v(" "),r("ul",[r("li",[t._v("Student course project")]),t._v(" "),r("li",[t._v("Bachelor/Master thesis")]),t._v(" "),r("li",[t._v("PhD student positions ("),r("a",{attrs:{href:"https://www.inf.unibz.it/krdb/phd/",target:"_blank",rel:"noopener"}},[t._v("https://www.inf.unibz.it/krdb/phd/"),r("OutboundLink")],1),t._v(")")]),t._v(" "),r("li",[t._v("Research assistant / Scientific programmer / PostDoc researcher positions")])]),t._v(" "),r("p",[t._v("If you are interested, please get in touch with "),r("a",{attrs:{href:"http://www.inf.unibz.it/~calvanese/",target:"_blank",rel:"noopener"}},[t._v("Prof. Diego Calvanese"),r("OutboundLink")],1),t._v(" or "),r("a",{attrs:{href:"https://www.ghxiao.org/",target:"_blank",rel:"noopener"}},[t._v("Dr. Guohui Xiao"),r("OutboundLink")],1),t._v(".")]),t._v(" "),r("h2",{attrs:{id:"ontopic"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#ontopic"}},[t._v("#")]),t._v(" Ontopic")]),t._v(" "),r("p",[t._v("At the company "),r("a",{attrs:{href:"https://ontopic.ai/",target:"_blank",rel:"noopener"}},[t._v("Ontopic s.r.l."),r("OutboundLink")],1),t._v(", we are offering:")]),t._v(" "),r("ul",[r("li",[t._v("Student internship")]),t._v(" "),r("li",[t._v("Bachelor/Master thesis")]),t._v(" "),r("li",[t._v("Part time or full time developer positions.")])]),t._v(" "),r("p",[t._v("If you are interested, please get in touch with "),r("code",[t._v("inquiry@ontopic.ai")]),t._v(".")])])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/68.5b14c426.js b/assets/js/68.1f561b07.js similarity index 99% rename from assets/js/68.5b14c426.js rename to assets/js/68.1f561b07.js index 1872e71de..dc30f3f12 100644 --- a/assets/js/68.5b14c426.js +++ b/assets/js/68.1f561b07.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[68],{445:function(e,n,t){"use strict";t.r(n);var i=t(51),o=Object(i.a)({},(function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"intermediate-query-optimization"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#intermediate-query-optimization"}},[e._v("#")]),e._v(" Intermediate query optimization")]),e._v(" "),t("div",{staticClass:"custom-block warning"},[t("p",{staticClass:"custom-block-title"},[e._v("WARNING")]),e._v(" "),t("p",[e._v("TODO: UPDATE AND CHECK (2 years old, imported from AsciiDocs)")])]),e._v(" "),t("p",[e._v("This section provides a high level description of different transformations which may be applied to "),t("a",{attrs:{href:"/dev/iq"}},[e._v("Intermediate Queries")]),e._v(" ("),t("em",[e._v("IQs")]),e._v(" in what follows) for optimization purposes.")]),e._v(" "),t("h2",{attrs:{id:"notation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#notation"}},[e._v("#")]),e._v(" Notation")]),e._v(" "),t("p",[e._v("The different types of nodes of an IQ are presented "),t("a",{attrs:{href:"/dev/iq#query-nodes"}},[e._v("in the dedicated section")]),e._v(".\nThe following notation will also be use in the current document.")]),e._v(" "),t("h3",{attrs:{id:"sub-trees"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#sub-trees"}},[e._v("#")]),e._v(" (Sub)trees")]),e._v(" "),t("p",[e._v("If s is a tree,\nthen root(s) will designate its root.")]),e._v(" "),t("p",[e._v('If n is a node in an IQ Q,\nthen children~Q~(n) (resp. children(n) when Q is obvious from the context) will designate the immediate children of n in Q,\nand subtree~Q~(n) (resp. subtree(n)) the maximal subtree of Q rooted in n.\nIn addition,\na "subtree of Q" will be understood as a maximal subtree of Q rooted in some node of Q.\nFinally,\nchildSubtrees~Q~(n) (resp. childSubtrees(n)) will stand for {subtree~Q~(c) | c ∈ children~Q~(n)}')]),e._v(" "),t("h3",{attrs:{id:"projected-variables"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#projected-variables"}},[e._v("#")]),e._v(" Projected variables")]),e._v(" "),t("p",[e._v("If s is a subtree in an IQ,\nthen var(s) will designate the "),t("em",[e._v("variables projected out by s")]),e._v(",\ndefined inductively as follows:")]),e._v(" "),t("ul",[t("li",[t("p",[e._v("If root(s) explicitly projects out variables (construction node,\nunion node,\ndata node or empty node),\nthen var(s) is the set of such variables.")])]),e._v(" "),t("li",[t("p",[e._v("Otherwise,\nvar(s) = ⋃ ~s∈childSubtrees(n)~ var(s)")])])]),e._v(" "),t("p",[e._v("If e is an (explicit) join or filter condition,\nthen var(e) will designate the variables appearing in e.")]),e._v(" "),t("h2",{attrs:{id:"propagating-down-boolean-expressions"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#propagating-down-boolean-expressions"}},[e._v("#")]),e._v(" Propagating down boolean expressions")]),e._v(" "),t("p",[e._v("This optimization is used for (some) NoSQL underlying DBMS.\nIt consists in transforming an input IQ into an equivalent one such that,\nwhenever possible,\nselections precede other algebraic operations.\nOr in other words,\nit consists in propagating (explicit) boolean expressions down the algebraic tree.")]),e._v(" "),t("p",[e._v("Three types of IQ nodes support boolean expressions,\nnamely:")]),e._v(" "),t("ul",[t("li",[e._v("filter nodes,")]),e._v(" "),t("li",[e._v("inner join nodes, and")]),e._v(" "),t("li",[e._v("left join nodes")])]),e._v(" "),t("p",[e._v("For each node n of one of these types,\nif n has an explicit boolean expression e attached to it,\nthen e is put into DNF,\nand each resulting conjunct may be propagated down independently.\nFor instance,\nn may be a filter node,\nand e the expression (x > y) ∧ (y ≠ z).\nThen (x > y) and (y ≠ z) may both be propagated down,\nindependently from each other.\nIf n is a node of one of the three types just mentioned,\nthen bool(n) will designate the set of such conjuncts.")]),e._v(" "),t("h3",{attrs:{id:"propagation-decision-and-recipient-selection"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#propagation-decision-and-recipient-selection"}},[e._v("#")]),e._v(" Propagation decision and recipient selection")]),e._v(" "),t("p",[e._v("Propagation decisions are primarily taken based on a comparison between:")]),e._v(" "),t("ul",[t("li",[e._v("the variables var(e) present in the conjunct e being propagated down,\nand")]),e._v(" "),t("li",[e._v("the variables var(s) projected out by each candidate subtree s for the propagation of e.")])]),e._v(" "),t("h4",{attrs:{id:"default-case-inner-join-of-filter-provider-node"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#default-case-inner-join-of-filter-provider-node"}},[e._v("#")]),e._v(" Default case (inner join of filter provider node)")]),e._v(" "),t("p",[e._v("Let e ∈ bool(n).\nThe default rule to decide whether e can be propagated down from n is the following:\nfor each s ∈ childSubtrees(n),\nif var(e) ⊆ var(s),\nthen e can be propagated down to s.")]),e._v(" "),t("p",[e._v("An expression e being propagated down a subtree s also needs (a) new recipient node(s) to support it.\nThe recipients selection procedure is the following:")]),e._v(" "),t("ul",[t("li",[t("p",[e._v("if root(s) is neither a union node,\nconstruction node or left join node,\nthen it is the (only) recipient of e in s.")])]),e._v(" "),t("li",[t("p",[e._v("Otherwise,\neach s' ∈ childSubtrees(root(s)) recursively becomes a new candidate subtree for propagation.\nIf there no s' ∈ childSubtrees(root(s)) to which e can be propagated down,\nthen root(s) is the (only) recipient of e in s.\nNote that in a valid IQ,\nif s is a construction or union node,\nthen var(s) ⊆ var(s') must hold for each s' ∈ childSubtrees(root(s)),\ntherefore var(e) ⊆ var(s') holds by transitivity,\nsuch that root(s) cannot be the recipient for e in s.\nBut it may be the case if s is a left join node.")])])]),e._v(" "),t("p",[e._v('Finally,\nif a recipient node r for e in s (or s\') does not natively supports non-conditional boolean expressions,\ni.e. if r is neither a filter nor an inner join node,\nthen a new filter node is created as the (immediate) parent of r,\nin order to support e.\nAlternatively (as a form of syntactic sugar),\nif the node n initially providing e is the immediate parent of r,\nthen this new filter node is not needed,\nand e can remain attached to n,\nwhich in this case plays the role of "pseudo-recipient" of e in s.')]),e._v(" "),t("p",[e._v("Note that if n is the pseudo-recipient of e in s,\nthen from the above selection procedure,\nroot(s) must be a data node,\nempty node,\ntrue node,\nor a left join node with no child accepting e,\nwhich in all cases guarantees that e cannot be further propagated down s.")]),e._v(" "),t("h4",{attrs:{id:"specific-case-left-join-provider-node"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#specific-case-left-join-provider-node"}},[e._v("#")]),e._v(" Specific case (left join provider node)")]),e._v(" "),t("p",[e._v("The propagation decision and recipient selection procedures are identical for a boolean conjunct e provided by a left join node n,\nbut with an exception:\ne may only be propagated down the subtree rooted in the right child of n.\nIndeed,\nif e was propagated down the left subtree,\nan additional selection would be added to the algebraic expression represented by that left branch,\nviolating the semantics of conditions attached to a left join (see link:intermediateQuery_detailed.adoc#leftjoinNode[the dedicated section] for an explanation).")]),e._v(" "),t("h3",{attrs:{id:"duplication-decision"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#duplication-decision"}},[e._v("#")]),e._v(" Duplication decision")]),e._v(" "),t("p",[e._v("Let e ∈ bool(n) for some node n in an IQ Q.\nAnd let us assume that there is at least one s ∈ childSubtrees(n) to which e can be propagated,\nand that in each such s,\na proper recipient node for e,\ndifferent from n,\nhas been found (or in other words that n is not the pseudo-recipient of e for any such s).")]),e._v(" "),t("p",[e._v("Then the decision still needs to be taken whether e should remain attached to n,\n(i.e. be duplicated down) or not (i.e. be strictly pushed down).")]),e._v(" "),t("h4",{attrs:{id:"default-case"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#default-case"}},[e._v("#")]),e._v(" Default case")]),e._v(" "),t("p",[e._v("By default,\nan attempt is made to strictly push down e if it can be propagated down to at least one s ∈ childSubtrees(n).\nSo in the default case,\nand provided n is not a pseudo-recipient for e in any s,\ne will not remain attached to n.")]),e._v(" "),t("h4",{attrs:{id:"specific-case-left-join-rooted-candidate-subtree"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#specific-case-left-join-rooted-candidate-subtree"}},[e._v("#")]),e._v(" Specific case (left-join-rooted candidate subtree)")]),e._v(" "),t("p",[e._v("If s is a candidate subtree for the propagation of e,\nand if a recipient node r in s has been found such that the path in Q from the provider node n of e to r comprises a left join node j and the right child j' of j,\nthen e will remain attached to the provider node n,\ni.e. e will be duplicated down,\ninstead of strictly pushed down.")]),e._v(" "),t("p",[e._v("This prevents an alteration of the semantic of the IQ.\nConsider for instance the following example (where r = j' for simplicity).")]),e._v(" "),t("div",{staticClass:"custom-block tip"},[t("p",{staticClass:"custom-block-title"},[e._v("NOTE")]),e._v(" "),t("p",[e._v("Let:")]),e._v(" "),t("ul",[t("li",[e._v("Q1 be a well-formed IQ")]),e._v(" "),t("li",[e._v("n1 be a filter node,\nn1 ∈ Q1,\nand bool(n1) = {e},\nwhere e is the expression x < 1")]),e._v(" "),t("li",[e._v("j1 be a left join node with (explicit) joining condition x ≤ y,\nand such that children(n1) = {j1}")]),e._v(" "),t("li",[e._v("l1 be the left child of j1,\nwith var(subtree(l1)) = {y}")]),e._v(" "),t("li",[e._v("r1 be a filter node and the right child of j1,\nwith var(subtree(r1)) = {x}")])]),e._v(" "),t("p",[e._v("Then r1 is a recipient for e.")]),e._v(" "),t("p",[e._v("Now consider the query Q2 identical to Q1,\nwhere n2 (resp. j2, r2, etc.) is the counterpart of n1 (resp. j1, r1, etc.),\nbut such that e has been pushed down to r2 (and therefore is not attached to n2 anymore).\nAnd let us assume a database instance defining an evaluation function ||.||,\nsuch that ||l1|| = { {y ↦ 2} } and ||r1|| = { {x ↦ 1} }.")]),e._v(" "),t("p",[e._v("Then ||j1|| = { {x ↦ 1, y ↦ 2} },\nand ||n1|| = { {} }.")]),e._v(" "),t("p",[e._v("But ||l2|| = { {y ↦ 2} } and ||r2|| = { {} } must also hold,\ntherefore ||j2|| = { {y ↦ 2} } and ||n2|| = { {y ↦ 2} },\nsuch that ||n1|| ≠ ||n2||.")])])])}),[],!1,null,null,null);n.default=o.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[68],{447:function(e,n,t){"use strict";t.r(n);var i=t(51),o=Object(i.a)({},(function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"intermediate-query-optimization"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#intermediate-query-optimization"}},[e._v("#")]),e._v(" Intermediate query optimization")]),e._v(" "),t("div",{staticClass:"custom-block warning"},[t("p",{staticClass:"custom-block-title"},[e._v("WARNING")]),e._v(" "),t("p",[e._v("TODO: UPDATE AND CHECK (2 years old, imported from AsciiDocs)")])]),e._v(" "),t("p",[e._v("This section provides a high level description of different transformations which may be applied to "),t("a",{attrs:{href:"/dev/iq"}},[e._v("Intermediate Queries")]),e._v(" ("),t("em",[e._v("IQs")]),e._v(" in what follows) for optimization purposes.")]),e._v(" "),t("h2",{attrs:{id:"notation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#notation"}},[e._v("#")]),e._v(" Notation")]),e._v(" "),t("p",[e._v("The different types of nodes of an IQ are presented "),t("a",{attrs:{href:"/dev/iq#query-nodes"}},[e._v("in the dedicated section")]),e._v(".\nThe following notation will also be use in the current document.")]),e._v(" "),t("h3",{attrs:{id:"sub-trees"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#sub-trees"}},[e._v("#")]),e._v(" (Sub)trees")]),e._v(" "),t("p",[e._v("If s is a tree,\nthen root(s) will designate its root.")]),e._v(" "),t("p",[e._v('If n is a node in an IQ Q,\nthen children~Q~(n) (resp. children(n) when Q is obvious from the context) will designate the immediate children of n in Q,\nand subtree~Q~(n) (resp. subtree(n)) the maximal subtree of Q rooted in n.\nIn addition,\na "subtree of Q" will be understood as a maximal subtree of Q rooted in some node of Q.\nFinally,\nchildSubtrees~Q~(n) (resp. childSubtrees(n)) will stand for {subtree~Q~(c) | c ∈ children~Q~(n)}')]),e._v(" "),t("h3",{attrs:{id:"projected-variables"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#projected-variables"}},[e._v("#")]),e._v(" Projected variables")]),e._v(" "),t("p",[e._v("If s is a subtree in an IQ,\nthen var(s) will designate the "),t("em",[e._v("variables projected out by s")]),e._v(",\ndefined inductively as follows:")]),e._v(" "),t("ul",[t("li",[t("p",[e._v("If root(s) explicitly projects out variables (construction node,\nunion node,\ndata node or empty node),\nthen var(s) is the set of such variables.")])]),e._v(" "),t("li",[t("p",[e._v("Otherwise,\nvar(s) = ⋃ ~s∈childSubtrees(n)~ var(s)")])])]),e._v(" "),t("p",[e._v("If e is an (explicit) join or filter condition,\nthen var(e) will designate the variables appearing in e.")]),e._v(" "),t("h2",{attrs:{id:"propagating-down-boolean-expressions"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#propagating-down-boolean-expressions"}},[e._v("#")]),e._v(" Propagating down boolean expressions")]),e._v(" "),t("p",[e._v("This optimization is used for (some) NoSQL underlying DBMS.\nIt consists in transforming an input IQ into an equivalent one such that,\nwhenever possible,\nselections precede other algebraic operations.\nOr in other words,\nit consists in propagating (explicit) boolean expressions down the algebraic tree.")]),e._v(" "),t("p",[e._v("Three types of IQ nodes support boolean expressions,\nnamely:")]),e._v(" "),t("ul",[t("li",[e._v("filter nodes,")]),e._v(" "),t("li",[e._v("inner join nodes, and")]),e._v(" "),t("li",[e._v("left join nodes")])]),e._v(" "),t("p",[e._v("For each node n of one of these types,\nif n has an explicit boolean expression e attached to it,\nthen e is put into DNF,\nand each resulting conjunct may be propagated down independently.\nFor instance,\nn may be a filter node,\nand e the expression (x > y) ∧ (y ≠ z).\nThen (x > y) and (y ≠ z) may both be propagated down,\nindependently from each other.\nIf n is a node of one of the three types just mentioned,\nthen bool(n) will designate the set of such conjuncts.")]),e._v(" "),t("h3",{attrs:{id:"propagation-decision-and-recipient-selection"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#propagation-decision-and-recipient-selection"}},[e._v("#")]),e._v(" Propagation decision and recipient selection")]),e._v(" "),t("p",[e._v("Propagation decisions are primarily taken based on a comparison between:")]),e._v(" "),t("ul",[t("li",[e._v("the variables var(e) present in the conjunct e being propagated down,\nand")]),e._v(" "),t("li",[e._v("the variables var(s) projected out by each candidate subtree s for the propagation of e.")])]),e._v(" "),t("h4",{attrs:{id:"default-case-inner-join-of-filter-provider-node"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#default-case-inner-join-of-filter-provider-node"}},[e._v("#")]),e._v(" Default case (inner join of filter provider node)")]),e._v(" "),t("p",[e._v("Let e ∈ bool(n).\nThe default rule to decide whether e can be propagated down from n is the following:\nfor each s ∈ childSubtrees(n),\nif var(e) ⊆ var(s),\nthen e can be propagated down to s.")]),e._v(" "),t("p",[e._v("An expression e being propagated down a subtree s also needs (a) new recipient node(s) to support it.\nThe recipients selection procedure is the following:")]),e._v(" "),t("ul",[t("li",[t("p",[e._v("if root(s) is neither a union node,\nconstruction node or left join node,\nthen it is the (only) recipient of e in s.")])]),e._v(" "),t("li",[t("p",[e._v("Otherwise,\neach s' ∈ childSubtrees(root(s)) recursively becomes a new candidate subtree for propagation.\nIf there no s' ∈ childSubtrees(root(s)) to which e can be propagated down,\nthen root(s) is the (only) recipient of e in s.\nNote that in a valid IQ,\nif s is a construction or union node,\nthen var(s) ⊆ var(s') must hold for each s' ∈ childSubtrees(root(s)),\ntherefore var(e) ⊆ var(s') holds by transitivity,\nsuch that root(s) cannot be the recipient for e in s.\nBut it may be the case if s is a left join node.")])])]),e._v(" "),t("p",[e._v('Finally,\nif a recipient node r for e in s (or s\') does not natively supports non-conditional boolean expressions,\ni.e. if r is neither a filter nor an inner join node,\nthen a new filter node is created as the (immediate) parent of r,\nin order to support e.\nAlternatively (as a form of syntactic sugar),\nif the node n initially providing e is the immediate parent of r,\nthen this new filter node is not needed,\nand e can remain attached to n,\nwhich in this case plays the role of "pseudo-recipient" of e in s.')]),e._v(" "),t("p",[e._v("Note that if n is the pseudo-recipient of e in s,\nthen from the above selection procedure,\nroot(s) must be a data node,\nempty node,\ntrue node,\nor a left join node with no child accepting e,\nwhich in all cases guarantees that e cannot be further propagated down s.")]),e._v(" "),t("h4",{attrs:{id:"specific-case-left-join-provider-node"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#specific-case-left-join-provider-node"}},[e._v("#")]),e._v(" Specific case (left join provider node)")]),e._v(" "),t("p",[e._v("The propagation decision and recipient selection procedures are identical for a boolean conjunct e provided by a left join node n,\nbut with an exception:\ne may only be propagated down the subtree rooted in the right child of n.\nIndeed,\nif e was propagated down the left subtree,\nan additional selection would be added to the algebraic expression represented by that left branch,\nviolating the semantics of conditions attached to a left join (see link:intermediateQuery_detailed.adoc#leftjoinNode[the dedicated section] for an explanation).")]),e._v(" "),t("h3",{attrs:{id:"duplication-decision"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#duplication-decision"}},[e._v("#")]),e._v(" Duplication decision")]),e._v(" "),t("p",[e._v("Let e ∈ bool(n) for some node n in an IQ Q.\nAnd let us assume that there is at least one s ∈ childSubtrees(n) to which e can be propagated,\nand that in each such s,\na proper recipient node for e,\ndifferent from n,\nhas been found (or in other words that n is not the pseudo-recipient of e for any such s).")]),e._v(" "),t("p",[e._v("Then the decision still needs to be taken whether e should remain attached to n,\n(i.e. be duplicated down) or not (i.e. be strictly pushed down).")]),e._v(" "),t("h4",{attrs:{id:"default-case"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#default-case"}},[e._v("#")]),e._v(" Default case")]),e._v(" "),t("p",[e._v("By default,\nan attempt is made to strictly push down e if it can be propagated down to at least one s ∈ childSubtrees(n).\nSo in the default case,\nand provided n is not a pseudo-recipient for e in any s,\ne will not remain attached to n.")]),e._v(" "),t("h4",{attrs:{id:"specific-case-left-join-rooted-candidate-subtree"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#specific-case-left-join-rooted-candidate-subtree"}},[e._v("#")]),e._v(" Specific case (left-join-rooted candidate subtree)")]),e._v(" "),t("p",[e._v("If s is a candidate subtree for the propagation of e,\nand if a recipient node r in s has been found such that the path in Q from the provider node n of e to r comprises a left join node j and the right child j' of j,\nthen e will remain attached to the provider node n,\ni.e. e will be duplicated down,\ninstead of strictly pushed down.")]),e._v(" "),t("p",[e._v("This prevents an alteration of the semantic of the IQ.\nConsider for instance the following example (where r = j' for simplicity).")]),e._v(" "),t("div",{staticClass:"custom-block tip"},[t("p",{staticClass:"custom-block-title"},[e._v("NOTE")]),e._v(" "),t("p",[e._v("Let:")]),e._v(" "),t("ul",[t("li",[e._v("Q1 be a well-formed IQ")]),e._v(" "),t("li",[e._v("n1 be a filter node,\nn1 ∈ Q1,\nand bool(n1) = {e},\nwhere e is the expression x < 1")]),e._v(" "),t("li",[e._v("j1 be a left join node with (explicit) joining condition x ≤ y,\nand such that children(n1) = {j1}")]),e._v(" "),t("li",[e._v("l1 be the left child of j1,\nwith var(subtree(l1)) = {y}")]),e._v(" "),t("li",[e._v("r1 be a filter node and the right child of j1,\nwith var(subtree(r1)) = {x}")])]),e._v(" "),t("p",[e._v("Then r1 is a recipient for e.")]),e._v(" "),t("p",[e._v("Now consider the query Q2 identical to Q1,\nwhere n2 (resp. j2, r2, etc.) is the counterpart of n1 (resp. j1, r1, etc.),\nbut such that e has been pushed down to r2 (and therefore is not attached to n2 anymore).\nAnd let us assume a database instance defining an evaluation function ||.||,\nsuch that ||l1|| = { {y ↦ 2} } and ||r1|| = { {x ↦ 1} }.")]),e._v(" "),t("p",[e._v("Then ||j1|| = { {x ↦ 1, y ↦ 2} },\nand ||n1|| = { {} }.")]),e._v(" "),t("p",[e._v("But ||l2|| = { {y ↦ 2} } and ||r2|| = { {} } must also hold,\ntherefore ||j2|| = { {y ↦ 2} } and ||n2|| = { {y ↦ 2} },\nsuch that ||n1|| ≠ ||n2||.")])])])}),[],!1,null,null,null);n.default=o.exports}}]); \ No newline at end of file diff --git a/assets/js/69.b83ed713.js b/assets/js/69.0fea1cc6.js similarity index 99% rename from assets/js/69.b83ed713.js rename to assets/js/69.0fea1cc6.js index fbef19ef0..6c05e7cbe 100644 --- a/assets/js/69.b83ed713.js +++ b/assets/js/69.0fea1cc6.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[69],{446:function(a,n,e){"use strict";e.r(n);var o=e(51),i=Object(o.a)({},(function(){var a=this,n=a.$createElement,e=a._self._c||n;return e("ContentSlotsDistributor",{attrs:{"slot-key":a.$parent.slotKey}},[e("h1",{attrs:{id:"publications"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#publications"}},[a._v("#")]),a._v(" Publications")]),a._v(" "),e("h2",{attrs:{id:"journals"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#journals"}},[a._v("#")]),a._v(" Journals")]),a._v(" "),e("ol",[e("li",[e("strong",[a._v("Virtual Knowledge Graphs: An Overview of Systems and Use Cases.")]),a._v(" Guohui Xiao, Linfang Ding, Benjamin Cogrel, Diego Calvanese. Data Intelligence. 2019.")]),a._v(" "),e("li",[e("strong",[a._v("Ontop-spatial: Ontop of Geospatial Databases.")]),a._v(" Konstantina Bereta, Guohui Xiao, and Manolis Koubarakis. Journal of Web Semantics. 2019.")]),a._v(" "),e("li",[e("strong",[a._v("Ontology-Based Access To Temporal Data With Ontop: A Framework Proposal.")]),a._v(" Elem Güzel Kalaycı, Sebastian Brandt, Diego Calvanese, Vladislav Ryzhikov, Guohui Xiao, and Michael Zakharyaschev. International Journal of Applied Mathematics and Computer Science. 2019.")]),a._v(" "),e("li",[e("strong",[a._v("VIG: Data Scaling for OBDA Benchmarks.")]),a._v(" Davide Lanti, Guohui Xiao, and Diego Calvanese. Semantic Web Journal. 2019.")]),a._v(" "),e("li",[e("strong",[a._v("Ontology-based Data Access - Beyond relational sources.")]),a._v(" Elena Botoeva, Diego Calvanese, Benjamin Cogrel, Julien Corman, Guohui Xiao. Intelligenza Artificiale. 2019.")]),a._v(" "),e("li",[e("strong",[a._v("Querying Log Data with Metric Temporal Logic.")]),a._v(" Sebastian\nBrandt, Elem Güzel Kalaycı, Vladislav Ryzhikov, Guohui Xiao, and\nMichael Zakharyaschev. Journal of Artificial Intelligence\nResearch, 2018.")]),a._v(" "),e("li",[e("strong",[a._v("Ontop: Answering SPARQL Queries over Relational Databases.")]),a._v("\nDiego Calvanese, Benjamin Cogrel, Sarah Komla-Ebri, Roman\nKontchakov, Davide Lanti, Martin Rezk, Mariano Rodriguez-Muro,\nand Guohui Xiao. Semantic Web Journal. 2017 "),e("a",{attrs:{href:"http://www.semantic-web-journal.net/blog/semantic-web-journal-awards-2016",target:"_blank",rel:"noopener"}},[e("em",[a._v("(SWJ 2016\nOutstanding Paper\nAward)")]),e("OutboundLink")],1)]),a._v(" "),e("li",[e("strong",[a._v("Ontology Based Data Access in Statoil.")]),a._v(" Evgeny\nKharlamov, Dag Hovland, Martin G. Skjæveland, Dimitris Bilidas,\nErnesto Jiménez-Ruiz, Guohui Xiao, Ahmet Soylu, Davide Lanti,\nMartin Rezk, Dmitriy Zheleznyakov, Martin Giese, Hallstein Lie,\nYannis E. Ioannidis, Yannis Kotidis, Manolis Koubarakis, Arild\nWaaler. Journal of Web Semantics, 2017.")]),a._v(" "),e("li",[e("strong",[a._v("Efficient SPARQL-to-SQL with R2RML mappings")]),a._v(". Mariano\nRodriguez-Muro and Martin Rezk, J. of Web Semantics. 2015")]),a._v(" "),e("li",[e("strong",[a._v("Optique --- zooming in on big data access")]),a._v(". Martin Giese,\nPeter Haase, Ernesto Jiménez-Ruiz, Davide Lanti, Özgür Özçep,\nMartin Rezk, Riccardo Rosati, Ahmet Soylu, Guillermo\nVega-Gorgojo, Arild Waaler, and Guohui Xiao. IEEE Computer. 2015")])]),a._v(" "),e("h2",{attrs:{id:"conferences"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#conferences"}},[a._v("#")]),a._v(" Conferences")]),a._v(" "),e("ol",[e("li",[e("strong",[a._v("The Virtual Knowledge Graph System Ontop")]),a._v(". Guohui Xiao, Davide Lanti, Roman Kontchakov, Sarah Komla-Ebri, Elem Güzel-Kalayci, Linfang Ding, Julien Corman, Benjamin Cogrel, Diego Calvanese, and Elena Botoeva. ISWC (Resource), 2020.")]),a._v(" "),e("li",[e("strong",[a._v("Semantic Integration of Bosch Manufacturing Data Using Virtual Knowledge Graphs")]),a._v(". Elem Güzel Kalaycı, Irlan Grangel Gonález, Felix Lösch, Guohui Xiao, Anees ul-Mehdi, Evgeny Kharlamov, and Diego Calvanese. ISWC (In-Use), 2020.")]),a._v(" "),e("li",[e("strong",[a._v("Enriching Ontology-based Data Access with Provenance.")]),a._v(" Diego Calvanese, Davide Lanti, Ana Ozaki, Rafael Penaloza, and Guohui Xiao. IJCAI, 2019.")]),a._v(" "),e("li",[e("strong",[a._v("Efficient Handling of SPARQL OPTIONAL for OBDA.")]),a._v(" Guohui Xiao,\nRoman Kontchakov, Benjamin Cogrel, Diego Calvanese, and Elena\nBotoeva. ISWC (Research), 2018.")]),a._v(" "),e("li",[e("strong",[a._v("Ontology-based data access: A survey.")]),a._v(" Guohui Xiao, Diego Calvanese, Roman Kontchakov, Domenico Lembo, Antonella Poggi, Riccardo Rosati, Michael Zakharyaschev. IJCAI. 2018.")]),a._v(" "),e("li",[e("strong",[a._v("Ontop-temporal: A Tool for Ontology-based Query Answering over Temporal Data.")]),a._v(" Elem Güzel Kalayci, Guohui Xiao, Vladislav Ryzhikov, Tahir Emre Kalayci, and Diego Calvanese. CIKM. 2018.")]),a._v(" "),e("li",[e("strong",[a._v("Efficient Ontology-Based Data Integration with canonical IRIs")]),a._v(".\nGuohui Xiao, Dag Hovland, Dimitris Bilidas, Martin Rezk, Martin\nGiese, and Diego Calvanese. ESWC, 2018.")]),a._v(" "),e("li",[e("strong",[a._v("Cost-Driven Ontology-Based Data Access.")]),a._v(" Davide\nLanti, Guohui Xiao, Diego Calvanese. ISWC (Research), 2017.")]),a._v(" "),e("li",[e("strong",[a._v("Semantic Rule-Based Equipment Diagnostics.")]),a._v(" Gulnar\nMehdi, Evgeny Kharlamov, Ognjen Savkovic, Guohui Xiao, Elem\nGüzel Kalayci, Sebastian Brandt, Ian Horrocks, Mikhail Roshchin,\nThomas A. Runkler. ISWC (In-Use), 2017. "),e("a",{attrs:{href:"https://iswc2017.semanticweb.org/program/awards/",target:"_blank",rel:"noopener"}},[a._v("(Best In-Use Paper\nAward)"),e("OutboundLink")],1)]),a._v(" "),e("li",[e("strong",[a._v("Ontology-Based Data Access with a Horn Fragment of Metric\nTemporal Logic.")]),a._v(" Sebastian Brandt, Elem Güzel Kalayci,\nRoman Kontchakov, Vladislav Ryzhikov, Guohui Xiao, Michael\nZakharyaschev. AAAI, 2017.")]),a._v(" "),e("li",[e("strong",[a._v("Beyond OWL 2 QL in OBDA: Rewritings and Approximations")]),a._v(".\nElena Botoeva, Diego Calvanese, Valerio Santarelli, Domenico\nFabio Savo, Alessandro Solimando and Guohui Xiao. AAAI, 2016.")]),a._v(" "),e("li",[e("strong",[a._v("Ontology-Based Data Access for Maritime Security")]),a._v(". Stefan\nBrüggemann, Konstantina Bereta, Guohui Xiao and Manolis\nKoubarakis. ESWC (In-Use), 2016.")]),a._v(" "),e("li",[e("strong",[a._v("OBDA Constraints for Effective Query Answering")]),a._v(". Dag Hovland,\nDavide Lanti, Martin Rezk and Guohui Xiao. RuleML, 2016.")]),a._v(" "),e("li",[e("strong",[a._v("Towards Practical OBDA with Temporal Ontologies (Position\nPaper)")]),a._v(". Diego Calvanese, Elem Güzel Kalayci, Vladislav\nRyzhikov and Guohui Xiao. RR, 2016.")]),a._v(" "),e("li",[e("strong",[a._v("Ontology-based Integration of Cross-linked Datasets")]),a._v(". Diego\nCalvanese, Martin Giese, Dag Hovland and Martin Rezk (ISWC\n2015), 2015.")]),a._v(" "),e("li",[e("strong",[a._v("The NPD benchmark: Reality check for OBDA systems")]),a._v(". Davide\nLanti, Martin Rezk, Guohui Xiao, and Diego Calvanese. In Proc.\nof the 18th Int. Conf. on Extending Database Technology (EDBT\n2015). ACM Press, 2015.")]),a._v(" "),e("li",[e("strong",[a._v("Answering SPARQL Queries over Databases and under OWL 2 QL\nEntailment Regime")]),a._v(". Roman Kontchakov, Martin Rezk, Mariano\nRodriguez-Muro, Guohui Xiao, and Michael Zakharyaschev.\nInternational Semantic Web Conference (ISWC), 2014.")]),a._v(" "),e("li",[e("strong",[a._v("Rules and Ontology Based Data Access")]),a._v(". Guohui Xiao, Martin\nRezk, Mariano Rodriguez-Muro, and Diego Calvanese. Eighth\nInternational Conference on Web Reasoning and Rule Systems,\n(RR), 2014.")]),a._v(" "),e("li",[e("strong",[a._v("High Performance Query Answering over DL-Lite Ontologies.")]),a._v("\nMariano Rodriguez-Muro, Diego Calvanese. KR 2012")]),a._v(" "),e("li",[e("strong",[a._v("Quest: Effcient SPARQL-to-SQL for RDF and OWL.")]),a._v(" Mariano\nRodriguez-Muro, Josef Hardi, Diego Calvanese. ISWC (Posters &\nDemos) 2012")])]),a._v(" "),e("h2",{attrs:{id:"workshops"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#workshops"}},[a._v("#")]),a._v(" Workshops")]),a._v(" "),e("ol",[e("li",[e("strong",[a._v("Fast and Simple Data Scaling for OBDA Benchmarks")]),a._v(". Davide\nLanti, Guohui Xiao and Diego Calvanese. BLINK@ISWC, 2016.")]),a._v(" "),e("li",[e("strong",[a._v("OBDA Beyond Relational DBs: A Study for MongoDB")]),a._v(". Elena\nBotoeva, Diego Calvanese, Benjamin Cogrel, Martin Rezk and\nGuohui Xiao. Description Logics, 2016.")]),a._v(" "),e("li",[e("strong",[a._v("The ontop framework for ontology based data access.")]),a._v(" Timea\nBagosi, Diego Calvanese, Josef Hardi, Sarah Komla-Ebri, Davide\nLanti, Martin Rezk, Mariano Rodriguez-Muro, Mindaugas Slusnys,\nand Guohui Xiao. CSWS (Posters and Demos), Wuhan, China,\nAugust 2014.")]),a._v(" "),e("li",[e("strong",[a._v("The NPD benchmark for OBDA systems.")]),a._v(" Davide Lanti, Martin\nRezk, Mindaugas Slusnys, Guohui Xiao, and Diego Calvanese. SSWS\n2014")]),a._v(" "),e("li",[e("strong",[a._v("A scalable benchmark for OBDA systems: Preliminary report.")]),a._v("\nDiego Calvanese, Davide Lanti, Martin Rezk, Mindaugas Slusnys,\nand Guohui Xiao. ORE 2014")]),a._v(" "),e("li",[e("strong",[a._v("Query Rewriting and Optimisation with Database Dependencies in\nOntop.")]),a._v(" Mariano Rodriguez-Muro, Roman Kontchakov, Michael\nZakharyaschev: Description Logics 2013")]),a._v(" "),e("li",[e("strong",[a._v("Evaluating SPARQL-to-SQL Translation in Ontop.")]),a._v(" Mariano\nRodriguez-Muro, Martín Rezk, Josef Hardi, Mindaugas Slusnys,\nTimea Bagosi, Diego Calvanese: ORE 2013")]),a._v(" "),e("li",[e("strong",[a._v("OBDA with Ontop.")]),a._v(" Mariano Rodriguez-Muro, Roman Kontchakov,\nMichael Zakharyaschev: ORE 2013")]),a._v(" "),e("li",[e("strong",[a._v("Ontop at Work.")]),a._v(" Mariano Rodriguez-Muro, Roman Kontchakov,\nMichael Zakharyaschev. OWLED 2013")]),a._v(" "),e("li",[e("strong",[a._v("On Rewriting, Answering Queries in OBDA Systems for Big Data\n(Short Paper)")]),a._v(". Diego Calvanese, Ian Horrocks, Ernesto\nJiménez-Ruiz, Evgeny Kharlamov, Michael Meier, Mariano\nRodriguez-Muro, Dmitriy Zheleznyakov. OWLED 2013")]),a._v(" "),e("li",[e("strong",[a._v("Quest, an OWL 2 QL Reasoner for Ontology-based Data Access.")]),a._v("\nMariano Rodriguez-Muro, Diego Calvanese. OWLED 2012")])]),a._v(" "),e("h2",{attrs:{id:"tutorials-and-demos"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#tutorials-and-demos"}},[a._v("#")]),a._v(" Tutorials and Demos")]),a._v(" "),e("ol",[e("li",[e("a",{attrs:{href:"https://github.com/ontopic-vkg/destination-tutorial",target:"_blank",rel:"noopener"}},[a._v("Destination Tutorial"),e("OutboundLink")],1),a._v(" given at the Knowledge Graph Conference 2021 by Diego Calvanese, Benjamin Cogrel and Guohui Xiao.")]),a._v(" "),e("li",[e("a",{attrs:{href:"https://github.com/ontop/ontop-examples/tree/master/aixia-2018-tutorial/",target:"_blank",rel:"noopener"}},[a._v("Novel Developments in Ontology-Based Data Access and\nIntegration\n(NOBDI)"),e("OutboundLink")],1),a._v("\nDiego Calvanese, Benjamin Cogrel and Guohui Xiao. Full day\ntutorial, 17th International Conference of the Italian\nAssociation for Artificial Intelligence -- Trento, November\n20-23, 2018.")]),a._v(" "),e("li",[e("RouterLink",{attrs:{to:"/research/tutorials/cikm-2018/"}},[a._v("Semantic Technologies for Data Access and\nIntegration")]),a._v(".\nDiego Calvanese and Guohui Xiao. Full day tutorial, CIKM.\nTorino, 26 October 2018.")],1),a._v(" "),e("li",[e("a",{attrs:{href:"http://ontop.inf.unibz.it/ijcai-2018-tutorial/",target:"_blank",rel:"noopener"}},[a._v("Ontology-based Data Access: Theory and\nPractice"),e("OutboundLink")],1),a._v(".\nGuohui Xiao and Roman Konchakov. Full day tutorial, IJCAI 2018\nTutorial. Stockholm, July 14, 2018.")]),a._v(" "),e("li",[e("a",{attrs:{href:"http://ontop.inf.unibz.it/ekaw-2016-tutorial/",target:"_blank",rel:"noopener"}},[a._v("Mapping Management and Expressive Ontologies in Ontology-Based\nData Access"),e("OutboundLink")],1),a._v(".\nDiego Calvanese, Benjamin Cogrel and Guohui Xiao. Full day\ntutorial, EKAW. Bologna, November 19, 2016.")]),a._v(" "),e("li",[e("a",{attrs:{href:"http://esslli2016.unibz.it/wp-content/uploads/2015/10/ontop-esslli.pdf",target:"_blank",rel:"noopener"}},[a._v("Ontology-Based Data Access with\nOntop"),e("OutboundLink")],1),a._v(".\nBenjamin Cogrel. Lecture at the ESSLLI summer school, 2016.")]),a._v(" "),e("li",[e("a",{attrs:{href:"http://www.slideshare.net/guohuixiao/ontop-answering-sparql-queries-over-relational-databases/",target:"_blank",rel:"noopener"}},[a._v("Ontop: Answering SPARQL Queries over Relational\nDatabases"),e("OutboundLink")],1),a._v(".\nGuohui Xiao. Stanford, 2016.")]),a._v(" "),e("li",[e("a",{attrs:{href:"http://ontop.inf.unibz.it/iswc-2015-tutorial",target:"_blank",rel:"noopener"}},[a._v("Ontology-based Data Access: From Theory to\nPractice"),e("OutboundLink")],1),a._v(" (Diego\nCalvanese, Martin Rezk, Guohui Xiao. ISWC 2015 Tutorial)")]),a._v(" "),e("li",[e("a",{attrs:{href:"http://www.ghxiao.org/talks/2014-csws-obda-talk.pdf",target:"_blank",rel:"noopener"}},[a._v("Ontology-based data access --- Theory and\nPractice"),e("OutboundLink")],1),a._v(".\n(Guohui Xiao, Summer School at CSWS2014, Wuhan, China)")]),a._v(" "),e("li",[e("a",{attrs:{href:"http://rw2014.di.uoa.gr/?q=Schedule",target:"_blank",rel:"noopener"}},[a._v("An Introduction to Description Logics and Query\nRewriting."),e("OutboundLink")],1),a._v(" Roman\nKontchakov, Michael Zakharyaschev. Reasoning Web 2014")]),a._v(" "),e("li",[e("a",{attrs:{href:"http://link.springer.com/chapter/10.1007%2F978-3-642-39784-4_5",target:"_blank",rel:"noopener"}},[a._v("Ontology-Based Data Access with Databases: A Short\nCourse."),e("OutboundLink")],1),a._v("\n(Roman Kontchakov, Mariano Rodriguez-Muro, Michael\nZakharyaschev. Reasoning Web 2013)")]),a._v(" "),e("li",[e("a",{attrs:{href:"http://www.slideshare.net/marianomx/ontop-a-tutorial",target:"_blank",rel:"noopener"}},[a._v("Ontop: A Tutorial"),e("OutboundLink")],1),a._v("\n(Mariano Rodriguez-Muro, Vienna'13)")])]),a._v(" "),e("h2",{attrs:{id:"master-theses"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#master-theses"}},[a._v("#")]),a._v(" Master theses")]),a._v(" "),e("ul",[e("li",[a._v("Lukas Sundqvist: "),e("a",{attrs:{href:"https://ontop-vkg.org/publications/2022-sundqvist-rdf-star-ontop-msc-thesis.pdf",target:"_blank",rel:"noopener"}},[a._v("Extending VKG Systems with RDF-star Support"),e("OutboundLink")],1),a._v(", Free University of Bozen-Bolzano, March 2022.")])])])}),[],!1,null,null,null);n.default=i.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[69],{445:function(a,n,e){"use strict";e.r(n);var o=e(51),i=Object(o.a)({},(function(){var a=this,n=a.$createElement,e=a._self._c||n;return e("ContentSlotsDistributor",{attrs:{"slot-key":a.$parent.slotKey}},[e("h1",{attrs:{id:"publications"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#publications"}},[a._v("#")]),a._v(" Publications")]),a._v(" "),e("h2",{attrs:{id:"journals"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#journals"}},[a._v("#")]),a._v(" Journals")]),a._v(" "),e("ol",[e("li",[e("strong",[a._v("Virtual Knowledge Graphs: An Overview of Systems and Use Cases.")]),a._v(" Guohui Xiao, Linfang Ding, Benjamin Cogrel, Diego Calvanese. Data Intelligence. 2019.")]),a._v(" "),e("li",[e("strong",[a._v("Ontop-spatial: Ontop of Geospatial Databases.")]),a._v(" Konstantina Bereta, Guohui Xiao, and Manolis Koubarakis. Journal of Web Semantics. 2019.")]),a._v(" "),e("li",[e("strong",[a._v("Ontology-Based Access To Temporal Data With Ontop: A Framework Proposal.")]),a._v(" Elem Güzel Kalaycı, Sebastian Brandt, Diego Calvanese, Vladislav Ryzhikov, Guohui Xiao, and Michael Zakharyaschev. International Journal of Applied Mathematics and Computer Science. 2019.")]),a._v(" "),e("li",[e("strong",[a._v("VIG: Data Scaling for OBDA Benchmarks.")]),a._v(" Davide Lanti, Guohui Xiao, and Diego Calvanese. Semantic Web Journal. 2019.")]),a._v(" "),e("li",[e("strong",[a._v("Ontology-based Data Access - Beyond relational sources.")]),a._v(" Elena Botoeva, Diego Calvanese, Benjamin Cogrel, Julien Corman, Guohui Xiao. Intelligenza Artificiale. 2019.")]),a._v(" "),e("li",[e("strong",[a._v("Querying Log Data with Metric Temporal Logic.")]),a._v(" Sebastian\nBrandt, Elem Güzel Kalaycı, Vladislav Ryzhikov, Guohui Xiao, and\nMichael Zakharyaschev. Journal of Artificial Intelligence\nResearch, 2018.")]),a._v(" "),e("li",[e("strong",[a._v("Ontop: Answering SPARQL Queries over Relational Databases.")]),a._v("\nDiego Calvanese, Benjamin Cogrel, Sarah Komla-Ebri, Roman\nKontchakov, Davide Lanti, Martin Rezk, Mariano Rodriguez-Muro,\nand Guohui Xiao. Semantic Web Journal. 2017 "),e("a",{attrs:{href:"http://www.semantic-web-journal.net/blog/semantic-web-journal-awards-2016",target:"_blank",rel:"noopener"}},[e("em",[a._v("(SWJ 2016\nOutstanding Paper\nAward)")]),e("OutboundLink")],1)]),a._v(" "),e("li",[e("strong",[a._v("Ontology Based Data Access in Statoil.")]),a._v(" Evgeny\nKharlamov, Dag Hovland, Martin G. Skjæveland, Dimitris Bilidas,\nErnesto Jiménez-Ruiz, Guohui Xiao, Ahmet Soylu, Davide Lanti,\nMartin Rezk, Dmitriy Zheleznyakov, Martin Giese, Hallstein Lie,\nYannis E. Ioannidis, Yannis Kotidis, Manolis Koubarakis, Arild\nWaaler. Journal of Web Semantics, 2017.")]),a._v(" "),e("li",[e("strong",[a._v("Efficient SPARQL-to-SQL with R2RML mappings")]),a._v(". Mariano\nRodriguez-Muro and Martin Rezk, J. of Web Semantics. 2015")]),a._v(" "),e("li",[e("strong",[a._v("Optique --- zooming in on big data access")]),a._v(". Martin Giese,\nPeter Haase, Ernesto Jiménez-Ruiz, Davide Lanti, Özgür Özçep,\nMartin Rezk, Riccardo Rosati, Ahmet Soylu, Guillermo\nVega-Gorgojo, Arild Waaler, and Guohui Xiao. IEEE Computer. 2015")])]),a._v(" "),e("h2",{attrs:{id:"conferences"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#conferences"}},[a._v("#")]),a._v(" Conferences")]),a._v(" "),e("ol",[e("li",[e("strong",[a._v("The Virtual Knowledge Graph System Ontop")]),a._v(". Guohui Xiao, Davide Lanti, Roman Kontchakov, Sarah Komla-Ebri, Elem Güzel-Kalayci, Linfang Ding, Julien Corman, Benjamin Cogrel, Diego Calvanese, and Elena Botoeva. ISWC (Resource), 2020.")]),a._v(" "),e("li",[e("strong",[a._v("Semantic Integration of Bosch Manufacturing Data Using Virtual Knowledge Graphs")]),a._v(". Elem Güzel Kalaycı, Irlan Grangel Gonález, Felix Lösch, Guohui Xiao, Anees ul-Mehdi, Evgeny Kharlamov, and Diego Calvanese. ISWC (In-Use), 2020.")]),a._v(" "),e("li",[e("strong",[a._v("Enriching Ontology-based Data Access with Provenance.")]),a._v(" Diego Calvanese, Davide Lanti, Ana Ozaki, Rafael Penaloza, and Guohui Xiao. IJCAI, 2019.")]),a._v(" "),e("li",[e("strong",[a._v("Efficient Handling of SPARQL OPTIONAL for OBDA.")]),a._v(" Guohui Xiao,\nRoman Kontchakov, Benjamin Cogrel, Diego Calvanese, and Elena\nBotoeva. ISWC (Research), 2018.")]),a._v(" "),e("li",[e("strong",[a._v("Ontology-based data access: A survey.")]),a._v(" Guohui Xiao, Diego Calvanese, Roman Kontchakov, Domenico Lembo, Antonella Poggi, Riccardo Rosati, Michael Zakharyaschev. IJCAI. 2018.")]),a._v(" "),e("li",[e("strong",[a._v("Ontop-temporal: A Tool for Ontology-based Query Answering over Temporal Data.")]),a._v(" Elem Güzel Kalayci, Guohui Xiao, Vladislav Ryzhikov, Tahir Emre Kalayci, and Diego Calvanese. CIKM. 2018.")]),a._v(" "),e("li",[e("strong",[a._v("Efficient Ontology-Based Data Integration with canonical IRIs")]),a._v(".\nGuohui Xiao, Dag Hovland, Dimitris Bilidas, Martin Rezk, Martin\nGiese, and Diego Calvanese. ESWC, 2018.")]),a._v(" "),e("li",[e("strong",[a._v("Cost-Driven Ontology-Based Data Access.")]),a._v(" Davide\nLanti, Guohui Xiao, Diego Calvanese. ISWC (Research), 2017.")]),a._v(" "),e("li",[e("strong",[a._v("Semantic Rule-Based Equipment Diagnostics.")]),a._v(" Gulnar\nMehdi, Evgeny Kharlamov, Ognjen Savkovic, Guohui Xiao, Elem\nGüzel Kalayci, Sebastian Brandt, Ian Horrocks, Mikhail Roshchin,\nThomas A. Runkler. ISWC (In-Use), 2017. "),e("a",{attrs:{href:"https://iswc2017.semanticweb.org/program/awards/",target:"_blank",rel:"noopener"}},[a._v("(Best In-Use Paper\nAward)"),e("OutboundLink")],1)]),a._v(" "),e("li",[e("strong",[a._v("Ontology-Based Data Access with a Horn Fragment of Metric\nTemporal Logic.")]),a._v(" Sebastian Brandt, Elem Güzel Kalayci,\nRoman Kontchakov, Vladislav Ryzhikov, Guohui Xiao, Michael\nZakharyaschev. AAAI, 2017.")]),a._v(" "),e("li",[e("strong",[a._v("Beyond OWL 2 QL in OBDA: Rewritings and Approximations")]),a._v(".\nElena Botoeva, Diego Calvanese, Valerio Santarelli, Domenico\nFabio Savo, Alessandro Solimando and Guohui Xiao. AAAI, 2016.")]),a._v(" "),e("li",[e("strong",[a._v("Ontology-Based Data Access for Maritime Security")]),a._v(". Stefan\nBrüggemann, Konstantina Bereta, Guohui Xiao and Manolis\nKoubarakis. ESWC (In-Use), 2016.")]),a._v(" "),e("li",[e("strong",[a._v("OBDA Constraints for Effective Query Answering")]),a._v(". Dag Hovland,\nDavide Lanti, Martin Rezk and Guohui Xiao. RuleML, 2016.")]),a._v(" "),e("li",[e("strong",[a._v("Towards Practical OBDA with Temporal Ontologies (Position\nPaper)")]),a._v(". Diego Calvanese, Elem Güzel Kalayci, Vladislav\nRyzhikov and Guohui Xiao. RR, 2016.")]),a._v(" "),e("li",[e("strong",[a._v("Ontology-based Integration of Cross-linked Datasets")]),a._v(". Diego\nCalvanese, Martin Giese, Dag Hovland and Martin Rezk (ISWC\n2015), 2015.")]),a._v(" "),e("li",[e("strong",[a._v("The NPD benchmark: Reality check for OBDA systems")]),a._v(". Davide\nLanti, Martin Rezk, Guohui Xiao, and Diego Calvanese. In Proc.\nof the 18th Int. Conf. on Extending Database Technology (EDBT\n2015). ACM Press, 2015.")]),a._v(" "),e("li",[e("strong",[a._v("Answering SPARQL Queries over Databases and under OWL 2 QL\nEntailment Regime")]),a._v(". Roman Kontchakov, Martin Rezk, Mariano\nRodriguez-Muro, Guohui Xiao, and Michael Zakharyaschev.\nInternational Semantic Web Conference (ISWC), 2014.")]),a._v(" "),e("li",[e("strong",[a._v("Rules and Ontology Based Data Access")]),a._v(". Guohui Xiao, Martin\nRezk, Mariano Rodriguez-Muro, and Diego Calvanese. Eighth\nInternational Conference on Web Reasoning and Rule Systems,\n(RR), 2014.")]),a._v(" "),e("li",[e("strong",[a._v("High Performance Query Answering over DL-Lite Ontologies.")]),a._v("\nMariano Rodriguez-Muro, Diego Calvanese. KR 2012")]),a._v(" "),e("li",[e("strong",[a._v("Quest: Effcient SPARQL-to-SQL for RDF and OWL.")]),a._v(" Mariano\nRodriguez-Muro, Josef Hardi, Diego Calvanese. ISWC (Posters &\nDemos) 2012")])]),a._v(" "),e("h2",{attrs:{id:"workshops"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#workshops"}},[a._v("#")]),a._v(" Workshops")]),a._v(" "),e("ol",[e("li",[e("strong",[a._v("Fast and Simple Data Scaling for OBDA Benchmarks")]),a._v(". Davide\nLanti, Guohui Xiao and Diego Calvanese. BLINK@ISWC, 2016.")]),a._v(" "),e("li",[e("strong",[a._v("OBDA Beyond Relational DBs: A Study for MongoDB")]),a._v(". Elena\nBotoeva, Diego Calvanese, Benjamin Cogrel, Martin Rezk and\nGuohui Xiao. Description Logics, 2016.")]),a._v(" "),e("li",[e("strong",[a._v("The ontop framework for ontology based data access.")]),a._v(" Timea\nBagosi, Diego Calvanese, Josef Hardi, Sarah Komla-Ebri, Davide\nLanti, Martin Rezk, Mariano Rodriguez-Muro, Mindaugas Slusnys,\nand Guohui Xiao. CSWS (Posters and Demos), Wuhan, China,\nAugust 2014.")]),a._v(" "),e("li",[e("strong",[a._v("The NPD benchmark for OBDA systems.")]),a._v(" Davide Lanti, Martin\nRezk, Mindaugas Slusnys, Guohui Xiao, and Diego Calvanese. SSWS\n2014")]),a._v(" "),e("li",[e("strong",[a._v("A scalable benchmark for OBDA systems: Preliminary report.")]),a._v("\nDiego Calvanese, Davide Lanti, Martin Rezk, Mindaugas Slusnys,\nand Guohui Xiao. ORE 2014")]),a._v(" "),e("li",[e("strong",[a._v("Query Rewriting and Optimisation with Database Dependencies in\nOntop.")]),a._v(" Mariano Rodriguez-Muro, Roman Kontchakov, Michael\nZakharyaschev: Description Logics 2013")]),a._v(" "),e("li",[e("strong",[a._v("Evaluating SPARQL-to-SQL Translation in Ontop.")]),a._v(" Mariano\nRodriguez-Muro, Martín Rezk, Josef Hardi, Mindaugas Slusnys,\nTimea Bagosi, Diego Calvanese: ORE 2013")]),a._v(" "),e("li",[e("strong",[a._v("OBDA with Ontop.")]),a._v(" Mariano Rodriguez-Muro, Roman Kontchakov,\nMichael Zakharyaschev: ORE 2013")]),a._v(" "),e("li",[e("strong",[a._v("Ontop at Work.")]),a._v(" Mariano Rodriguez-Muro, Roman Kontchakov,\nMichael Zakharyaschev. OWLED 2013")]),a._v(" "),e("li",[e("strong",[a._v("On Rewriting, Answering Queries in OBDA Systems for Big Data\n(Short Paper)")]),a._v(". Diego Calvanese, Ian Horrocks, Ernesto\nJiménez-Ruiz, Evgeny Kharlamov, Michael Meier, Mariano\nRodriguez-Muro, Dmitriy Zheleznyakov. OWLED 2013")]),a._v(" "),e("li",[e("strong",[a._v("Quest, an OWL 2 QL Reasoner for Ontology-based Data Access.")]),a._v("\nMariano Rodriguez-Muro, Diego Calvanese. OWLED 2012")])]),a._v(" "),e("h2",{attrs:{id:"tutorials-and-demos"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#tutorials-and-demos"}},[a._v("#")]),a._v(" Tutorials and Demos")]),a._v(" "),e("ol",[e("li",[e("a",{attrs:{href:"https://github.com/ontopic-vkg/destination-tutorial",target:"_blank",rel:"noopener"}},[a._v("Destination Tutorial"),e("OutboundLink")],1),a._v(" given at the Knowledge Graph Conference 2021 by Diego Calvanese, Benjamin Cogrel and Guohui Xiao.")]),a._v(" "),e("li",[e("a",{attrs:{href:"https://github.com/ontop/ontop-examples/tree/master/aixia-2018-tutorial/",target:"_blank",rel:"noopener"}},[a._v("Novel Developments in Ontology-Based Data Access and\nIntegration\n(NOBDI)"),e("OutboundLink")],1),a._v("\nDiego Calvanese, Benjamin Cogrel and Guohui Xiao. Full day\ntutorial, 17th International Conference of the Italian\nAssociation for Artificial Intelligence -- Trento, November\n20-23, 2018.")]),a._v(" "),e("li",[e("RouterLink",{attrs:{to:"/research/tutorials/cikm-2018/"}},[a._v("Semantic Technologies for Data Access and\nIntegration")]),a._v(".\nDiego Calvanese and Guohui Xiao. Full day tutorial, CIKM.\nTorino, 26 October 2018.")],1),a._v(" "),e("li",[e("a",{attrs:{href:"http://ontop.inf.unibz.it/ijcai-2018-tutorial/",target:"_blank",rel:"noopener"}},[a._v("Ontology-based Data Access: Theory and\nPractice"),e("OutboundLink")],1),a._v(".\nGuohui Xiao and Roman Konchakov. Full day tutorial, IJCAI 2018\nTutorial. Stockholm, July 14, 2018.")]),a._v(" "),e("li",[e("a",{attrs:{href:"http://ontop.inf.unibz.it/ekaw-2016-tutorial/",target:"_blank",rel:"noopener"}},[a._v("Mapping Management and Expressive Ontologies in Ontology-Based\nData Access"),e("OutboundLink")],1),a._v(".\nDiego Calvanese, Benjamin Cogrel and Guohui Xiao. Full day\ntutorial, EKAW. Bologna, November 19, 2016.")]),a._v(" "),e("li",[e("a",{attrs:{href:"http://esslli2016.unibz.it/wp-content/uploads/2015/10/ontop-esslli.pdf",target:"_blank",rel:"noopener"}},[a._v("Ontology-Based Data Access with\nOntop"),e("OutboundLink")],1),a._v(".\nBenjamin Cogrel. Lecture at the ESSLLI summer school, 2016.")]),a._v(" "),e("li",[e("a",{attrs:{href:"http://www.slideshare.net/guohuixiao/ontop-answering-sparql-queries-over-relational-databases/",target:"_blank",rel:"noopener"}},[a._v("Ontop: Answering SPARQL Queries over Relational\nDatabases"),e("OutboundLink")],1),a._v(".\nGuohui Xiao. Stanford, 2016.")]),a._v(" "),e("li",[e("a",{attrs:{href:"http://ontop.inf.unibz.it/iswc-2015-tutorial",target:"_blank",rel:"noopener"}},[a._v("Ontology-based Data Access: From Theory to\nPractice"),e("OutboundLink")],1),a._v(" (Diego\nCalvanese, Martin Rezk, Guohui Xiao. ISWC 2015 Tutorial)")]),a._v(" "),e("li",[e("a",{attrs:{href:"http://www.ghxiao.org/talks/2014-csws-obda-talk.pdf",target:"_blank",rel:"noopener"}},[a._v("Ontology-based data access --- Theory and\nPractice"),e("OutboundLink")],1),a._v(".\n(Guohui Xiao, Summer School at CSWS2014, Wuhan, China)")]),a._v(" "),e("li",[e("a",{attrs:{href:"http://rw2014.di.uoa.gr/?q=Schedule",target:"_blank",rel:"noopener"}},[a._v("An Introduction to Description Logics and Query\nRewriting."),e("OutboundLink")],1),a._v(" Roman\nKontchakov, Michael Zakharyaschev. Reasoning Web 2014")]),a._v(" "),e("li",[e("a",{attrs:{href:"http://link.springer.com/chapter/10.1007%2F978-3-642-39784-4_5",target:"_blank",rel:"noopener"}},[a._v("Ontology-Based Data Access with Databases: A Short\nCourse."),e("OutboundLink")],1),a._v("\n(Roman Kontchakov, Mariano Rodriguez-Muro, Michael\nZakharyaschev. Reasoning Web 2013)")]),a._v(" "),e("li",[e("a",{attrs:{href:"http://www.slideshare.net/marianomx/ontop-a-tutorial",target:"_blank",rel:"noopener"}},[a._v("Ontop: A Tutorial"),e("OutboundLink")],1),a._v("\n(Mariano Rodriguez-Muro, Vienna'13)")])]),a._v(" "),e("h2",{attrs:{id:"master-theses"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#master-theses"}},[a._v("#")]),a._v(" Master theses")]),a._v(" "),e("ul",[e("li",[a._v("Lukas Sundqvist: "),e("a",{attrs:{href:"https://ontop-vkg.org/publications/2022-sundqvist-rdf-star-ontop-msc-thesis.pdf",target:"_blank",rel:"noopener"}},[a._v("Extending VKG Systems with RDF-star Support"),e("OutboundLink")],1),a._v(", Free University of Bozen-Bolzano, March 2022.")])])])}),[],!1,null,null,null);n.default=i.exports}}]); \ No newline at end of file diff --git a/assets/js/70.390c1b51.js b/assets/js/70.598aa931.js similarity index 98% rename from assets/js/70.390c1b51.js rename to assets/js/70.598aa931.js index 0cae8df63..61247bc49 100644 --- a/assets/js/70.390c1b51.js +++ b/assets/js/70.598aa931.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[70],{447:function(e,t,a){"use strict";a.r(t);var n=a(51),i=Object(n.a)({},(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[a("h1",{attrs:{id:"cikm-2018-tutorial"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#cikm-2018-tutorial"}},[e._v("#")]),e._v(" CIKM 2018 Tutorial")]),e._v(" "),a("h2",{attrs:{id:"semantic-technologies-for-data-access-and-integration"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#semantic-technologies-for-data-access-and-integration"}},[e._v("#")]),e._v(" Semantic Technologies for Data Access and Integration")]),e._v(" "),a("h3",{attrs:{id:"presented-by"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#presented-by"}},[e._v("#")]),e._v(" Presented by")]),e._v(" "),a("p",[e._v("Diego Calvanese, Guohui Xiao")]),e._v(" "),a("h3",{attrs:{id:"time"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#time"}},[e._v("#")]),e._v(" Time")]),e._v(" "),a("p",[e._v("Friday, 26 October 2018"),a("br"),e._v("\n08:15AM-09:45AM & 10:15AM-11:45AM & 01:00PM-02:30PM")]),e._v(" "),a("h3",{attrs:{id:"abstract"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#abstract"}},[e._v("#")]),e._v(" Abstract")]),e._v(" "),a("p",[e._v("In this tutorial, we cover such principles and the main (semantic)\ntechnologies underlying OBDA/I. In addition to the theoretical\nunderpinning, we provide participants also with a practical hands-on\nexperience on state-of-the-art tools. In this way, industry\npractitioners and researchers gain a good understanding of semantic\ntechnologies for OBDA/I, and are able to deploy them for their data\naccess and data integration needs in practical use-cases.")]),e._v(" "),a("h3",{attrs:{id:"schedule"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#schedule"}},[e._v("#")]),e._v(" Schedule")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Session 1. 08:15AM-09:45AM")]),e._v(" "),a("ul",[a("li",[e._v("Motivation")]),e._v(" "),a("li",[e._v("Elements of OBDA systems")]),e._v(" "),a("li",[e._v("Semantic Web standards")])])]),e._v(" "),a("li",[a("p",[e._v("Session 2. 10:15AM-11:45AM")]),e._v(" "),a("ul",[a("li",[e._v("OBDA systems and Use cases (30 mins)")]),e._v(" "),a("li",[e._v("Hands-on with Protege (60min) [link]")])])]),e._v(" "),a("li",[a("p",[e._v("Session 3. 01:00PM-02:30PM")]),e._v(" "),a("ul",[a("li",[e._v("Query processing (rewriting) and optimization (60min)")]),e._v(" "),a("li",[e._v("Demo on integrating Web APIs using Ontop and Denodo (30min)")])]),e._v(" "),a("p",[e._v("All the slides are available at\n"),a("a",{attrs:{href:"https://github.com/ontop/ontop-examples/tree/master/cikm-2018-tutorial",target:"_blank",rel:"noopener"}},[e._v("GitHub"),a("OutboundLink")],1)])])]),e._v(" "),a("h3",{attrs:{id:"target-audience"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#target-audience"}},[e._v("#")]),e._v(" Target Audience")]),e._v(" "),a("p",[e._v("The target audience of the tutorial are researchers, PhD students,\nand practitioners, who are interested in deepening their theoretical\nunderstanding of semantic technologies for accessing and integrating\ndata, and in getting insight into recent developments in this area.")]),e._v(" "),a("h3",{attrs:{id:"prerequisite-knowledge"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#prerequisite-knowledge"}},[e._v("#")]),e._v(" Prerequisite Knowledge")]),e._v(" "),a("p",[e._v("We assume from participants basic knowledge on relational database\nfoundations (relational model, relational algebra and SQL) and\ntechnologies (use of relational engines, JDBC). Some knowledge of\nfirst-order logic might be useful, but is not required to follow the\ntutorial. Similarly, background in Semantic Web standards, such as\nRDF and SPARQL can be of help, although these notions are an\nintegral part of the tutorial, and are introduced and discussed in\nthe first part.")])])}),[],!1,null,null,null);t.default=i.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[70],{446:function(e,t,a){"use strict";a.r(t);var n=a(51),i=Object(n.a)({},(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[a("h1",{attrs:{id:"cikm-2018-tutorial"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#cikm-2018-tutorial"}},[e._v("#")]),e._v(" CIKM 2018 Tutorial")]),e._v(" "),a("h2",{attrs:{id:"semantic-technologies-for-data-access-and-integration"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#semantic-technologies-for-data-access-and-integration"}},[e._v("#")]),e._v(" Semantic Technologies for Data Access and Integration")]),e._v(" "),a("h3",{attrs:{id:"presented-by"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#presented-by"}},[e._v("#")]),e._v(" Presented by")]),e._v(" "),a("p",[e._v("Diego Calvanese, Guohui Xiao")]),e._v(" "),a("h3",{attrs:{id:"time"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#time"}},[e._v("#")]),e._v(" Time")]),e._v(" "),a("p",[e._v("Friday, 26 October 2018"),a("br"),e._v("\n08:15AM-09:45AM & 10:15AM-11:45AM & 01:00PM-02:30PM")]),e._v(" "),a("h3",{attrs:{id:"abstract"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#abstract"}},[e._v("#")]),e._v(" Abstract")]),e._v(" "),a("p",[e._v("In this tutorial, we cover such principles and the main (semantic)\ntechnologies underlying OBDA/I. In addition to the theoretical\nunderpinning, we provide participants also with a practical hands-on\nexperience on state-of-the-art tools. In this way, industry\npractitioners and researchers gain a good understanding of semantic\ntechnologies for OBDA/I, and are able to deploy them for their data\naccess and data integration needs in practical use-cases.")]),e._v(" "),a("h3",{attrs:{id:"schedule"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#schedule"}},[e._v("#")]),e._v(" Schedule")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Session 1. 08:15AM-09:45AM")]),e._v(" "),a("ul",[a("li",[e._v("Motivation")]),e._v(" "),a("li",[e._v("Elements of OBDA systems")]),e._v(" "),a("li",[e._v("Semantic Web standards")])])]),e._v(" "),a("li",[a("p",[e._v("Session 2. 10:15AM-11:45AM")]),e._v(" "),a("ul",[a("li",[e._v("OBDA systems and Use cases (30 mins)")]),e._v(" "),a("li",[e._v("Hands-on with Protege (60min) [link]")])])]),e._v(" "),a("li",[a("p",[e._v("Session 3. 01:00PM-02:30PM")]),e._v(" "),a("ul",[a("li",[e._v("Query processing (rewriting) and optimization (60min)")]),e._v(" "),a("li",[e._v("Demo on integrating Web APIs using Ontop and Denodo (30min)")])]),e._v(" "),a("p",[e._v("All the slides are available at\n"),a("a",{attrs:{href:"https://github.com/ontop/ontop-examples/tree/master/cikm-2018-tutorial",target:"_blank",rel:"noopener"}},[e._v("GitHub"),a("OutboundLink")],1)])])]),e._v(" "),a("h3",{attrs:{id:"target-audience"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#target-audience"}},[e._v("#")]),e._v(" Target Audience")]),e._v(" "),a("p",[e._v("The target audience of the tutorial are researchers, PhD students,\nand practitioners, who are interested in deepening their theoretical\nunderstanding of semantic technologies for accessing and integrating\ndata, and in getting insight into recent developments in this area.")]),e._v(" "),a("h3",{attrs:{id:"prerequisite-knowledge"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#prerequisite-knowledge"}},[e._v("#")]),e._v(" Prerequisite Knowledge")]),e._v(" "),a("p",[e._v("We assume from participants basic knowledge on relational database\nfoundations (relational model, relational algebra and SQL) and\ntechnologies (use of relational engines, JDBC). Some knowledge of\nfirst-order logic might be useful, but is not required to follow the\ntutorial. Similarly, background in Semantic Web standards, such as\nRDF and SPARQL can be of help, although these notions are an\nintegral part of the tutorial, and are introduced and discussed in\nthe first part.")])])}),[],!1,null,null,null);t.default=i.exports}}]); \ No newline at end of file diff --git a/assets/js/72.a13877f6.js b/assets/js/72.ddd2b508.js similarity index 92% rename from assets/js/72.a13877f6.js rename to assets/js/72.ddd2b508.js index 4f0e5336c..f4a1b9347 100644 --- a/assets/js/72.a13877f6.js +++ b/assets/js/72.ddd2b508.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[72],{450:function(t,o,e){"use strict";e.r(o);var a=e(51),n=Object(a.a)({},(function(){var t=this,o=t.$createElement,e=t._self._c||o;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"ontop-api"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#ontop-api"}},[t._v("#")]),t._v(" Ontop API")]),t._v(" "),e("p",[t._v("Ontop API examples are available at its own repository:")]),t._v(" "),e("p",[e("a",{attrs:{href:"https://github.com/ontop/ontop-api-examples",target:"_blank",rel:"noopener"}},[t._v("https://github.com/ontop/ontop-api-examples"),e("OutboundLink")],1)]),t._v(" "),e("p",[t._v("You can import it directly into a Java IDE. IntelliJ is recommended.")])])}),[],!1,null,null,null);o.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[72],{449:function(t,o,e){"use strict";e.r(o);var a=e(51),n=Object(a.a)({},(function(){var t=this,o=t.$createElement,e=t._self._c||o;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"ontop-api"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#ontop-api"}},[t._v("#")]),t._v(" Ontop API")]),t._v(" "),e("p",[t._v("Ontop API examples are available at its own repository:")]),t._v(" "),e("p",[e("a",{attrs:{href:"https://github.com/ontop/ontop-api-examples",target:"_blank",rel:"noopener"}},[t._v("https://github.com/ontop/ontop-api-examples"),e("OutboundLink")],1)]),t._v(" "),e("p",[t._v("You can import it directly into a Java IDE. IntelliJ is recommended.")])])}),[],!1,null,null,null);o.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/73.220f621f.js b/assets/js/73.7cb41828.js similarity index 98% rename from assets/js/73.220f621f.js rename to assets/js/73.7cb41828.js index 461b432a8..ca7fc1e9b 100644 --- a/assets/js/73.220f621f.js +++ b/assets/js/73.7cb41828.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[73],{449:function(t,e,a){"use strict";a.r(e);var s=a(51),r=Object(s.a)({},(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"database-and-ontop-setup"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#database-and-ontop-setup"}},[t._v("#")]),t._v(" Database and Ontop Setup")]),t._v(" "),a("p",[t._v("In this tutorial, we are considering fragments of the information systems\nof two universities describing students, academic staff and courses.")]),t._v(" "),a("h2",{attrs:{id:"database-setup"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#database-setup"}},[t._v("#")]),t._v(" Database setup")]),t._v(" "),a("p",[t._v("Procedure to set up the datebase for the following exercises:")]),t._v(" "),a("ol",[a("li",[t._v("Unzip the archive of H2 "),a("a",{attrs:{href:"../h2.zip"}},[a("em",[t._v("(h2.zip)")])])]),t._v(" "),a("li",[t._v("Start the database:\n"),a("ul",[a("li",[t._v("On Mac/Linux: open a terminal, go into "),a("em",[t._v("h2/bin")]),t._v(" and run "),a("code",[t._v("sh h2.sh")])]),t._v(" "),a("li",[t._v("On Windows: click on the executable "),a("code",[t._v("h2w.bat")])])])]),t._v(" "),a("li",[t._v("After being automatically redirect to the web interface of H2, connect with the default parameters:\n"),a("ul",[a("li",[t._v("JDBC URL: "),a("em",[t._v("jdbc:h2:tcp://localhost/../university-session1")])]),t._v(" "),a("li",[t._v("User name: "),a("em",[t._v("sa")])]),t._v(" "),a("li",[t._v("No password")])])]),t._v(" "),a("li",[t._v("Now you can see the tables in the schema "),a("em",[t._v("uni1")]),t._v(".")]),t._v(" "),a("li",[t._v('Try a first SQL query: "Give me the last names of the full professors"')])]),t._v(" "),a("div",{staticClass:"language-sql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("SELECT")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"last_name"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("FROM")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"uni1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"academic"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("WHERE")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"position"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n")])])]),a("h2",{attrs:{id:"ontop-protege-setup"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#ontop-protege-setup"}},[t._v("#")]),t._v(" Ontop-Protégé setup")]),t._v(" "),a("p",[t._v("Protégé is an open source ontology editor and knowledge management system. Ontop-Protégé is a plugin for designing and testing a VKG specification.")]),t._v(" "),a("ol",{attrs:{start:"0"}},[a("li",[a("a",{attrs:{href:"https://sourceforge.net/projects/ontop4obda/files",target:"_blank",rel:"noopener"}},[t._v("Download the latest Ontop-Protégé bundle for your Operating System"),a("OutboundLink")],1),t._v(" and unzip the archive and go into its folder")]),t._v(" "),a("li",[t._v("Run it ("),a("em",[t._v("run.bat")]),t._v(" on Windows, "),a("em",[t._v("run.sh")]),t._v(" on Mac/Linux)")]),t._v(" "),a("li",[t._v("Register the H2 JDBC driver: go to "),a("em",[t._v("Preferences")]),t._v(" -> "),a("em",[t._v("JDBC Drivers")]),t._v(" and add an entry with the following information\n"),a("ul",[a("li",[t._v("Description: "),a("em",[t._v("h2")])]),t._v(" "),a("li",[t._v("Class Name: "),a("em",[t._v("org.h2.Driver")])]),t._v(" "),a("li",[t._v("Driver file (jar): "),a("em",[t._v("/path/to/h2/bin/h2-1.4.196.jar")])])])])]),t._v(" "),a("h2",{attrs:{id:"programme"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#programme"}},[t._v("#")]),t._v(" Programme")]),t._v(" "),a("ol",[a("li",[a("RouterLink",{attrs:{to:"/tutorial/basic/university-1.html"}},[t._v("Mapping the first data source")])],1),t._v(" "),a("li",[a("RouterLink",{attrs:{to:"/tutorial/basic/university-2.html"}},[t._v("Mapping the second data source")])],1)])])}),[],!1,null,null,null);e.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[73],{450:function(t,e,a){"use strict";a.r(e);var s=a(51),r=Object(s.a)({},(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"database-and-ontop-setup"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#database-and-ontop-setup"}},[t._v("#")]),t._v(" Database and Ontop Setup")]),t._v(" "),a("p",[t._v("In this tutorial, we are considering fragments of the information systems\nof two universities describing students, academic staff and courses.")]),t._v(" "),a("h2",{attrs:{id:"database-setup"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#database-setup"}},[t._v("#")]),t._v(" Database setup")]),t._v(" "),a("p",[t._v("Procedure to set up the datebase for the following exercises:")]),t._v(" "),a("ol",[a("li",[t._v("Unzip the archive of H2 "),a("a",{attrs:{href:"../h2.zip"}},[a("em",[t._v("(h2.zip)")])])]),t._v(" "),a("li",[t._v("Start the database:\n"),a("ul",[a("li",[t._v("On Mac/Linux: open a terminal, go into "),a("em",[t._v("h2/bin")]),t._v(" and run "),a("code",[t._v("sh h2.sh")])]),t._v(" "),a("li",[t._v("On Windows: click on the executable "),a("code",[t._v("h2w.bat")])])])]),t._v(" "),a("li",[t._v("After being automatically redirect to the web interface of H2, connect with the default parameters:\n"),a("ul",[a("li",[t._v("JDBC URL: "),a("em",[t._v("jdbc:h2:tcp://localhost/../university-session1")])]),t._v(" "),a("li",[t._v("User name: "),a("em",[t._v("sa")])]),t._v(" "),a("li",[t._v("No password")])])]),t._v(" "),a("li",[t._v("Now you can see the tables in the schema "),a("em",[t._v("uni1")]),t._v(".")]),t._v(" "),a("li",[t._v('Try a first SQL query: "Give me the last names of the full professors"')])]),t._v(" "),a("div",{staticClass:"language-sql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("SELECT")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"last_name"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("FROM")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"uni1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"academic"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("WHERE")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"position"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n")])])]),a("h2",{attrs:{id:"ontop-protege-setup"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#ontop-protege-setup"}},[t._v("#")]),t._v(" Ontop-Protégé setup")]),t._v(" "),a("p",[t._v("Protégé is an open source ontology editor and knowledge management system. Ontop-Protégé is a plugin for designing and testing a VKG specification.")]),t._v(" "),a("ol",{attrs:{start:"0"}},[a("li",[a("a",{attrs:{href:"https://sourceforge.net/projects/ontop4obda/files",target:"_blank",rel:"noopener"}},[t._v("Download the latest Ontop-Protégé bundle for your Operating System"),a("OutboundLink")],1),t._v(" and unzip the archive and go into its folder")]),t._v(" "),a("li",[t._v("Run it ("),a("em",[t._v("run.bat")]),t._v(" on Windows, "),a("em",[t._v("run.sh")]),t._v(" on Mac/Linux)")]),t._v(" "),a("li",[t._v("Register the H2 JDBC driver: go to "),a("em",[t._v("Preferences")]),t._v(" -> "),a("em",[t._v("JDBC Drivers")]),t._v(" and add an entry with the following information\n"),a("ul",[a("li",[t._v("Description: "),a("em",[t._v("h2")])]),t._v(" "),a("li",[t._v("Class Name: "),a("em",[t._v("org.h2.Driver")])]),t._v(" "),a("li",[t._v("Driver file (jar): "),a("em",[t._v("/path/to/h2/bin/h2-1.4.196.jar")])])])])]),t._v(" "),a("h2",{attrs:{id:"programme"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#programme"}},[t._v("#")]),t._v(" Programme")]),t._v(" "),a("ol",[a("li",[a("RouterLink",{attrs:{to:"/tutorial/basic/university-1.html"}},[t._v("Mapping the first data source")])],1),t._v(" "),a("li",[a("RouterLink",{attrs:{to:"/tutorial/basic/university-2.html"}},[t._v("Mapping the second data source")])],1)])])}),[],!1,null,null,null);e.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/76.01ab5275.js b/assets/js/76.96406f20.js similarity index 92% rename from assets/js/76.01ab5275.js rename to assets/js/76.96406f20.js index 13bc862bb..65a6e7b99 100644 --- a/assets/js/76.01ab5275.js +++ b/assets/js/76.96406f20.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[76],{454:function(t,e,n){"use strict";n.r(e);var o=n(51),r=Object(o.a)({},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[n("h1",{attrs:{id:"deploying-a-sparql-endpoint"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#deploying-a-sparql-endpoint"}},[t._v("#")]),t._v(" Deploying a SPARQL endpoint")]),t._v(" "),n("p",[t._v("To deploy a SPARQL endpoint, we recommend to use the Ontop endpoint from the")]),t._v(" "),n("ul",[n("li",[n("RouterLink",{attrs:{to:"/tutorial/endpoint/endpoint-cli.html"}},[t._v("Command Line Interface")]),t._v(" or from the")],1),t._v(" "),n("li",[n("RouterLink",{attrs:{to:"/tutorial/endpoint/endpoint-docker.html"}},[t._v("Docker image")])],1)])])}),[],!1,null,null,null);e.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[76],{453:function(t,e,n){"use strict";n.r(e);var o=n(51),r=Object(o.a)({},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[n("h1",{attrs:{id:"deploying-a-sparql-endpoint"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#deploying-a-sparql-endpoint"}},[t._v("#")]),t._v(" Deploying a SPARQL endpoint")]),t._v(" "),n("p",[t._v("To deploy a SPARQL endpoint, we recommend to use the Ontop endpoint from the")]),t._v(" "),n("ul",[n("li",[n("RouterLink",{attrs:{to:"/tutorial/endpoint/endpoint-cli.html"}},[t._v("Command Line Interface")]),t._v(" or from the")],1),t._v(" "),n("li",[n("RouterLink",{attrs:{to:"/tutorial/endpoint/endpoint-docker.html"}},[t._v("Docker image")])],1)])])}),[],!1,null,null,null);e.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/77.af4d3740.js b/assets/js/77.4257ac6f.js similarity index 97% rename from assets/js/77.af4d3740.js rename to assets/js/77.4257ac6f.js index f098a256c..e5c61ea0a 100644 --- a/assets/js/77.af4d3740.js +++ b/assets/js/77.4257ac6f.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[77],{453:function(t,e,n){"use strict";n.r(e);var o=n(51),i=Object(o.a)({},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[n("h1",{attrs:{id:"setting-up-an-ontop-sparql-endpoint-with-ontop-cli"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#setting-up-an-ontop-sparql-endpoint-with-ontop-cli"}},[t._v("#")]),t._v(" Setting up an Ontop SPARQL endpoint with Ontop CLI")]),t._v(" "),n("ol",[n("li",[t._v("Download "),n("a",{attrs:{href:"https://github.com/ontop/ontop/releases",target:"_blank",rel:"noopener"}},[t._v("Ontop CLI"),n("OutboundLink")],1),t._v(" and unzip it to a directory, which is denoted as "),n("code",[t._v("$ONTOP_CLI_DIR")]),t._v(" below.")]),t._v(" "),n("li",[t._v("Copy the H2 jdbc driver to "),n("code",[t._v("$ONTOP_CLI_DIR/jdbc")]),t._v(" (if not done yet)\n"),n("ul",[n("li",[t._v("Mac/Linux: "),n("code",[t._v("cp jdbc/h2-1.4.196.jar $ONTOP_CLI_IDR/jdbc")])])])]),t._v(" "),n("li",[t._v("Start the h2 database.")]),t._v(" "),n("li",[t._v("Go to the "),n("code",[t._v("endpoint/")]),t._v(" directory. Alternatively, if you don't have already the tutorial files, you can download "),n("a",{attrs:{href:"input/university-complete.ttl"}},[t._v("this OWL ontology file")]),t._v(", "),n("a",{attrs:{href:"input/university-complete.obda"}},[t._v("this mapping file")]),t._v(", "),n("a",{attrs:{href:"input/university-complete.properties"}},[t._v("this properties file")]),t._v(" and paste them in "),n("code",[t._v("input/")]),t._v(".")]),t._v(" "),n("li",[t._v("Start the Ontop endpoint. On Mac/Linux:")])]),t._v(" "),n("div",{staticClass:"language-console extra-class"},[n("pre",{pre:!0,attrs:{class:"language-text"}},[n("code",[t._v("$ONTOP_CLI_DIR/ontop endpoint \\\n --ontology=input/university-complete.ttl \\\n --mapping=input/university-complete.obda \\\n --properties=input/university-complete.properties \\\n --cors-allowed-origins=http://yasgui.org # if needed\n")])])]),n("p",[t._v("On Windows:")]),t._v(" "),n("div",{staticClass:"language-console extra-class"},[n("pre",{pre:!0,attrs:{class:"language-text"}},[n("code",[t._v("ontop endpoint ^\n --ontology=input/university-complete.ttl ^\n --mapping=input/university-complete.obda ^\n --properties=input/university-complete.properties ^\n --cors-allowed-origins=http://yasgui.org \n")])])]),n("ol",{attrs:{start:"6"}},[n("li",[t._v("Open the web interface of the SPARQL endpoint to try some queries:\n"),n("a",{attrs:{href:"http://localhost:8080/",target:"_blank",rel:"noopener"}},[t._v("http://localhost:8080/"),n("OutboundLink")],1)])])])}),[],!1,null,null,null);e.default=i.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[77],{454:function(t,e,n){"use strict";n.r(e);var o=n(51),i=Object(o.a)({},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[n("h1",{attrs:{id:"setting-up-an-ontop-sparql-endpoint-with-ontop-cli"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#setting-up-an-ontop-sparql-endpoint-with-ontop-cli"}},[t._v("#")]),t._v(" Setting up an Ontop SPARQL endpoint with Ontop CLI")]),t._v(" "),n("ol",[n("li",[t._v("Download "),n("a",{attrs:{href:"https://github.com/ontop/ontop/releases",target:"_blank",rel:"noopener"}},[t._v("Ontop CLI"),n("OutboundLink")],1),t._v(" and unzip it to a directory, which is denoted as "),n("code",[t._v("$ONTOP_CLI_DIR")]),t._v(" below.")]),t._v(" "),n("li",[t._v("Copy the H2 jdbc driver to "),n("code",[t._v("$ONTOP_CLI_DIR/jdbc")]),t._v(" (if not done yet)\n"),n("ul",[n("li",[t._v("Mac/Linux: "),n("code",[t._v("cp jdbc/h2-1.4.196.jar $ONTOP_CLI_IDR/jdbc")])])])]),t._v(" "),n("li",[t._v("Start the h2 database.")]),t._v(" "),n("li",[t._v("Go to the "),n("code",[t._v("endpoint/")]),t._v(" directory. Alternatively, if you don't have already the tutorial files, you can download "),n("a",{attrs:{href:"input/university-complete.ttl"}},[t._v("this OWL ontology file")]),t._v(", "),n("a",{attrs:{href:"input/university-complete.obda"}},[t._v("this mapping file")]),t._v(", "),n("a",{attrs:{href:"input/university-complete.properties"}},[t._v("this properties file")]),t._v(" and paste them in "),n("code",[t._v("input/")]),t._v(".")]),t._v(" "),n("li",[t._v("Start the Ontop endpoint. On Mac/Linux:")])]),t._v(" "),n("div",{staticClass:"language-console extra-class"},[n("pre",{pre:!0,attrs:{class:"language-text"}},[n("code",[t._v("$ONTOP_CLI_DIR/ontop endpoint \\\n --ontology=input/university-complete.ttl \\\n --mapping=input/university-complete.obda \\\n --properties=input/university-complete.properties \\\n --cors-allowed-origins=http://yasgui.org # if needed\n")])])]),n("p",[t._v("On Windows:")]),t._v(" "),n("div",{staticClass:"language-console extra-class"},[n("pre",{pre:!0,attrs:{class:"language-text"}},[n("code",[t._v("ontop endpoint ^\n --ontology=input/university-complete.ttl ^\n --mapping=input/university-complete.obda ^\n --properties=input/university-complete.properties ^\n --cors-allowed-origins=http://yasgui.org \n")])])]),n("ol",{attrs:{start:"6"}},[n("li",[t._v("Open the web interface of the SPARQL endpoint to try some queries:\n"),n("a",{attrs:{href:"http://localhost:8080/",target:"_blank",rel:"noopener"}},[t._v("http://localhost:8080/"),n("OutboundLink")],1)])])])}),[],!1,null,null,null);e.default=i.exports}}]); \ No newline at end of file diff --git a/assets/js/83.5a7fea7e.js b/assets/js/83.e3f4fe9e.js similarity index 99% rename from assets/js/83.5a7fea7e.js rename to assets/js/83.e3f4fe9e.js index 605478712..e8cb39aed 100644 --- a/assets/js/83.5a7fea7e.js +++ b/assets/js/83.e3f4fe9e.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[83],{463:function(t,a,s){"use strict";s.r(a);var e=s(51),n=Object(e.a)({},(function(){var t=this,a=t.$createElement,s=t._self._c||a;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"ontop-with-dremio"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#ontop-with-dremio"}},[t._v("#")]),t._v(" Ontop with Dremio")]),t._v(" "),s("p",[t._v("In this tutorial we present step-by-step the way of connecting Dremio to Ontop. We show how to integrate "),s("em",[t._v("uni1")]),t._v(" data saved in the PostgreSQL database and "),s("em",[t._v("uni2")]),t._v(" data saved in plain JSON files into one Dremio data space.")]),t._v(" "),s("p",[t._v("We provide a Docker-compose script, which is both launching Dremio and the PostgreSQL database.\nGo at the root of the "),s("RouterLink",{attrs:{to:"/tutorial/#clone-this-repository"}},[t._v("ontop-tutorial git repository")]),t._v(" and run the following commands:")],1),t._v(" "),s("div",{staticClass:"language-sh extra-class"},[s("pre",{pre:!0,attrs:{class:"language-sh"}},[s("code",[s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("cd")]),t._v(" federation/dremio\ndocker-compose pull "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&&")]),t._v(" docker-compose up --build\n")])])]),s("p",[t._v("Once Dremio is initialized, visit "),s("a",{attrs:{href:"http://localhost:9047",target:"_blank",rel:"noopener"}},[t._v("http://localhost:9047"),s("OutboundLink")],1),t._v(". Before you continue, we recommend you to see the following tutorials provided by Dremio:")]),t._v(" "),s("ol",[s("li",[s("a",{attrs:{href:"https://www.dremio.com/tutorials/getting-oriented-to-dremio/",target:"_blank",rel:"noopener"}},[t._v("Getting oriented with Dremio"),s("OutboundLink")],1)]),t._v(" "),s("li",[s("a",{attrs:{href:"https://www.dremio.com/tutorials/working-with-your-first-dataset/",target:"_blank",rel:"noopener"}},[t._v("Working with your first dataset"),s("OutboundLink")],1)])]),t._v(" "),s("p",[t._v("By following the instructions in "),s("a",{attrs:{href:"https://www.dremio.com/tutorials/working-with-your-first-dataset/",target:"_blank",rel:"noopener"}},[t._v("Working with your first dataset"),s("OutboundLink")],1),t._v(", we create a "),s("em",[t._v("space")]),t._v(" named "),s("strong",[t._v("university")]),t._v(" as shown below.")]),t._v(" "),s("p",[t._v("Add and save the new data space:")]),t._v(" "),s("img",{attrs:{src:"img/add-space.png",width:"300"}}),t._v(" "),s("p",[t._v("It will be our data space in which we integrate data from various sources.")]),t._v(" "),s("p",[t._v("The "),s("em",[t._v("uni1")]),t._v(" data is contained in a PostgreSQL database named "),s("em",[t._v("university-session1")]),t._v(".\nWe are ready to add our database as a new datasource into Dremio:")]),t._v(" "),s("img",{attrs:{src:"img/add-external-source.png",width:"300"}}),t._v(" "),s("p",[t._v("Select PostgreSQL:")]),t._v(" "),s("img",{attrs:{src:"img/add-postgres-external.png",width:"700"}}),t._v(" "),s("p",[t._v("Enter the required JDBC information (password: "),s("em",[t._v("postgres")]),t._v("):")]),t._v(" "),s("img",{attrs:{src:"img/postgres-info.png",width:"700"}}),t._v(" "),s("p",[t._v("Now we see the tables in "),s("em",[t._v("university-session1")]),t._v(":")]),t._v(" "),s("img",{attrs:{src:"img/postgres-tables.png",width:"600"}}),t._v(" "),s("p",[t._v("We add the table "),s("em",[t._v("course-registration")]),t._v(" as dataset into "),s("em",[t._v("university")]),t._v(". We rename it to "),s("em",[t._v("uni1-registration")]),t._v(".")]),t._v(" "),s("img",{attrs:{src:"img/postgres-uni1-registration-dataset.png",width:"600"}}),t._v(" "),s("p",[t._v("Save the other datasets in similar manner.")]),t._v(" "),s("p",[t._v("Now we add the "),s("em",[t._v("uni2")]),t._v(" data from "),s("a",{attrs:{href:"data/uni2.json"}},[t._v("here")]),t._v(" as a JSON data source:")]),t._v(" "),s("img",{attrs:{src:"img/add-json.png",width:"600"}}),t._v(" "),s("p",[t._v("The "),s("em",[t._v("uni2")]),t._v(" JSON data can be seen as follows:")]),t._v(" "),s("img",{attrs:{src:"img/see-json.png",width:"800"}}),t._v(" "),s("p",[t._v("JSON files usually contain nested data. However, Ontop cannot directly query nested data. For this reason, in order to make our JSON data queryable by Ontop, first we need to extract relevant group of elements, and save these groups as datasets.")]),t._v(" "),s("p",[t._v("With the following SQL query we create an "),s("em",[t._v("uni2-registration")]),t._v(" dataset and save it into the data space "),s("em",[t._v("university")]),t._v(":")]),t._v(" "),s("div",{staticClass:"language-sql extra-class"},[s("pre",{pre:!0,attrs:{class:"language-sql"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("SELECT")]),t._v(" T"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("cid"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" T"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("enrollers"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pid "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("AS")]),t._v(" pid \n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("FROM")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("SELECT")]),t._v(" cid"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" flatten"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("enrollers"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("AS")]),t._v(" enrollers \n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("FROM")]),t._v(" uni2\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" T\n")])])]),s("p",[t._v("The following SQL expression flattens the array of enrollers:")]),t._v(" "),s("div",{staticClass:"language-sql extra-class"},[s("pre",{pre:!0,attrs:{class:"language-sql"}},[s("code",[t._v("flatten"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("enrollers"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("AS")]),t._v(" enrollers\n")])])]),s("p",[s("em",[t._v("Save As")]),t._v(" the data set with the name "),s("em",[t._v("uni2-registration")]),t._v(".")]),t._v(" "),s("img",{attrs:{src:"img/uni2-registration.png",width:"800"}}),t._v(" "),s("p",[t._v("Create a dataset named "),s("em",[t._v("uni2-course")]),t._v(" in a similar manner:")]),t._v(" "),s("div",{staticClass:"language-sql extra-class"},[s("pre",{pre:!0,attrs:{class:"language-sql"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("SELECT")]),t._v(" course"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" cid "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("FROM")]),t._v(" uni2\n")])])]),s("p",[t._v("Create a "),s("em",[t._v("uni2-student")]),t._v(" dataset with a bit more involved SQL that flattens the array of students:")]),t._v(" "),s("div",{staticClass:"language-sql extra-class"},[s("pre",{pre:!0,attrs:{class:"language-sql"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("SELECT")]),t._v(" T"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("enrollers"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"pid"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("AS")]),t._v(" pid"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("T"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("enrollers"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"fname"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("AS")]),t._v(" fname"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" T"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("enrollers"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"lname"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("AS")]),t._v(" lname \n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("FROM")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("SELECT")]),t._v(" flatten"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("enrollers"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("AS")]),t._v(" enrollers\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("FROM")]),t._v(" uni2\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" T\n")])])]),s("p",[t._v("Create "),s("em",[t._v("uni2-teaching")]),t._v(" dataset with the following SQL:")]),t._v(" "),s("div",{staticClass:"language-sql extra-class"},[s("pre",{pre:!0,attrs:{class:"language-sql"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("SELECT")]),t._v(" cid"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" uni2"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("lecturer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pid "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("AS")]),t._v(" pid\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("FROM")]),t._v(" uni2\n")])])]),s("p",[t._v("Now we can list all the datasets we saved in the "),s("em",[t._v("university")]),t._v(" space:")]),t._v(" "),s("img",{attrs:{src:"img/dataset-list-updated.png",width:"600"}}),t._v(" "),s("p",[t._v("Finally we are ready to connect Dremio to Ontop. Dremio can be connected to Ontop through its JDBC interface. By following the instructions provided in "),s("a",{attrs:{href:"https://docs.dremio.com/drivers/dremio-jdbc-driver.html",target:"_blank",rel:"noopener"}},[t._v("here"),s("OutboundLink")],1),t._v(', we provide to Ontop the following JDBC connection information in a ".properties file" for a Dremio instance running on the localhost:')]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("jdbc.url=jdbc\\:dremio\\:direct\\=localhost\\:31010\njdbc.driver=com.dremio.jdbc.Driver\njdbc.user=dremiotest\njdbc.password=dremiotest\n")])])]),s("p",[t._v("Dremio JDBC driver can be downloaded from "),s("a",{attrs:{href:"https://www.dremio.com/drivers/",target:"_blank",rel:"noopener"}},[t._v("here"),s("OutboundLink")],1),t._v(".")]),t._v(" "),s("p",[t._v("Over an OBDA setting containing the following mapping assertions:")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('[PrefixDeclaration]\n:\t\thttp://example.org/voc#\nex:\t\thttp://example.org/\nowl:\t\thttp://www.w3.org/2002/07/owl#\nrdf:\t\thttp://www.w3.org/1999/02/22-rdf-syntax-ns#\nxml:\t\thttp://www.w3.org/XML/1998/namespace\nxsd:\t\thttp://www.w3.org/2001/XMLSchema#\nfoaf:\t\thttp://xmlns.com/foaf/0.1/\nobda:\t\thttps://w3id.org/obda/vocabulary#\nrdfs:\t\thttp://www.w3.org/2000/01/rdf-schema#\n\n[MappingDeclaration] @collection [[\nmappingId\tuni1-student\ntarget\t\t:uni1/student/{s_id} a :Student ; foaf:firstName {first_name}^^xsd:string ; foaf:lastName {last_name}^^xsd:string . \nsource\t\tSELECT * FROM "university"."uni1-student"\n\nmappingId\tuni1-attends\ntarget\t\t:uni1/student/{s_id} :attends :uni1/course/{c_id}/{title} .\nsource\t\tSELECT "uni1-registration".s_id, "uni1-course".c_id, "uni1-course".title FROM "university"."uni1-registration", "university"."uni1-course" WHERE "uni1-registration".c_id = "uni1-course".c_id\n\nmappingId\tuni2-student\ntarget\t\t:uni2/student/{pid} a :Student ; foaf:firstName {fname}^^xsd:string ; foaf:lastName {lname}^^xsd:string . \nsource\t\tSELECT * FROM "university"."uni2-student"\n\nmappingId\tuni2-attends\ntarget\t\t:uni2/student/{pid} :attends :uni2/course/{cid}/{course} .\nsource\t\tSELECT "uni2-registration".pid, "uni2-course".cid, "uni2-course".course FROM "university"."uni2-registration", "university"."uni2-course" WHERE "uni2-registration".cid = "uni2-course".cid\n]]\n')])])]),s("p",[t._v("Now we can execute the following SPARQL query on Ontop:")]),t._v(" "),s("div",{staticClass:"language-sparql extra-class"},[s("pre",{pre:!0,attrs:{class:"language-sparql"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("PREFIX")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[s("span",{pre:!0,attrs:{class:"token prefix"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token url"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("http://example.org/voc#"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("PREFIX")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[s("span",{pre:!0,attrs:{class:"token prefix"}},[t._v("foaf"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token url"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("http://xmlns.com/foaf/0.1/"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("SELECT")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?course")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?firstName")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?lastName")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?student")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[s("span",{pre:!0,attrs:{class:"token prefix"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),s("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("attends")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?course")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?student")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[s("span",{pre:!0,attrs:{class:"token prefix"}},[t._v("foaf"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),s("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("firstName")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?firstName")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?student")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[s("span",{pre:!0,attrs:{class:"token prefix"}},[t._v("foaf"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),s("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("lastName")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?lastName")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])])}),[],!1,null,null,null);a.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[83],{461:function(t,a,s){"use strict";s.r(a);var e=s(51),n=Object(e.a)({},(function(){var t=this,a=t.$createElement,s=t._self._c||a;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"ontop-with-dremio"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#ontop-with-dremio"}},[t._v("#")]),t._v(" Ontop with Dremio")]),t._v(" "),s("p",[t._v("In this tutorial we present step-by-step the way of connecting Dremio to Ontop. We show how to integrate "),s("em",[t._v("uni1")]),t._v(" data saved in the PostgreSQL database and "),s("em",[t._v("uni2")]),t._v(" data saved in plain JSON files into one Dremio data space.")]),t._v(" "),s("p",[t._v("We provide a Docker-compose script, which is both launching Dremio and the PostgreSQL database.\nGo at the root of the "),s("RouterLink",{attrs:{to:"/tutorial/#clone-this-repository"}},[t._v("ontop-tutorial git repository")]),t._v(" and run the following commands:")],1),t._v(" "),s("div",{staticClass:"language-sh extra-class"},[s("pre",{pre:!0,attrs:{class:"language-sh"}},[s("code",[s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("cd")]),t._v(" federation/dremio\ndocker-compose pull "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&&")]),t._v(" docker-compose up --build\n")])])]),s("p",[t._v("Once Dremio is initialized, visit "),s("a",{attrs:{href:"http://localhost:9047",target:"_blank",rel:"noopener"}},[t._v("http://localhost:9047"),s("OutboundLink")],1),t._v(". Before you continue, we recommend you to see the following tutorials provided by Dremio:")]),t._v(" "),s("ol",[s("li",[s("a",{attrs:{href:"https://www.dremio.com/tutorials/getting-oriented-to-dremio/",target:"_blank",rel:"noopener"}},[t._v("Getting oriented with Dremio"),s("OutboundLink")],1)]),t._v(" "),s("li",[s("a",{attrs:{href:"https://www.dremio.com/tutorials/working-with-your-first-dataset/",target:"_blank",rel:"noopener"}},[t._v("Working with your first dataset"),s("OutboundLink")],1)])]),t._v(" "),s("p",[t._v("By following the instructions in "),s("a",{attrs:{href:"https://www.dremio.com/tutorials/working-with-your-first-dataset/",target:"_blank",rel:"noopener"}},[t._v("Working with your first dataset"),s("OutboundLink")],1),t._v(", we create a "),s("em",[t._v("space")]),t._v(" named "),s("strong",[t._v("university")]),t._v(" as shown below.")]),t._v(" "),s("p",[t._v("Add and save the new data space:")]),t._v(" "),s("img",{attrs:{src:"img/add-space.png",width:"300"}}),t._v(" "),s("p",[t._v("It will be our data space in which we integrate data from various sources.")]),t._v(" "),s("p",[t._v("The "),s("em",[t._v("uni1")]),t._v(" data is contained in a PostgreSQL database named "),s("em",[t._v("university-session1")]),t._v(".\nWe are ready to add our database as a new datasource into Dremio:")]),t._v(" "),s("img",{attrs:{src:"img/add-external-source.png",width:"300"}}),t._v(" "),s("p",[t._v("Select PostgreSQL:")]),t._v(" "),s("img",{attrs:{src:"img/add-postgres-external.png",width:"700"}}),t._v(" "),s("p",[t._v("Enter the required JDBC information (password: "),s("em",[t._v("postgres")]),t._v("):")]),t._v(" "),s("img",{attrs:{src:"img/postgres-info.png",width:"700"}}),t._v(" "),s("p",[t._v("Now we see the tables in "),s("em",[t._v("university-session1")]),t._v(":")]),t._v(" "),s("img",{attrs:{src:"img/postgres-tables.png",width:"600"}}),t._v(" "),s("p",[t._v("We add the table "),s("em",[t._v("course-registration")]),t._v(" as dataset into "),s("em",[t._v("university")]),t._v(". We rename it to "),s("em",[t._v("uni1-registration")]),t._v(".")]),t._v(" "),s("img",{attrs:{src:"img/postgres-uni1-registration-dataset.png",width:"600"}}),t._v(" "),s("p",[t._v("Save the other datasets in similar manner.")]),t._v(" "),s("p",[t._v("Now we add the "),s("em",[t._v("uni2")]),t._v(" data from "),s("a",{attrs:{href:"data/uni2.json"}},[t._v("here")]),t._v(" as a JSON data source:")]),t._v(" "),s("img",{attrs:{src:"img/add-json.png",width:"600"}}),t._v(" "),s("p",[t._v("The "),s("em",[t._v("uni2")]),t._v(" JSON data can be seen as follows:")]),t._v(" "),s("img",{attrs:{src:"img/see-json.png",width:"800"}}),t._v(" "),s("p",[t._v("JSON files usually contain nested data. However, Ontop cannot directly query nested data. For this reason, in order to make our JSON data queryable by Ontop, first we need to extract relevant group of elements, and save these groups as datasets.")]),t._v(" "),s("p",[t._v("With the following SQL query we create an "),s("em",[t._v("uni2-registration")]),t._v(" dataset and save it into the data space "),s("em",[t._v("university")]),t._v(":")]),t._v(" "),s("div",{staticClass:"language-sql extra-class"},[s("pre",{pre:!0,attrs:{class:"language-sql"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("SELECT")]),t._v(" T"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("cid"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" T"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("enrollers"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pid "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("AS")]),t._v(" pid \n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("FROM")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("SELECT")]),t._v(" cid"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" flatten"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("enrollers"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("AS")]),t._v(" enrollers \n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("FROM")]),t._v(" uni2\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" T\n")])])]),s("p",[t._v("The following SQL expression flattens the array of enrollers:")]),t._v(" "),s("div",{staticClass:"language-sql extra-class"},[s("pre",{pre:!0,attrs:{class:"language-sql"}},[s("code",[t._v("flatten"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("enrollers"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("AS")]),t._v(" enrollers\n")])])]),s("p",[s("em",[t._v("Save As")]),t._v(" the data set with the name "),s("em",[t._v("uni2-registration")]),t._v(".")]),t._v(" "),s("img",{attrs:{src:"img/uni2-registration.png",width:"800"}}),t._v(" "),s("p",[t._v("Create a dataset named "),s("em",[t._v("uni2-course")]),t._v(" in a similar manner:")]),t._v(" "),s("div",{staticClass:"language-sql extra-class"},[s("pre",{pre:!0,attrs:{class:"language-sql"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("SELECT")]),t._v(" course"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" cid "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("FROM")]),t._v(" uni2\n")])])]),s("p",[t._v("Create a "),s("em",[t._v("uni2-student")]),t._v(" dataset with a bit more involved SQL that flattens the array of students:")]),t._v(" "),s("div",{staticClass:"language-sql extra-class"},[s("pre",{pre:!0,attrs:{class:"language-sql"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("SELECT")]),t._v(" T"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("enrollers"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"pid"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("AS")]),t._v(" pid"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("T"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("enrollers"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"fname"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("AS")]),t._v(" fname"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" T"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("enrollers"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"lname"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("AS")]),t._v(" lname \n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("FROM")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("SELECT")]),t._v(" flatten"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("enrollers"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("AS")]),t._v(" enrollers\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("FROM")]),t._v(" uni2\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" T\n")])])]),s("p",[t._v("Create "),s("em",[t._v("uni2-teaching")]),t._v(" dataset with the following SQL:")]),t._v(" "),s("div",{staticClass:"language-sql extra-class"},[s("pre",{pre:!0,attrs:{class:"language-sql"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("SELECT")]),t._v(" cid"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" uni2"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("lecturer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pid "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("AS")]),t._v(" pid\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("FROM")]),t._v(" uni2\n")])])]),s("p",[t._v("Now we can list all the datasets we saved in the "),s("em",[t._v("university")]),t._v(" space:")]),t._v(" "),s("img",{attrs:{src:"img/dataset-list-updated.png",width:"600"}}),t._v(" "),s("p",[t._v("Finally we are ready to connect Dremio to Ontop. Dremio can be connected to Ontop through its JDBC interface. By following the instructions provided in "),s("a",{attrs:{href:"https://docs.dremio.com/drivers/dremio-jdbc-driver.html",target:"_blank",rel:"noopener"}},[t._v("here"),s("OutboundLink")],1),t._v(', we provide to Ontop the following JDBC connection information in a ".properties file" for a Dremio instance running on the localhost:')]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("jdbc.url=jdbc\\:dremio\\:direct\\=localhost\\:31010\njdbc.driver=com.dremio.jdbc.Driver\njdbc.user=dremiotest\njdbc.password=dremiotest\n")])])]),s("p",[t._v("Dremio JDBC driver can be downloaded from "),s("a",{attrs:{href:"https://www.dremio.com/drivers/",target:"_blank",rel:"noopener"}},[t._v("here"),s("OutboundLink")],1),t._v(".")]),t._v(" "),s("p",[t._v("Over an OBDA setting containing the following mapping assertions:")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('[PrefixDeclaration]\n:\t\thttp://example.org/voc#\nex:\t\thttp://example.org/\nowl:\t\thttp://www.w3.org/2002/07/owl#\nrdf:\t\thttp://www.w3.org/1999/02/22-rdf-syntax-ns#\nxml:\t\thttp://www.w3.org/XML/1998/namespace\nxsd:\t\thttp://www.w3.org/2001/XMLSchema#\nfoaf:\t\thttp://xmlns.com/foaf/0.1/\nobda:\t\thttps://w3id.org/obda/vocabulary#\nrdfs:\t\thttp://www.w3.org/2000/01/rdf-schema#\n\n[MappingDeclaration] @collection [[\nmappingId\tuni1-student\ntarget\t\t:uni1/student/{s_id} a :Student ; foaf:firstName {first_name}^^xsd:string ; foaf:lastName {last_name}^^xsd:string . \nsource\t\tSELECT * FROM "university"."uni1-student"\n\nmappingId\tuni1-attends\ntarget\t\t:uni1/student/{s_id} :attends :uni1/course/{c_id}/{title} .\nsource\t\tSELECT "uni1-registration".s_id, "uni1-course".c_id, "uni1-course".title FROM "university"."uni1-registration", "university"."uni1-course" WHERE "uni1-registration".c_id = "uni1-course".c_id\n\nmappingId\tuni2-student\ntarget\t\t:uni2/student/{pid} a :Student ; foaf:firstName {fname}^^xsd:string ; foaf:lastName {lname}^^xsd:string . \nsource\t\tSELECT * FROM "university"."uni2-student"\n\nmappingId\tuni2-attends\ntarget\t\t:uni2/student/{pid} :attends :uni2/course/{cid}/{course} .\nsource\t\tSELECT "uni2-registration".pid, "uni2-course".cid, "uni2-course".course FROM "university"."uni2-registration", "university"."uni2-course" WHERE "uni2-registration".cid = "uni2-course".cid\n]]\n')])])]),s("p",[t._v("Now we can execute the following SPARQL query on Ontop:")]),t._v(" "),s("div",{staticClass:"language-sparql extra-class"},[s("pre",{pre:!0,attrs:{class:"language-sparql"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("PREFIX")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[s("span",{pre:!0,attrs:{class:"token prefix"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token url"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("http://example.org/voc#"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("PREFIX")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[s("span",{pre:!0,attrs:{class:"token prefix"}},[t._v("foaf"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token url"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("http://xmlns.com/foaf/0.1/"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("SELECT")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?course")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?firstName")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?lastName")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?student")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[s("span",{pre:!0,attrs:{class:"token prefix"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),s("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("attends")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?course")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?student")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[s("span",{pre:!0,attrs:{class:"token prefix"}},[t._v("foaf"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),s("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("firstName")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?firstName")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?student")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[s("span",{pre:!0,attrs:{class:"token prefix"}},[t._v("foaf"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),s("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("lastName")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?lastName")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])])}),[],!1,null,null,null);a.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/85.11adfea4.js b/assets/js/85.3fe9685f.js similarity index 98% rename from assets/js/85.11adfea4.js rename to assets/js/85.3fe9685f.js index 3fd5f8b9f..886b1b8dd 100644 --- a/assets/js/85.11adfea4.js +++ b/assets/js/85.3fe9685f.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[85],{461:function(t,e,a){"use strict";a.r(e);var n=a(51),r=Object(n.a)({},(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"interact-with-an-ontop-sparql-endpoint"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#interact-with-an-ontop-sparql-endpoint"}},[t._v("#")]),t._v(" Interact with an Ontop SPARQL Endpoint")]),t._v(" "),a("p",[t._v("An Ontop Endpoint is accessible by the standard "),a("a",{attrs:{href:"https://www.w3.org/TR/sparql11-protocol/",target:"_blank",rel:"noopener"}},[t._v("SPARQL HTTP protocol"),a("OutboundLink")],1)]),t._v(" "),a("h3",{attrs:{id:"url-of-the-ontop-sparql-endpoint"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#url-of-the-ontop-sparql-endpoint"}},[t._v("#")]),t._v(" URL of the Ontop SPARQL Endpoint")]),t._v(" "),a("p",[t._v("When the endpoint is created by the Ontop CLI or Docker, the URL looks like\n"),a("code",[t._v("http://localhost:8080/sparql")]),t._v(".")]),t._v(" "),a("h3",{attrs:{id:"sending-http-requests"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#sending-http-requests"}},[t._v("#")]),t._v(" Sending HTTP Requests")]),t._v(" "),a("p",[t._v("You can use POST or GET requests carrying the SPARQL query to evaluate (as per SPARQL HTTP protocol).")]),t._v(" "),a("p",[t._v("For example, with POST:")]),t._v(" "),a("div",{staticClass:"language-http extra-class"},[a("pre",{pre:!0,attrs:{class:"language-http"}},[a("code",[t._v("POST http://localhost:8080/sparql\n"),a("span",{pre:!0,attrs:{class:"token header-name keyword"}},[t._v("Content-Type:")]),t._v(" application/sparql-query\n"),a("span",{pre:!0,attrs:{class:"token header-name keyword"}},[t._v("Accept:")]),t._v(" application/json\n\nPREFIX : \nSELECT DISTINCT ?teacher {\n ?teacher a :Teacher .\n}\n")])])]),a("h3",{attrs:{id:"using-curl-from-the-command-line"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#using-curl-from-the-command-line"}},[t._v("#")]),t._v(" Using cURL from the command line")]),t._v(" "),a("p",[t._v("The above request can be sent with the "),a("code",[t._v("cURL")]),t._v(" command:")]),t._v(" "),a("div",{staticClass:"language-console extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("curl --request POST \\\n --url http://localhost:8080/sparql \\\n --header 'accept: application/json' \\\n --header 'content-type: application/sparql-query' \\\n --data 'PREFIX : SELECT DISTINCT ?teacher {?teacher a :Teacher .}'\n")])])]),a("h3",{attrs:{id:"using-a-sparql-client-library"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#using-a-sparql-client-library"}},[t._v("#")]),t._v(" Using a SPARQL client library")]),t._v(" "),a("p",[t._v("Alternatively, you may use one of the many "),a("a",{attrs:{href:"https://www.w3.org/wiki/SparqlImplementations",target:"_blank",rel:"noopener"}},[t._v("SPARQL clients"),a("OutboundLink")],1),t._v(" available for many programming and data analysis environments, as we demonstrate next "),a("a",{attrs:{href:"tutorial/interact/jupyter"}},[t._v("using the "),a("code",[t._v("SPARQLWrapper")]),t._v(" library within a Python Jupyter Notebook")]),t._v(".")])])}),[],!1,null,null,null);e.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[85],{462:function(t,e,a){"use strict";a.r(e);var n=a(51),r=Object(n.a)({},(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"interact-with-an-ontop-sparql-endpoint"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#interact-with-an-ontop-sparql-endpoint"}},[t._v("#")]),t._v(" Interact with an Ontop SPARQL Endpoint")]),t._v(" "),a("p",[t._v("An Ontop Endpoint is accessible by the standard "),a("a",{attrs:{href:"https://www.w3.org/TR/sparql11-protocol/",target:"_blank",rel:"noopener"}},[t._v("SPARQL HTTP protocol"),a("OutboundLink")],1)]),t._v(" "),a("h3",{attrs:{id:"url-of-the-ontop-sparql-endpoint"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#url-of-the-ontop-sparql-endpoint"}},[t._v("#")]),t._v(" URL of the Ontop SPARQL Endpoint")]),t._v(" "),a("p",[t._v("When the endpoint is created by the Ontop CLI or Docker, the URL looks like\n"),a("code",[t._v("http://localhost:8080/sparql")]),t._v(".")]),t._v(" "),a("h3",{attrs:{id:"sending-http-requests"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#sending-http-requests"}},[t._v("#")]),t._v(" Sending HTTP Requests")]),t._v(" "),a("p",[t._v("You can use POST or GET requests carrying the SPARQL query to evaluate (as per SPARQL HTTP protocol).")]),t._v(" "),a("p",[t._v("For example, with POST:")]),t._v(" "),a("div",{staticClass:"language-http extra-class"},[a("pre",{pre:!0,attrs:{class:"language-http"}},[a("code",[t._v("POST http://localhost:8080/sparql\n"),a("span",{pre:!0,attrs:{class:"token header-name keyword"}},[t._v("Content-Type:")]),t._v(" application/sparql-query\n"),a("span",{pre:!0,attrs:{class:"token header-name keyword"}},[t._v("Accept:")]),t._v(" application/json\n\nPREFIX : \nSELECT DISTINCT ?teacher {\n ?teacher a :Teacher .\n}\n")])])]),a("h3",{attrs:{id:"using-curl-from-the-command-line"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#using-curl-from-the-command-line"}},[t._v("#")]),t._v(" Using cURL from the command line")]),t._v(" "),a("p",[t._v("The above request can be sent with the "),a("code",[t._v("cURL")]),t._v(" command:")]),t._v(" "),a("div",{staticClass:"language-console extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("curl --request POST \\\n --url http://localhost:8080/sparql \\\n --header 'accept: application/json' \\\n --header 'content-type: application/sparql-query' \\\n --data 'PREFIX : SELECT DISTINCT ?teacher {?teacher a :Teacher .}'\n")])])]),a("h3",{attrs:{id:"using-a-sparql-client-library"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#using-a-sparql-client-library"}},[t._v("#")]),t._v(" Using a SPARQL client library")]),t._v(" "),a("p",[t._v("Alternatively, you may use one of the many "),a("a",{attrs:{href:"https://www.w3.org/wiki/SparqlImplementations",target:"_blank",rel:"noopener"}},[t._v("SPARQL clients"),a("OutboundLink")],1),t._v(" available for many programming and data analysis environments, as we demonstrate next "),a("a",{attrs:{href:"tutorial/interact/jupyter"}},[t._v("using the "),a("code",[t._v("SPARQLWrapper")]),t._v(" library within a Python Jupyter Notebook")]),t._v(".")])])}),[],!1,null,null,null);e.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/86.9f46be21.js b/assets/js/86.5aa5781f.js similarity index 99% rename from assets/js/86.9f46be21.js rename to assets/js/86.5aa5781f.js index d13e13dd9..3f4e18e57 100644 --- a/assets/js/86.9f46be21.js +++ b/assets/js/86.5aa5781f.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[86],{462:function(t,a,e){"use strict";e.r(a);var n=e(51),s=Object(n.a)({},(function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"use-jupyter-notebook-with-an-ontop-sparql-endpoint"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#use-jupyter-notebook-with-an-ontop-sparql-endpoint"}},[t._v("#")]),t._v(" Use Jupyter Notebook with an Ontop SPARQL endpoint")]),t._v(" "),e("p",[t._v("This tutorial shows how to use a Python/Jupyter Notebook to interact with an Ontop SPARQL endpoint.")]),t._v(" "),e("p",[t._v("Link to the Jupyter Notebook: "),e("a",{attrs:{href:"ontop-jupyter.ipynb"}},[t._v("ontop-jupyter.ipynb")])]),t._v(" "),e("p",[t._v("Assume that the endpoint is already set up and the URL is "),e("a",{attrs:{href:"http://localhost:8080/sparql",target:"_blank",rel:"noopener"}},[t._v("http://localhost:8080/sparql"),e("OutboundLink")],1),t._v(".")]),t._v(" "),e("h2",{attrs:{id:"sparqlwrapper"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#sparqlwrapper"}},[t._v("#")]),t._v(" SPARQLWrapper")]),t._v(" "),e("p",[t._v("You can use the "),e("a",{attrs:{href:"https://rdflib.github.io/sparqlwrapper/",target:"_blank",rel:"noopener"}},[t._v("SPARQLWrapper library"),e("OutboundLink")],1),t._v(" to send SPARQL queries and get results.\nThe following code gets the result as JSON documents and convert it to a Python dict object.")]),t._v(" "),e("div",{staticClass:"language-python extra-class"},[e("pre",{pre:!0,attrs:{class:"language-python"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" SPARQLWrapper "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" SPARQLWrapper"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" JSON\n\nq "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token triple-quoted-string string"}},[t._v('"""\n PREFIX : \n PREFIX foaf: \n \n SELECT ?lname ?title \n WHERE {\n ?attendee foaf:lastName ?lname ; :attends ?course .\n ?course :title ?title .\n }\n"""')]),t._v("\n\nsparql "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" SPARQLWrapper"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://localhost:8080/sparql"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nsparql"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("setQuery"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("q"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nsparql"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("setReturnFormat"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("JSON"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nresults "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" sparql"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("query"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("convert"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("print")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("results"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),e("p",[t._v("Running the code above yields the following output (JSON indentation added for clarity):")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "head":{\n "vars":[ "lname", "title" ]\n },\n "results":{\n "bindings":[ {\n "lname":{ "type":"literal", "value":"Robards" },\n "title":{ "type":"literal", "value":"Data Mining" }\n }, {\n "lname":{ "type":"literal", "value":"Smith" },\n "title":{ "type":"literal", "value":"Operating Systems" }\n }, {\n "lname":{ "type":"literal", "value":"Doe" },\n "title":{ "type":"literal", "value":"Linear Algebra" }\n }, {\n "lname":{ "type":"literal", "value":"Combs" },\n "title":{ "type":"literal", "value":"Operating Systems" }\n }, {\n "lname":{ "type":"literal", "value":"Doe" },\n "title":{ "type":"literal", "value":"Analysis" }\n }, {\n "lname":{ "type":"literal", "value":"Hinkley" },\n "title":{ "type":"literal", "value":"Data Mining" }\n }, {\n "lname":{ "type":"literal", "value":"Robards" },\n "title":{ "type":"literal", "value":"Research Methods" }\n }, {\n "lname":{ "type":"literal", "value":"Smith" },\n "title":{ "type":"literal", "value":"Analysis" }\n }, {\n "lname":{ "type":"literal", "value":"Smith" },\n "title":{ "type":"literal", "value":"Linear Algebra" }\n }, {\n "lname":{ "type":"literal", "value":"Combs" },\n "title":{ "type":"literal", "value":"Linear Algebra" }\n }, {\n "lname":{ "type":"literal", "value":"Hinkley" },\n "title":{ "type":"literal", "value":"Theory of Computing" }\n }, {\n "lname":{ "type":"literal", "value":"Alfaro" },\n "title":{ "type":"literal", "value":"Introduction to programming" }\n }, {\n "lname":{ "type":"literal", "value":"Hinkley" },\n "title":{ "type":"literal", "value":"Software factory" }\n }, {\n "lname":{ "type":"literal", "value":"Mendez" },\n "title":{ "type":"literal", "value":"Software factory" }\n }, {\n "lname":{ "type":"literal", "value":"Mendez" },\n "title":{ "type":"literal", "value":"Software process management" }\n }, {\n "lname":{ "type":"literal", "value":"Moses" },\n "title":{ "type":"literal", "value":"Information security" }\n }, {\n "lname":{ "type":"literal", "value":"Moses" },\n "title":{ "type":"literal", "value":"Discrete mathematics and logic" }\n } ]\n }\n}\n')])])]),e("h2",{attrs:{id:"pandas-dataframe"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#pandas-dataframe"}},[t._v("#")]),t._v(" Pandas DataFrame")]),t._v(" "),e("p",[t._v("You might want to convert the SPARQL results to a pandas DataFrame for data analysis.\nThe library "),e("a",{attrs:{href:"https://github.com/lawlesst/sparql-dataframe",target:"_blank",rel:"noopener"}},[t._v("sparql-dataframe"),e("OutboundLink")],1),t._v(" is handy for this.")]),t._v(" "),e("div",{staticClass:"language-python extra-class"},[e("pre",{pre:!0,attrs:{class:"language-python"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" sparql_dataframe\n\nendpoint "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://localhost:8080/sparql"')]),t._v("\n\nq "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token triple-quoted-string string"}},[t._v('"""\n PREFIX : \n PREFIX foaf: \n \n SELECT ?lname ?course_title \n WHERE {\n \n ?attendee foaf:lastName ?lname ;\n :attends ?course .\n ?course :title ?course_title .\n }\n"""')]),t._v("\n\ndf "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" sparql_dataframe"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("get"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("endpoint"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" q"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),e("p",[t._v("The result "),e("code",[t._v("df")]),t._v(" can be manipulated as any Pandas DataFrame. For instance:")]),t._v(" "),e("div",{staticClass:"language-python extra-class"},[e("pre",{pre:!0,attrs:{class:"language-python"}},[e("code",[t._v("df"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("head"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),e("div",[e("style",{attrs:{scoped:""}},[t._v('\n .dataframe tbody tr th:only-of-type {\n vertical-align: middle;\n }\n\x3c!--beforebegin--\x3e
\x3c!--afterbegin--\x3e
.dataframe tbody tr th {\n    vertical-align: top;\n}\n\n.dataframe thead th {\n    text-align: right;\n}\n
\n\x3c!--beforeend--\x3e
\x3c!--afterend--\x3e')]),t._v(" "),e("table",{staticClass:"dataframe",attrs:{border:"1"}},[e("thead",[e("tr",{staticStyle:{"text-align":"right"}},[e("th"),t._v(" "),e("th",[t._v("lname")]),t._v(" "),e("th",[t._v("course_title")])])]),t._v(" "),e("tbody",[e("tr",[e("th",[t._v("0")]),t._v(" "),e("td",[t._v("Robards")]),t._v(" "),e("td",[t._v("Data Mining")])]),t._v(" "),e("tr",[e("th",[t._v("1")]),t._v(" "),e("td",[t._v("Smith")]),t._v(" "),e("td",[t._v("Operating Systems")])]),t._v(" "),e("tr",[e("th",[t._v("2")]),t._v(" "),e("td",[t._v("Doe")]),t._v(" "),e("td",[t._v("Linear Algebra")])]),t._v(" "),e("tr",[e("th",[t._v("3")]),t._v(" "),e("td",[t._v("Combs")]),t._v(" "),e("td",[t._v("Operating Systems")])]),t._v(" "),e("tr",[e("th",[t._v("4")]),t._v(" "),e("td",[t._v("Doe")]),t._v(" "),e("td",[t._v("Analysis")])])])])]),t._v(" "),e("div",{staticClass:"language-python extra-class"},[e("pre",{pre:!0,attrs:{class:"language-python"}},[e("code",[t._v("df"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("describe"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),e("div",[e("style",{attrs:{scoped:""}},[t._v('\n .dataframe tbody tr th:only-of-type {\n vertical-align: middle;\n }\n\x3c!--beforebegin--\x3e
\x3c!--afterbegin--\x3e
.dataframe tbody tr th {\n    vertical-align: top;\n}\n\n.dataframe thead th {\n    text-align: right;\n}\n
\n\x3c!--beforeend--\x3e
\x3c!--afterend--\x3e')]),t._v(" "),e("table",{staticClass:"dataframe",attrs:{border:"1"}},[e("thead",[e("tr",{staticStyle:{"text-align":"right"}},[e("th"),t._v(" "),e("th",[t._v("lname")]),t._v(" "),e("th",[t._v("course_title")])])]),t._v(" "),e("tbody",[e("tr",[e("th",[t._v("count")]),t._v(" "),e("td",[t._v("17")]),t._v(" "),e("td",[t._v("17")])]),t._v(" "),e("tr",[e("th",[t._v("unique")]),t._v(" "),e("td",[t._v("8")]),t._v(" "),e("td",[t._v("11")])]),t._v(" "),e("tr",[e("th",[t._v("top")]),t._v(" "),e("td",[t._v("Smith")]),t._v(" "),e("td",[t._v("Linear Algebra")])]),t._v(" "),e("tr",[e("th",[t._v("freq")]),t._v(" "),e("td",[t._v("3")]),t._v(" "),e("td",[t._v("3")])])])])]),t._v(" "),e("div",{staticClass:"language-python extra-class"},[e("pre",{pre:!0,attrs:{class:"language-python"}},[e("code",[t._v("df"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'course_title'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("value_counts"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("plot"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("kind"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'bar'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),e("div",{staticClass:"language- extra-class"},[e("pre",[e("code",[t._v("\n")])])]),e("img",{attrs:{src:"output_6_1.png",width:"446px"}})])}),[],!1,null,null,null);a.default=s.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[86],{463:function(t,a,e){"use strict";e.r(a);var n=e(51),s=Object(n.a)({},(function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"use-jupyter-notebook-with-an-ontop-sparql-endpoint"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#use-jupyter-notebook-with-an-ontop-sparql-endpoint"}},[t._v("#")]),t._v(" Use Jupyter Notebook with an Ontop SPARQL endpoint")]),t._v(" "),e("p",[t._v("This tutorial shows how to use a Python/Jupyter Notebook to interact with an Ontop SPARQL endpoint.")]),t._v(" "),e("p",[t._v("Link to the Jupyter Notebook: "),e("a",{attrs:{href:"ontop-jupyter.ipynb"}},[t._v("ontop-jupyter.ipynb")])]),t._v(" "),e("p",[t._v("Assume that the endpoint is already set up and the URL is "),e("a",{attrs:{href:"http://localhost:8080/sparql",target:"_blank",rel:"noopener"}},[t._v("http://localhost:8080/sparql"),e("OutboundLink")],1),t._v(".")]),t._v(" "),e("h2",{attrs:{id:"sparqlwrapper"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#sparqlwrapper"}},[t._v("#")]),t._v(" SPARQLWrapper")]),t._v(" "),e("p",[t._v("You can use the "),e("a",{attrs:{href:"https://rdflib.github.io/sparqlwrapper/",target:"_blank",rel:"noopener"}},[t._v("SPARQLWrapper library"),e("OutboundLink")],1),t._v(" to send SPARQL queries and get results.\nThe following code gets the result as JSON documents and convert it to a Python dict object.")]),t._v(" "),e("div",{staticClass:"language-python extra-class"},[e("pre",{pre:!0,attrs:{class:"language-python"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" SPARQLWrapper "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" SPARQLWrapper"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" JSON\n\nq "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token triple-quoted-string string"}},[t._v('"""\n PREFIX : \n PREFIX foaf: \n \n SELECT ?lname ?title \n WHERE {\n ?attendee foaf:lastName ?lname ; :attends ?course .\n ?course :title ?title .\n }\n"""')]),t._v("\n\nsparql "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" SPARQLWrapper"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://localhost:8080/sparql"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nsparql"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("setQuery"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("q"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nsparql"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("setReturnFormat"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("JSON"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nresults "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" sparql"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("query"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("convert"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("print")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("results"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),e("p",[t._v("Running the code above yields the following output (JSON indentation added for clarity):")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "head":{\n "vars":[ "lname", "title" ]\n },\n "results":{\n "bindings":[ {\n "lname":{ "type":"literal", "value":"Robards" },\n "title":{ "type":"literal", "value":"Data Mining" }\n }, {\n "lname":{ "type":"literal", "value":"Smith" },\n "title":{ "type":"literal", "value":"Operating Systems" }\n }, {\n "lname":{ "type":"literal", "value":"Doe" },\n "title":{ "type":"literal", "value":"Linear Algebra" }\n }, {\n "lname":{ "type":"literal", "value":"Combs" },\n "title":{ "type":"literal", "value":"Operating Systems" }\n }, {\n "lname":{ "type":"literal", "value":"Doe" },\n "title":{ "type":"literal", "value":"Analysis" }\n }, {\n "lname":{ "type":"literal", "value":"Hinkley" },\n "title":{ "type":"literal", "value":"Data Mining" }\n }, {\n "lname":{ "type":"literal", "value":"Robards" },\n "title":{ "type":"literal", "value":"Research Methods" }\n }, {\n "lname":{ "type":"literal", "value":"Smith" },\n "title":{ "type":"literal", "value":"Analysis" }\n }, {\n "lname":{ "type":"literal", "value":"Smith" },\n "title":{ "type":"literal", "value":"Linear Algebra" }\n }, {\n "lname":{ "type":"literal", "value":"Combs" },\n "title":{ "type":"literal", "value":"Linear Algebra" }\n }, {\n "lname":{ "type":"literal", "value":"Hinkley" },\n "title":{ "type":"literal", "value":"Theory of Computing" }\n }, {\n "lname":{ "type":"literal", "value":"Alfaro" },\n "title":{ "type":"literal", "value":"Introduction to programming" }\n }, {\n "lname":{ "type":"literal", "value":"Hinkley" },\n "title":{ "type":"literal", "value":"Software factory" }\n }, {\n "lname":{ "type":"literal", "value":"Mendez" },\n "title":{ "type":"literal", "value":"Software factory" }\n }, {\n "lname":{ "type":"literal", "value":"Mendez" },\n "title":{ "type":"literal", "value":"Software process management" }\n }, {\n "lname":{ "type":"literal", "value":"Moses" },\n "title":{ "type":"literal", "value":"Information security" }\n }, {\n "lname":{ "type":"literal", "value":"Moses" },\n "title":{ "type":"literal", "value":"Discrete mathematics and logic" }\n } ]\n }\n}\n')])])]),e("h2",{attrs:{id:"pandas-dataframe"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#pandas-dataframe"}},[t._v("#")]),t._v(" Pandas DataFrame")]),t._v(" "),e("p",[t._v("You might want to convert the SPARQL results to a pandas DataFrame for data analysis.\nThe library "),e("a",{attrs:{href:"https://github.com/lawlesst/sparql-dataframe",target:"_blank",rel:"noopener"}},[t._v("sparql-dataframe"),e("OutboundLink")],1),t._v(" is handy for this.")]),t._v(" "),e("div",{staticClass:"language-python extra-class"},[e("pre",{pre:!0,attrs:{class:"language-python"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" sparql_dataframe\n\nendpoint "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://localhost:8080/sparql"')]),t._v("\n\nq "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token triple-quoted-string string"}},[t._v('"""\n PREFIX : \n PREFIX foaf: \n \n SELECT ?lname ?course_title \n WHERE {\n \n ?attendee foaf:lastName ?lname ;\n :attends ?course .\n ?course :title ?course_title .\n }\n"""')]),t._v("\n\ndf "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" sparql_dataframe"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("get"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("endpoint"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" q"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),e("p",[t._v("The result "),e("code",[t._v("df")]),t._v(" can be manipulated as any Pandas DataFrame. For instance:")]),t._v(" "),e("div",{staticClass:"language-python extra-class"},[e("pre",{pre:!0,attrs:{class:"language-python"}},[e("code",[t._v("df"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("head"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),e("div",[e("style",{attrs:{scoped:""}},[t._v('\n .dataframe tbody tr th:only-of-type {\n vertical-align: middle;\n }\n\x3c!--beforebegin--\x3e
\x3c!--afterbegin--\x3e
.dataframe tbody tr th {\n    vertical-align: top;\n}\n\n.dataframe thead th {\n    text-align: right;\n}\n
\n\x3c!--beforeend--\x3e
\x3c!--afterend--\x3e')]),t._v(" "),e("table",{staticClass:"dataframe",attrs:{border:"1"}},[e("thead",[e("tr",{staticStyle:{"text-align":"right"}},[e("th"),t._v(" "),e("th",[t._v("lname")]),t._v(" "),e("th",[t._v("course_title")])])]),t._v(" "),e("tbody",[e("tr",[e("th",[t._v("0")]),t._v(" "),e("td",[t._v("Robards")]),t._v(" "),e("td",[t._v("Data Mining")])]),t._v(" "),e("tr",[e("th",[t._v("1")]),t._v(" "),e("td",[t._v("Smith")]),t._v(" "),e("td",[t._v("Operating Systems")])]),t._v(" "),e("tr",[e("th",[t._v("2")]),t._v(" "),e("td",[t._v("Doe")]),t._v(" "),e("td",[t._v("Linear Algebra")])]),t._v(" "),e("tr",[e("th",[t._v("3")]),t._v(" "),e("td",[t._v("Combs")]),t._v(" "),e("td",[t._v("Operating Systems")])]),t._v(" "),e("tr",[e("th",[t._v("4")]),t._v(" "),e("td",[t._v("Doe")]),t._v(" "),e("td",[t._v("Analysis")])])])])]),t._v(" "),e("div",{staticClass:"language-python extra-class"},[e("pre",{pre:!0,attrs:{class:"language-python"}},[e("code",[t._v("df"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("describe"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),e("div",[e("style",{attrs:{scoped:""}},[t._v('\n .dataframe tbody tr th:only-of-type {\n vertical-align: middle;\n }\n\x3c!--beforebegin--\x3e
\x3c!--afterbegin--\x3e
.dataframe tbody tr th {\n    vertical-align: top;\n}\n\n.dataframe thead th {\n    text-align: right;\n}\n
\n\x3c!--beforeend--\x3e
\x3c!--afterend--\x3e')]),t._v(" "),e("table",{staticClass:"dataframe",attrs:{border:"1"}},[e("thead",[e("tr",{staticStyle:{"text-align":"right"}},[e("th"),t._v(" "),e("th",[t._v("lname")]),t._v(" "),e("th",[t._v("course_title")])])]),t._v(" "),e("tbody",[e("tr",[e("th",[t._v("count")]),t._v(" "),e("td",[t._v("17")]),t._v(" "),e("td",[t._v("17")])]),t._v(" "),e("tr",[e("th",[t._v("unique")]),t._v(" "),e("td",[t._v("8")]),t._v(" "),e("td",[t._v("11")])]),t._v(" "),e("tr",[e("th",[t._v("top")]),t._v(" "),e("td",[t._v("Smith")]),t._v(" "),e("td",[t._v("Linear Algebra")])]),t._v(" "),e("tr",[e("th",[t._v("freq")]),t._v(" "),e("td",[t._v("3")]),t._v(" "),e("td",[t._v("3")])])])])]),t._v(" "),e("div",{staticClass:"language-python extra-class"},[e("pre",{pre:!0,attrs:{class:"language-python"}},[e("code",[t._v("df"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'course_title'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("value_counts"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("plot"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("kind"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'bar'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),e("div",{staticClass:"language- extra-class"},[e("pre",[e("code",[t._v("\n")])])]),e("img",{attrs:{src:"output_6_1.png",width:"446px"}})])}),[],!1,null,null,null);a.default=s.exports}}]); \ No newline at end of file diff --git a/assets/js/88.41f05188.js b/assets/js/88.08a33ec4.js similarity index 99% rename from assets/js/88.41f05188.js rename to assets/js/88.08a33ec4.js index 8046694e6..6060fa8a5 100644 --- a/assets/js/88.41f05188.js +++ b/assets/js/88.08a33ec4.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[88],{466:function(t,s,a){"use strict";a.r(s);var e=a(51),n=Object(e.a)({},(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"basic-lens"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#basic-lens"}},[t._v("#")]),t._v(" Basic Lens")]),t._v(" "),a("p",[t._v("Basic lenses can be used on one base relation, over which we can apply a filter, an extended projection, and additional constraints.")]),t._v(" "),a("h2",{attrs:{id:"projection"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#projection"}},[t._v("#")]),t._v(" Projection")]),t._v(" "),a("p",[t._v("For this section, we first look at the table "),a("code",[t._v("museums")]),t._v(" from the DuckDB database. This table has the following schema:")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("column")]),t._v(" "),a("th",[t._v("type")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("museum_id")]),t._v(" "),a("td",[t._v("integer")])]),t._v(" "),a("tr",[a("td",[t._v("name")]),t._v(" "),a("td",[t._v("string")])]),t._v(" "),a("tr",[a("td",[t._v("address")]),t._v(" "),a("td",[t._v("string")])]),t._v(" "),a("tr",[a("td",[t._v("yearly_income")]),t._v(" "),a("td",[t._v("integer")])]),t._v(" "),a("tr",[a("td",[t._v("yearly_spendings")]),t._v(" "),a("td",[t._v("integer")])]),t._v(" "),a("tr",[a("td",[t._v("ratings")]),t._v(" "),a("td",[t._v("array of floats")])])])]),t._v(" "),a("p",[t._v("The column "),a("code",[t._v("museum_id")]),t._v(" is a primary key.")]),t._v(" "),a("p",[t._v("Now, we make two decisions:")]),t._v(" "),a("ol",[a("li",[t._v("The "),a("code",[t._v("ratings")]),t._v(" column is not important to us, so we want to remove it.")]),t._v(" "),a("li",[t._v("The columns "),a("code",[t._v("yearly_income")]),t._v(" and "),a("code",[t._v("yearly_spendings")]),t._v(" are not interesting, but we would like to know the yearly profit ("),a("em",[t._v("income - spendings")]),t._v(")")])]),t._v(" "),a("p",[t._v("Both of these goals can be achieved using a single basic lens. The basic lens has the following structure:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"baseRelation"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"columns"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"added"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"expression"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hidden"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"filterExpression"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"BasicLens"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("We can prepare our "),a("code",[t._v("lenses.json")]),t._v(" file like this:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"relations"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"lenses"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"museum_projection"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"baseRelation"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"museums"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"columns"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"added"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" ..."),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hidden"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" ...\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"BasicLens"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("As we do not require a filter, we do not need the field "),a("code",[t._v("filterExpression")]),t._v(".\nThe field "),a("code",[t._v("columns")]),t._v(" can be used to list existing columns that should be removed and new columns that should be added.")]),t._v(" "),a("p",[t._v("Above, we decided that the fields "),a("code",[t._v("ratings")]),t._v(", "),a("code",[t._v("yearly_income")]),t._v(" and "),a("code",[t._v("yearly_spendings")]),t._v(" are not interesting to us. We can easily hide them by including their names in the "),a("code",[t._v("hidden")]),t._v(" list.")]),t._v(" "),a("p",[t._v("To add a new "),a("code",[t._v("yearly_profit")]),t._v(" field, we have to add one entry to the "),a("code",[t._v("added")]),t._v(" list, using "),a("code",[t._v("yearly profit")]),t._v(" as its name, and using the expression "),a("code",[t._v("yearly_income - yearly_spendings")]),t._v(" in its "),a("code",[t._v("expression")]),t._v(" field.")]),t._v(" "),a("div",{staticClass:"custom-block tip"},[a("p",{staticClass:"custom-block-title"},[t._v("NOTE")]),t._v(" "),a("p",[t._v("Even though we have decided to hide the columns "),a("code",[t._v("yearly_income")]),t._v(" and "),a("code",[t._v("yearly_spendings")]),t._v(", we can still use them for expressions within the same lens.")])]),t._v(" "),a("p",[t._v("After making these changes, the full "),a("code",[t._v("lenses.json")]),t._v(" file should look like this:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"relations"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"lenses"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"museum_projection"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"baseRelation"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"museums"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"columns"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"added"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"yearly_profit"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"expression"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"CAST(yearly_income - yearly_spendings as INTEGER)"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hidden"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ratings"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"yearly_income"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"yearly_spendings"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"BasicLens"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("div",{staticClass:"custom-block tip"},[a("p",{staticClass:"custom-block-title"},[t._v("NOTE")]),t._v(" "),a("p",[t._v("In the expression for "),a("code",[t._v("yearly_profit")]),t._v(", we cast the result of the subtraction to an "),a("code",[t._v("INTEGER")]),t._v(". This way, Ontop is guaranteed to know that the column will be of type "),a("code",[t._v("INTEGER")]),t._v(".")])]),t._v(" "),a("h3",{attrs:{id:"mapping"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#mapping"}},[t._v("#")]),t._v(" Mapping")]),t._v(" "),a("p",[t._v("Now that we have created a basic lens to re-format the input table, we can use the lens in a mapping. For this, we start with the mapping template provided in the tutorial files. This template already contains basic mappings that define individuals of the classes "),a("code",[t._v(":Museum")]),t._v(" and "),a("code",[t._v(":Worker")]),t._v(".")]),t._v(" "),a("p",[t._v("We now want to set the "),a("code",[t._v(":yearlyProfit")]),t._v(" datatype property for all museums. We can achieve that by adding the following mapping:")]),t._v(" "),a("div",{staticClass:"language-obda extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("mappingId\tMAPID-museum-profit\ntarget\t\tdata:museum/{museum_id} :yearlyProfit {yearly_profit} .\nsource\t\tSELECT museum_id, yearly_profit FROM lenses.museum_projection;\n")])])]),a("p",[t._v("After doing that, we can copy the "),a("code",[t._v("lenses.json")]),t._v(" and "),a("code",[t._v("mapping.obda")]),t._v(" files into the Ontop endpoint "),a("code",[t._v("input")]),t._v(" directory, as described in the "),a("RouterLink",{attrs:{to:"/tutorial/lenses/setup.html"}},[t._v("setup page")]),t._v(" and start the endpoint. Once the endpoint is started, we can open the SPARQL query editor at "),a("a",{attrs:{href:"http://localhost:8080",target:"_blank",rel:"noopener"}},[t._v("http://localhost:8080"),a("OutboundLink")],1),t._v(" and run the following query to test it:")],1),t._v(" "),a("div",{staticClass:"language-SPARQL extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sparql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("PREFIX")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token url"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("http://example.org/museum_kg/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("SELECT")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?name")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?profit")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("WHERE")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?museum")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("a")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("Museum")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?museum")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("name")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?name")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?museum")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("yearlyProfit")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?profit")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("If the lenses and mappings were constructed correctly, this query should return a list of museum names, together with different values for their yearly profit.")]),t._v(" "),a("div",{staticClass:"custom-block tip"},[a("p",{staticClass:"custom-block-title"},[t._v("NOTE")]),t._v(" "),a("p",[t._v("Notice how by changing the source query by adding "),a("code",[t._v("ratings")]),t._v(", "),a("code",[t._v("yearly_income")]),t._v(", or "),a("code",[t._v("yearly_spendings")]),t._v(" to it, the execution of the mapping fails, stating that the columns were not found. This is because they were hidden by the lens.")])]),t._v(" "),a("h2",{attrs:{id:"filter"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#filter"}},[t._v("#")]),t._v(" Filter")]),t._v(" "),a("p",[t._v("Another use case of basic lenses is to filter out some specific rows from the input table. As an example, we will look at the table "),a("code",[t._v("workers")]),t._v(". This table has the following schema:")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("column")]),t._v(" "),a("th",[t._v("type")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("worker_id")]),t._v(" "),a("td",[t._v("integer")])]),t._v(" "),a("tr",[a("td",[t._v("full_name")]),t._v(" "),a("td",[t._v("string")])]),t._v(" "),a("tr",[a("td",[t._v("role")]),t._v(" "),a("td",[t._v("string")])]),t._v(" "),a("tr",[a("td",[t._v("museum_id")]),t._v(" "),a("td",[t._v("integer")])]),t._v(" "),a("tr",[a("td",[t._v("titles")]),t._v(" "),a("td",[t._v("array of strings")])]),t._v(" "),a("tr",[a("td",[t._v("access_level")]),t._v(" "),a("td",[t._v("integer")])])])]),t._v(" "),a("p",[t._v("The column "),a("code",[t._v("worker_id")]),t._v(" is a primary key. The column "),a("code",[t._v("museum_id")]),t._v(" is a foreign key that references the table "),a("code",[t._v("museums")]),t._v(".")]),t._v(" "),a("p",[t._v("The column "),a("code",[t._v("role")]),t._v(" is a string that indicates the name of the worker's role. It can take the following three values: "),a("code",[t._v('"manager"')]),t._v(", "),a("code",[t._v('"guide"')]),t._v(", and "),a("code",[t._v('"guard"')]),t._v(". For our VKG, we decide that we want to designate all managers as individuals of the class "),a("code",[t._v(":Manager")]),t._v(". One way to achieve this is to use the filter feature of basic lenses.")]),t._v(" "),a("p",[t._v("We can prepare our "),a("code",[t._v("lenses.json")]),t._v(" file like this:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"relations"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"lenses"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"managers_filter"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"baseRelation"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"workers"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"filterExpression"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" ..."),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"BasicLens"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("The "),a("code",[t._v("columns")]),t._v(" field can be removed, as it is not required for this example. Now, we just need to define a value for the field "),a("code",[t._v("filterExpression")]),t._v(" that ignores all rows for which the column "),a("code",[t._v("role")]),t._v(" is not equal to "),a("code",[t._v('"manager"')]),t._v(". The "),a("code",[t._v("filterExpression")]),t._v(" is defined as a SQL expression in the same style as SQL "),a("code",[t._v("WHERE")]),t._v(" clauses.")]),t._v(" "),a("p",[t._v("After making this change, the full "),a("code",[t._v("lenses.json")]),t._v(" file should look like this:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"relations"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"lenses"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"managers_filter"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"baseRelation"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"workers"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"filterExpression"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("\"role = 'manager'\"")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"BasicLens"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h3",{attrs:{id:"mapping-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#mapping-2"}},[t._v("#")]),t._v(" Mapping")]),t._v(" "),a("p",[t._v("We can once again use the generated lens in our mapping file. For this, we will again extend the mapping template with one new mapping:")]),t._v(" "),a("div",{staticClass:"language-obda extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("mappingId\tMAPID-worker-managers\ntarget\t\tdata:worker/{worker_id} a :Manager .\nsource\t\tSELECT worker_id FROM lenses.managers_filter;\n")])])]),a("p",[t._v("Then, we start the Ontop endpoint and open the SPARQL editor to run the following query:")]),t._v(" "),a("div",{staticClass:"language-SPARQL extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sparql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("PREFIX")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token url"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("http://example.org/museum_kg/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("SELECT")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?name")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("WHERE")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?worker")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("a")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("Manager")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?worker")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("name")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?name")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("This should result in a list of "),a("em",[t._v("3")]),t._v(" manager names.")]),t._v(" "),a("div",{staticClass:"custom-block warning"},[a("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),a("p",[t._v("All examples in the lens sections are compatible with each other. However, all lenses referenced in the mapping file need to be included in "),a("code",[t._v("lenses.json")]),t._v(". If you wish to continuously extend the mapping file throughout the tutorial,\nyou will also need to keep all previous lenses in the "),a("code",[t._v("relations")]),t._v(" list of the lenses file, otherwise, Ontop will throw an error. Alternatively, you can always start each of the sections from a new mapping template file. This way, only the lenses of the current exercise have to be included.")])]),t._v(" "),a("p",[t._v("As an extension to this exercise, you can now try to define similar lenses and mappings for the "),a("code",[t._v('"guide"')]),t._v(" and "),a("code",[t._v('"guard"')]),t._v(" roles, assigning them to the classes "),a("code",[t._v(":Guide")]),t._v(" and "),a("code",[t._v(":Guard")]),t._v(", respectively.")]),t._v(" "),a("h2",{attrs:{id:"adding-constraints"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#adding-constraints"}},[t._v("#")]),t._v(" Adding Constraints")]),t._v(" "),a("p",[t._v("Another valuable feature of lenses is adding further constraints to relations. This feature is supported for "),a("strong",[t._v("all")]),t._v(" types of lenses, but we will cover it in this section only.")]),t._v(" "),a("p",[t._v("Generally, Ontop can infer many constraints from the base relation used by a lens. For instance, the field "),a("code",[t._v("museum_id")]),t._v(" in the table "),a("code",[t._v("museumS")]),t._v(" is a primary key, so it is "),a("em",[t._v("unique")]),t._v(" and "),a("em",[t._v("not null")]),t._v(". Our previously defined lens will be able to infer that the output relation is still unique and not null. On the other hand, for composite primary keys, if one part of the composite key is hidden by a lens, then Ontop knows that the remaining part is no longer guaranteed to be unique.")]),t._v(" "),a("p",[t._v("In many instances, however, expert knowledge can be used to define further constraints for lenses. A full list of all supported constraints and how they can be defined can be found in the "),a("RouterLink",{attrs:{to:"/guide/advanced/lenses.html"}},[t._v("documentation of lenses")]),t._v(".")],1),t._v(" "),a("p",[t._v("For this section, we want to use our expert knowledge of the table "),a("code",[t._v("workers")]),t._v(" to provide the following constraints:")]),t._v(" "),a("ol",[a("li",[t._v("The name of a worker is "),a("em",[t._v("unique")]),t._v(" and "),a("em",[t._v("not null")]),t._v(".")]),t._v(" "),a("li",[t._v("The role of a worker is "),a("em",[t._v("not null")])]),t._v(" "),a("li",[t._v("There is a functional dependency from "),a("em",[t._v("role")]),t._v(" to "),a("em",[t._v("access_level")]),t._v(".")]),t._v(" "),a("li",[t._v("The column "),a("code",[t._v("museum_id")]),t._v(" is a foreign key that references the table "),a("code",[t._v("museums")]),t._v(" (DuckDB does not have a notion of foreign keys, so it is useful to add it explicitly).")]),t._v(" "),a("li",[t._v("The "),a("code",[t._v("role")]),t._v(" column is "),a("em",[t._v("IRI-safe")]),t._v(" (all possible values of the column can be safely included in an IRI without further encoding).")])]),t._v(" "),a("p",[t._v("We can create a basic lens over the table "),a("code",[t._v("workers")]),t._v(" to define these constraints, following the guidelines from the "),a("RouterLink",{attrs:{to:"/guide/advanced/lenses.html"}},[t._v("documentation of lenses")]),t._v(". A possible solution could look like this:")],1),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"relations"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"lenses"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"workers_constraints"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"baseRelation"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"workers"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"uniqueConstraints"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"added"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"uc"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"determinants"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"full_name"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"nonNullConstraints"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"added"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"full_name"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"role"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"otherFunctionalDependencies"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"added"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"determinants"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"role"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"dependents"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"access_level"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"foreignKeys"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"added"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"fk"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"from"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"museum_id"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"to"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"relation"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"museumS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"columns"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"museum_id"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"iriSafeConstraints"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"added"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"role"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"BasicLens"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[a("strong",[t._v("Lenses can reference each other!")]),t._v(" As a further exercise, you can try using this newly created lens as the "),a("code",[t._v("baseRelation")]),t._v(" of the managers filter from before. Once that is done, you can query it again - the results should be the same as before.")]),t._v(" "),a("div",{staticClass:"custom-block tip"},[a("p",{staticClass:"custom-block-title"},[t._v("NOTE")]),t._v(" "),a("p",[t._v("We could also have added all of these constraints to the same "),a("code",[t._v("managers_filter")]),t._v(" lens from the previous section to achieve the same results. This has the advantage of reducing the work required for the lens setup and reducing the total number of relations accessible by Ontop, but it is less flexible, as we would have to copy all the constraints to the "),a("code",[t._v("guides_filter")]),t._v(" and "),a("code",[t._v("guard_filter")]),t._v(" lenses as well, resulting in a lot of duplication.")]),t._v(" "),a("p",[t._v("Generally, the optimal solution depends on the specific scenario.")])])])}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[88],{465:function(t,s,a){"use strict";a.r(s);var e=a(51),n=Object(e.a)({},(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"basic-lens"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#basic-lens"}},[t._v("#")]),t._v(" Basic Lens")]),t._v(" "),a("p",[t._v("Basic lenses can be used on one base relation, over which we can apply a filter, an extended projection, and additional constraints.")]),t._v(" "),a("h2",{attrs:{id:"projection"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#projection"}},[t._v("#")]),t._v(" Projection")]),t._v(" "),a("p",[t._v("For this section, we first look at the table "),a("code",[t._v("museums")]),t._v(" from the DuckDB database. This table has the following schema:")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("column")]),t._v(" "),a("th",[t._v("type")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("museum_id")]),t._v(" "),a("td",[t._v("integer")])]),t._v(" "),a("tr",[a("td",[t._v("name")]),t._v(" "),a("td",[t._v("string")])]),t._v(" "),a("tr",[a("td",[t._v("address")]),t._v(" "),a("td",[t._v("string")])]),t._v(" "),a("tr",[a("td",[t._v("yearly_income")]),t._v(" "),a("td",[t._v("integer")])]),t._v(" "),a("tr",[a("td",[t._v("yearly_spendings")]),t._v(" "),a("td",[t._v("integer")])]),t._v(" "),a("tr",[a("td",[t._v("ratings")]),t._v(" "),a("td",[t._v("array of floats")])])])]),t._v(" "),a("p",[t._v("The column "),a("code",[t._v("museum_id")]),t._v(" is a primary key.")]),t._v(" "),a("p",[t._v("Now, we make two decisions:")]),t._v(" "),a("ol",[a("li",[t._v("The "),a("code",[t._v("ratings")]),t._v(" column is not important to us, so we want to remove it.")]),t._v(" "),a("li",[t._v("The columns "),a("code",[t._v("yearly_income")]),t._v(" and "),a("code",[t._v("yearly_spendings")]),t._v(" are not interesting, but we would like to know the yearly profit ("),a("em",[t._v("income - spendings")]),t._v(")")])]),t._v(" "),a("p",[t._v("Both of these goals can be achieved using a single basic lens. The basic lens has the following structure:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"baseRelation"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"columns"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"added"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"expression"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hidden"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"filterExpression"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"BasicLens"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("We can prepare our "),a("code",[t._v("lenses.json")]),t._v(" file like this:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"relations"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"lenses"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"museum_projection"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"baseRelation"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"museums"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"columns"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"added"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" ..."),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hidden"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" ...\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"BasicLens"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("As we do not require a filter, we do not need the field "),a("code",[t._v("filterExpression")]),t._v(".\nThe field "),a("code",[t._v("columns")]),t._v(" can be used to list existing columns that should be removed and new columns that should be added.")]),t._v(" "),a("p",[t._v("Above, we decided that the fields "),a("code",[t._v("ratings")]),t._v(", "),a("code",[t._v("yearly_income")]),t._v(" and "),a("code",[t._v("yearly_spendings")]),t._v(" are not interesting to us. We can easily hide them by including their names in the "),a("code",[t._v("hidden")]),t._v(" list.")]),t._v(" "),a("p",[t._v("To add a new "),a("code",[t._v("yearly_profit")]),t._v(" field, we have to add one entry to the "),a("code",[t._v("added")]),t._v(" list, using "),a("code",[t._v("yearly profit")]),t._v(" as its name, and using the expression "),a("code",[t._v("yearly_income - yearly_spendings")]),t._v(" in its "),a("code",[t._v("expression")]),t._v(" field.")]),t._v(" "),a("div",{staticClass:"custom-block tip"},[a("p",{staticClass:"custom-block-title"},[t._v("NOTE")]),t._v(" "),a("p",[t._v("Even though we have decided to hide the columns "),a("code",[t._v("yearly_income")]),t._v(" and "),a("code",[t._v("yearly_spendings")]),t._v(", we can still use them for expressions within the same lens.")])]),t._v(" "),a("p",[t._v("After making these changes, the full "),a("code",[t._v("lenses.json")]),t._v(" file should look like this:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"relations"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"lenses"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"museum_projection"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"baseRelation"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"museums"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"columns"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"added"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"yearly_profit"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"expression"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"CAST(yearly_income - yearly_spendings as INTEGER)"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hidden"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ratings"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"yearly_income"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"yearly_spendings"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"BasicLens"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("div",{staticClass:"custom-block tip"},[a("p",{staticClass:"custom-block-title"},[t._v("NOTE")]),t._v(" "),a("p",[t._v("In the expression for "),a("code",[t._v("yearly_profit")]),t._v(", we cast the result of the subtraction to an "),a("code",[t._v("INTEGER")]),t._v(". This way, Ontop is guaranteed to know that the column will be of type "),a("code",[t._v("INTEGER")]),t._v(".")])]),t._v(" "),a("h3",{attrs:{id:"mapping"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#mapping"}},[t._v("#")]),t._v(" Mapping")]),t._v(" "),a("p",[t._v("Now that we have created a basic lens to re-format the input table, we can use the lens in a mapping. For this, we start with the mapping template provided in the tutorial files. This template already contains basic mappings that define individuals of the classes "),a("code",[t._v(":Museum")]),t._v(" and "),a("code",[t._v(":Worker")]),t._v(".")]),t._v(" "),a("p",[t._v("We now want to set the "),a("code",[t._v(":yearlyProfit")]),t._v(" datatype property for all museums. We can achieve that by adding the following mapping:")]),t._v(" "),a("div",{staticClass:"language-obda extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("mappingId\tMAPID-museum-profit\ntarget\t\tdata:museum/{museum_id} :yearlyProfit {yearly_profit} .\nsource\t\tSELECT museum_id, yearly_profit FROM lenses.museum_projection;\n")])])]),a("p",[t._v("After doing that, we can copy the "),a("code",[t._v("lenses.json")]),t._v(" and "),a("code",[t._v("mapping.obda")]),t._v(" files into the Ontop endpoint "),a("code",[t._v("input")]),t._v(" directory, as described in the "),a("RouterLink",{attrs:{to:"/tutorial/lenses/setup.html"}},[t._v("setup page")]),t._v(" and start the endpoint. Once the endpoint is started, we can open the SPARQL query editor at "),a("a",{attrs:{href:"http://localhost:8080",target:"_blank",rel:"noopener"}},[t._v("http://localhost:8080"),a("OutboundLink")],1),t._v(" and run the following query to test it:")],1),t._v(" "),a("div",{staticClass:"language-SPARQL extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sparql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("PREFIX")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token url"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("http://example.org/museum_kg/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("SELECT")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?name")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?profit")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("WHERE")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?museum")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("a")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("Museum")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?museum")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("name")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?name")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?museum")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("yearlyProfit")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?profit")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("If the lenses and mappings were constructed correctly, this query should return a list of museum names, together with different values for their yearly profit.")]),t._v(" "),a("div",{staticClass:"custom-block tip"},[a("p",{staticClass:"custom-block-title"},[t._v("NOTE")]),t._v(" "),a("p",[t._v("Notice how by changing the source query by adding "),a("code",[t._v("ratings")]),t._v(", "),a("code",[t._v("yearly_income")]),t._v(", or "),a("code",[t._v("yearly_spendings")]),t._v(" to it, the execution of the mapping fails, stating that the columns were not found. This is because they were hidden by the lens.")])]),t._v(" "),a("h2",{attrs:{id:"filter"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#filter"}},[t._v("#")]),t._v(" Filter")]),t._v(" "),a("p",[t._v("Another use case of basic lenses is to filter out some specific rows from the input table. As an example, we will look at the table "),a("code",[t._v("workers")]),t._v(". This table has the following schema:")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("column")]),t._v(" "),a("th",[t._v("type")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("worker_id")]),t._v(" "),a("td",[t._v("integer")])]),t._v(" "),a("tr",[a("td",[t._v("full_name")]),t._v(" "),a("td",[t._v("string")])]),t._v(" "),a("tr",[a("td",[t._v("role")]),t._v(" "),a("td",[t._v("string")])]),t._v(" "),a("tr",[a("td",[t._v("museum_id")]),t._v(" "),a("td",[t._v("integer")])]),t._v(" "),a("tr",[a("td",[t._v("titles")]),t._v(" "),a("td",[t._v("array of strings")])]),t._v(" "),a("tr",[a("td",[t._v("access_level")]),t._v(" "),a("td",[t._v("integer")])])])]),t._v(" "),a("p",[t._v("The column "),a("code",[t._v("worker_id")]),t._v(" is a primary key. The column "),a("code",[t._v("museum_id")]),t._v(" is a foreign key that references the table "),a("code",[t._v("museums")]),t._v(".")]),t._v(" "),a("p",[t._v("The column "),a("code",[t._v("role")]),t._v(" is a string that indicates the name of the worker's role. It can take the following three values: "),a("code",[t._v('"manager"')]),t._v(", "),a("code",[t._v('"guide"')]),t._v(", and "),a("code",[t._v('"guard"')]),t._v(". For our VKG, we decide that we want to designate all managers as individuals of the class "),a("code",[t._v(":Manager")]),t._v(". One way to achieve this is to use the filter feature of basic lenses.")]),t._v(" "),a("p",[t._v("We can prepare our "),a("code",[t._v("lenses.json")]),t._v(" file like this:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"relations"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"lenses"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"managers_filter"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"baseRelation"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"workers"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"filterExpression"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" ..."),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"BasicLens"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("The "),a("code",[t._v("columns")]),t._v(" field can be removed, as it is not required for this example. Now, we just need to define a value for the field "),a("code",[t._v("filterExpression")]),t._v(" that ignores all rows for which the column "),a("code",[t._v("role")]),t._v(" is not equal to "),a("code",[t._v('"manager"')]),t._v(". The "),a("code",[t._v("filterExpression")]),t._v(" is defined as a SQL expression in the same style as SQL "),a("code",[t._v("WHERE")]),t._v(" clauses.")]),t._v(" "),a("p",[t._v("After making this change, the full "),a("code",[t._v("lenses.json")]),t._v(" file should look like this:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"relations"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"lenses"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"managers_filter"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"baseRelation"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"workers"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"filterExpression"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("\"role = 'manager'\"")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"BasicLens"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h3",{attrs:{id:"mapping-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#mapping-2"}},[t._v("#")]),t._v(" Mapping")]),t._v(" "),a("p",[t._v("We can once again use the generated lens in our mapping file. For this, we will again extend the mapping template with one new mapping:")]),t._v(" "),a("div",{staticClass:"language-obda extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("mappingId\tMAPID-worker-managers\ntarget\t\tdata:worker/{worker_id} a :Manager .\nsource\t\tSELECT worker_id FROM lenses.managers_filter;\n")])])]),a("p",[t._v("Then, we start the Ontop endpoint and open the SPARQL editor to run the following query:")]),t._v(" "),a("div",{staticClass:"language-SPARQL extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sparql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("PREFIX")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token url"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("http://example.org/museum_kg/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("SELECT")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?name")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("WHERE")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?worker")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("a")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("Manager")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?worker")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("name")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?name")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("This should result in a list of "),a("em",[t._v("3")]),t._v(" manager names.")]),t._v(" "),a("div",{staticClass:"custom-block warning"},[a("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),a("p",[t._v("All examples in the lens sections are compatible with each other. However, all lenses referenced in the mapping file need to be included in "),a("code",[t._v("lenses.json")]),t._v(". If you wish to continuously extend the mapping file throughout the tutorial,\nyou will also need to keep all previous lenses in the "),a("code",[t._v("relations")]),t._v(" list of the lenses file, otherwise, Ontop will throw an error. Alternatively, you can always start each of the sections from a new mapping template file. This way, only the lenses of the current exercise have to be included.")])]),t._v(" "),a("p",[t._v("As an extension to this exercise, you can now try to define similar lenses and mappings for the "),a("code",[t._v('"guide"')]),t._v(" and "),a("code",[t._v('"guard"')]),t._v(" roles, assigning them to the classes "),a("code",[t._v(":Guide")]),t._v(" and "),a("code",[t._v(":Guard")]),t._v(", respectively.")]),t._v(" "),a("h2",{attrs:{id:"adding-constraints"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#adding-constraints"}},[t._v("#")]),t._v(" Adding Constraints")]),t._v(" "),a("p",[t._v("Another valuable feature of lenses is adding further constraints to relations. This feature is supported for "),a("strong",[t._v("all")]),t._v(" types of lenses, but we will cover it in this section only.")]),t._v(" "),a("p",[t._v("Generally, Ontop can infer many constraints from the base relation used by a lens. For instance, the field "),a("code",[t._v("museum_id")]),t._v(" in the table "),a("code",[t._v("museumS")]),t._v(" is a primary key, so it is "),a("em",[t._v("unique")]),t._v(" and "),a("em",[t._v("not null")]),t._v(". Our previously defined lens will be able to infer that the output relation is still unique and not null. On the other hand, for composite primary keys, if one part of the composite key is hidden by a lens, then Ontop knows that the remaining part is no longer guaranteed to be unique.")]),t._v(" "),a("p",[t._v("In many instances, however, expert knowledge can be used to define further constraints for lenses. A full list of all supported constraints and how they can be defined can be found in the "),a("RouterLink",{attrs:{to:"/guide/advanced/lenses.html"}},[t._v("documentation of lenses")]),t._v(".")],1),t._v(" "),a("p",[t._v("For this section, we want to use our expert knowledge of the table "),a("code",[t._v("workers")]),t._v(" to provide the following constraints:")]),t._v(" "),a("ol",[a("li",[t._v("The name of a worker is "),a("em",[t._v("unique")]),t._v(" and "),a("em",[t._v("not null")]),t._v(".")]),t._v(" "),a("li",[t._v("The role of a worker is "),a("em",[t._v("not null")])]),t._v(" "),a("li",[t._v("There is a functional dependency from "),a("em",[t._v("role")]),t._v(" to "),a("em",[t._v("access_level")]),t._v(".")]),t._v(" "),a("li",[t._v("The column "),a("code",[t._v("museum_id")]),t._v(" is a foreign key that references the table "),a("code",[t._v("museums")]),t._v(" (DuckDB does not have a notion of foreign keys, so it is useful to add it explicitly).")]),t._v(" "),a("li",[t._v("The "),a("code",[t._v("role")]),t._v(" column is "),a("em",[t._v("IRI-safe")]),t._v(" (all possible values of the column can be safely included in an IRI without further encoding).")])]),t._v(" "),a("p",[t._v("We can create a basic lens over the table "),a("code",[t._v("workers")]),t._v(" to define these constraints, following the guidelines from the "),a("RouterLink",{attrs:{to:"/guide/advanced/lenses.html"}},[t._v("documentation of lenses")]),t._v(". A possible solution could look like this:")],1),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"relations"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"lenses"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"workers_constraints"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"baseRelation"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"workers"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"uniqueConstraints"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"added"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"uc"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"determinants"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"full_name"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"nonNullConstraints"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"added"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"full_name"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"role"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"otherFunctionalDependencies"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"added"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"determinants"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"role"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"dependents"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"access_level"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"foreignKeys"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"added"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"fk"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"from"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"museum_id"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"to"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"relation"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"museumS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"columns"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"museum_id"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"iriSafeConstraints"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"added"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"role"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"BasicLens"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[a("strong",[t._v("Lenses can reference each other!")]),t._v(" As a further exercise, you can try using this newly created lens as the "),a("code",[t._v("baseRelation")]),t._v(" of the managers filter from before. Once that is done, you can query it again - the results should be the same as before.")]),t._v(" "),a("div",{staticClass:"custom-block tip"},[a("p",{staticClass:"custom-block-title"},[t._v("NOTE")]),t._v(" "),a("p",[t._v("We could also have added all of these constraints to the same "),a("code",[t._v("managers_filter")]),t._v(" lens from the previous section to achieve the same results. This has the advantage of reducing the work required for the lens setup and reducing the total number of relations accessible by Ontop, but it is less flexible, as we would have to copy all the constraints to the "),a("code",[t._v("guides_filter")]),t._v(" and "),a("code",[t._v("guard_filter")]),t._v(" lenses as well, resulting in a lot of duplication.")]),t._v(" "),a("p",[t._v("Generally, the optimal solution depends on the specific scenario.")])])])}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/89.bb41254d.js b/assets/js/89.801941ce.js similarity index 99% rename from assets/js/89.bb41254d.js rename to assets/js/89.801941ce.js index a32d80bf4..e65b4411f 100644 --- a/assets/js/89.bb41254d.js +++ b/assets/js/89.801941ce.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[89],{465:function(t,e,a){"use strict";a.r(e);var s=a(51),n=Object(s.a)({},(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"flatten-lens"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#flatten-lens"}},[t._v("#")]),t._v(" Flatten Lens")]),t._v(" "),a("p",[a("em",[t._v("Flatten lenses are supported since 5.1.0.")])]),t._v(" "),a("p",[t._v('Flattening or unnesting an array is the process of transforming a nested array into an array of lower dimensionality, by "pulling" each nested entry into its "outer" entry. In databases, specifically, it represents a function that takes a column containing an array and transforms it into a table that has each of the '),a("em",[t._v("outer-most")]),t._v(" elements as one of its rows.")]),t._v(" "),a("p",[t._v("Flattening is need when we want to map values inside arrays.")]),t._v(" "),a("p",[t._v("In Ontop, a flatten lens is a type of lens over a single base relation that takes as an input the column that should be flattened, the names of columns that should be retained after flattening, and the name of the column that should be added containing the flattened output. Additionally, the name for a "),a("em",[t._v("position")]),t._v(" column can be passed to the lens. When flattening, the "),a("em",[t._v("position")]),t._v(" column will hold the index of the current row's flattened element in the original array.")]),t._v(" "),a("p",[t._v("For this example, we will first look at the table "),a("code",[t._v("workers")]),t._v(". This table has the following schema:")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("column")]),t._v(" "),a("th",[t._v("type")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("worker_id")]),t._v(" "),a("td",[t._v("integer")])]),t._v(" "),a("tr",[a("td",[t._v("full_name")]),t._v(" "),a("td",[t._v("string")])]),t._v(" "),a("tr",[a("td",[t._v("role")]),t._v(" "),a("td",[t._v("string")])]),t._v(" "),a("tr",[a("td",[t._v("museum_id")]),t._v(" "),a("td",[t._v("integer")])]),t._v(" "),a("tr",[a("td",[t._v("titles")]),t._v(" "),a("td",[t._v("array of strings")])]),t._v(" "),a("tr",[a("td",[t._v("access_level")]),t._v(" "),a("td",[t._v("integer")])])])]),t._v(" "),a("p",[t._v("The column "),a("code",[t._v("titles")]),t._v(" is an array of strings that contains all the degrees and titles the employee has received. Our goal is to populate the datatype properties "),a("code",[t._v(":hasTitle")]),t._v(" defined from the "),a("code",[t._v(":Worker")]),t._v(" class to any number of string literals taken from the table, and "),a("code",[t._v(":preferredTitle")]),t._v(", defined from the "),a("code",[t._v(":Worker")]),t._v(" class to a single literal, which is the first entry of the "),a("code",[t._v("titles")]),t._v(" array. To do so efficiently, we need to flatten the "),a("code",[t._v("titles")]),t._v(" column.")]),t._v(" "),a("p",[t._v("The flatten lens has the following structure:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"baseRelation"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"flattenedColumn"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"datatype"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"columns"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"kept"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"new"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"position"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"FlattenLens"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("The field "),a("code",[t._v("kept")]),t._v(" takes a list of column names from the original table that should be retained after flattening. The field "),a("code",[t._v("new")]),t._v(" takes the name of the column that contains the flattened output and the field "),a("code",[t._v("position")]),t._v(" takes the name of the column that contains the index of the current output. The flattened column takes two arguments: "),a("code",[t._v("name")]),t._v(" determines the name of the column that should be flattened, and "),a("code",[t._v("datatype")]),t._v(" indicates the column's type. Depending on the SQL dialect, this can vary from "),a("code",[t._v("ARRAY")]),t._v(" or "),a("code",[t._v("T[]")]),t._v(" where "),a("code",[t._v("T")]),t._v(" is a different SQL data type to "),a("code",[t._v("JSON")]),t._v(" or "),a("code",[t._v("VARCHAR")]),t._v(" if arrays are represented and flattened in JSON format.")]),t._v(" "),a("p",[t._v("In DuckDB, the array data type is defined as "),a("code",[t._v("T[]")]),t._v(", so in our specific case, the field "),a("code",[t._v("datatype")]),t._v(" will take the value "),a("code",[t._v("STRING[]")]),t._v(".")]),t._v(" "),a("p",[t._v("A possible "),a("code",[t._v("lenses.json")]),t._v(" file for this task may look like this:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"relations"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"lenses"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"flattened_titles"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"baseRelation"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"workers"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"flattenedColumn"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"titles"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"datatype"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"STRING[]"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"columns"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"kept"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"worker_id"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"new"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"title"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"position"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"index"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("As we just need to assign a title to a "),a("code",[t._v(":Worker")]),t._v(" individual, the only column that has to be kept is "),a("code",[t._v("worker_id")]),t._v(".")]),t._v(" "),a("h3",{attrs:{id:"mapping"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#mapping"}},[t._v("#")]),t._v(" Mapping")]),t._v(" "),a("p",[t._v("Now, we can already define the mapping entries for the wanted properties:")]),t._v(" "),a("div",{staticClass:"language-obda extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("mappingId\tMAPID-has-title\ntarget\t\tdata:worker/{worker_id} :hasTitle {title} .\nsource\t\tSELECT worker_id, title FROM lenses.flattened_titles;\n\nmappingId\tMAPID-preferred-title\ntarget\t\tdata:worker/{worker_id} :preferredTitle {title} .\nsource\t\tSELECT worker_id, title FROM lenses.flattened_titles WHERE index = 1;\n")])])]),a("div",{staticClass:"custom-block tip"},[a("p",{staticClass:"custom-block-title"},[t._v("NOTE")]),t._v(" "),a("p",[t._v("Instead of using a source query with a "),a("code",[t._v("WHERE")]),t._v(" condition in the second mapping, we could also wrap a basic lens around the flatten lens that performs the filter operation, but we kept it like this for the sake of simplicity.")])]),t._v(" "),a("p",[t._v("Let us now run a SPARQL query over the Ontop endpoint to test our mappings and lenses.")]),t._v(" "),a("div",{staticClass:"language-SPARQL extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sparql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("PREFIX")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token url"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("http://example.org/museum_kg/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("SELECT")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?name")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?title")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?prefTitle")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("WHERE")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?worker")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("a")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("Worker")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?worker")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("name")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?name")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?worker")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("hasTitle")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?title")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?worker")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("preferredTitle")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?prefTitle")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("This should result in a list of all employees, together with their titles and their preferred title.")]),t._v(" "),a("h3",{attrs:{id:"flattening-other-types-of-arrays"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#flattening-other-types-of-arrays"}},[t._v("#")]),t._v(" Flattening other types of arrays")]),t._v(" "),a("p",[t._v("The flatten lens works on all types of arrays, and, depending on the capabilities of the dialect, can infer the output type of the flattened column. As a further exercise, try looking at the table "),a("code",[t._v("museums")]),t._v(".")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("column")]),t._v(" "),a("th",[t._v("type")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("museum_id")]),t._v(" "),a("td",[t._v("integer")])]),t._v(" "),a("tr",[a("td",[t._v("name")]),t._v(" "),a("td",[t._v("string")])]),t._v(" "),a("tr",[a("td",[t._v("address")]),t._v(" "),a("td",[t._v("string")])]),t._v(" "),a("tr",[a("td",[t._v("yearly_income")]),t._v(" "),a("td",[t._v("integer")])]),t._v(" "),a("tr",[a("td",[t._v("yearly_spendings")]),t._v(" "),a("td",[t._v("integer")])]),t._v(" "),a("tr",[a("td",[t._v("ratings")]),t._v(" "),a("td",[t._v("array of floats")])])])]),t._v(" "),a("p",[t._v("The field "),a("code",[t._v("ratings")]),t._v(" is an array of floating point numbers between 1 and 10. Try creating a flatten lens that can unnest this array to populate the datatype property "),a("code",[t._v(":hasRating")]),t._v("! Ontop will be able to automatically detect that the flattened column has the type "),a("code",[t._v("FLOAT")]),t._v('. Keep in mind that we do not necessarily need a "position" column for this use case.')]),t._v(" "),a("div",{staticClass:"custom-block warning"},[a("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),a("p",[t._v("When arrays in a given dialect are defined as "),a("code",[t._v("ARRAY")]),t._v(", "),a("code",[t._v("T[]")]),t._v(", or similarly, Ontop is able to infer the data type of the output column after flattening. However, when this is not the case (either the array was provided as JSON or the array data type of the dialect is simply called "),a("code",[t._v("ARRAY")]),t._v(" or similarly), Ontop cannot perform this inference. In those cases, it is suggested to put a basic lens over the flatten lens that explicitly performs a "),a("code",[t._v("CAST")]),t._v(" on the output, to allow Ontop to know the column type once again.")])]),t._v(" "),a("div",{staticClass:"custom-block warning"},[a("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),a("p",[t._v("The level of support for the flatten lens depends strongly on the dialect. Please consult the "),a("RouterLink",{attrs:{to:"/guide/advanced/lenses.html"}},[t._v("flatten lens documentation page")]),t._v(" for more info on each supported dialect.")],1)])])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[89],{466:function(t,e,a){"use strict";a.r(e);var s=a(51),n=Object(s.a)({},(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"flatten-lens"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#flatten-lens"}},[t._v("#")]),t._v(" Flatten Lens")]),t._v(" "),a("p",[a("em",[t._v("Flatten lenses are supported since 5.1.0.")])]),t._v(" "),a("p",[t._v('Flattening or unnesting an array is the process of transforming a nested array into an array of lower dimensionality, by "pulling" each nested entry into its "outer" entry. In databases, specifically, it represents a function that takes a column containing an array and transforms it into a table that has each of the '),a("em",[t._v("outer-most")]),t._v(" elements as one of its rows.")]),t._v(" "),a("p",[t._v("Flattening is need when we want to map values inside arrays.")]),t._v(" "),a("p",[t._v("In Ontop, a flatten lens is a type of lens over a single base relation that takes as an input the column that should be flattened, the names of columns that should be retained after flattening, and the name of the column that should be added containing the flattened output. Additionally, the name for a "),a("em",[t._v("position")]),t._v(" column can be passed to the lens. When flattening, the "),a("em",[t._v("position")]),t._v(" column will hold the index of the current row's flattened element in the original array.")]),t._v(" "),a("p",[t._v("For this example, we will first look at the table "),a("code",[t._v("workers")]),t._v(". This table has the following schema:")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("column")]),t._v(" "),a("th",[t._v("type")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("worker_id")]),t._v(" "),a("td",[t._v("integer")])]),t._v(" "),a("tr",[a("td",[t._v("full_name")]),t._v(" "),a("td",[t._v("string")])]),t._v(" "),a("tr",[a("td",[t._v("role")]),t._v(" "),a("td",[t._v("string")])]),t._v(" "),a("tr",[a("td",[t._v("museum_id")]),t._v(" "),a("td",[t._v("integer")])]),t._v(" "),a("tr",[a("td",[t._v("titles")]),t._v(" "),a("td",[t._v("array of strings")])]),t._v(" "),a("tr",[a("td",[t._v("access_level")]),t._v(" "),a("td",[t._v("integer")])])])]),t._v(" "),a("p",[t._v("The column "),a("code",[t._v("titles")]),t._v(" is an array of strings that contains all the degrees and titles the employee has received. Our goal is to populate the datatype properties "),a("code",[t._v(":hasTitle")]),t._v(" defined from the "),a("code",[t._v(":Worker")]),t._v(" class to any number of string literals taken from the table, and "),a("code",[t._v(":preferredTitle")]),t._v(", defined from the "),a("code",[t._v(":Worker")]),t._v(" class to a single literal, which is the first entry of the "),a("code",[t._v("titles")]),t._v(" array. To do so efficiently, we need to flatten the "),a("code",[t._v("titles")]),t._v(" column.")]),t._v(" "),a("p",[t._v("The flatten lens has the following structure:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"baseRelation"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"flattenedColumn"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"datatype"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"columns"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"kept"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"new"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"position"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"FlattenLens"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("The field "),a("code",[t._v("kept")]),t._v(" takes a list of column names from the original table that should be retained after flattening. The field "),a("code",[t._v("new")]),t._v(" takes the name of the column that contains the flattened output and the field "),a("code",[t._v("position")]),t._v(" takes the name of the column that contains the index of the current output. The flattened column takes two arguments: "),a("code",[t._v("name")]),t._v(" determines the name of the column that should be flattened, and "),a("code",[t._v("datatype")]),t._v(" indicates the column's type. Depending on the SQL dialect, this can vary from "),a("code",[t._v("ARRAY")]),t._v(" or "),a("code",[t._v("T[]")]),t._v(" where "),a("code",[t._v("T")]),t._v(" is a different SQL data type to "),a("code",[t._v("JSON")]),t._v(" or "),a("code",[t._v("VARCHAR")]),t._v(" if arrays are represented and flattened in JSON format.")]),t._v(" "),a("p",[t._v("In DuckDB, the array data type is defined as "),a("code",[t._v("T[]")]),t._v(", so in our specific case, the field "),a("code",[t._v("datatype")]),t._v(" will take the value "),a("code",[t._v("STRING[]")]),t._v(".")]),t._v(" "),a("p",[t._v("A possible "),a("code",[t._v("lenses.json")]),t._v(" file for this task may look like this:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"relations"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"lenses"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"flattened_titles"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"baseRelation"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"workers"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"flattenedColumn"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"titles"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"datatype"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"STRING[]"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"columns"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"kept"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"worker_id"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"new"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"title"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"position"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"index"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("As we just need to assign a title to a "),a("code",[t._v(":Worker")]),t._v(" individual, the only column that has to be kept is "),a("code",[t._v("worker_id")]),t._v(".")]),t._v(" "),a("h3",{attrs:{id:"mapping"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#mapping"}},[t._v("#")]),t._v(" Mapping")]),t._v(" "),a("p",[t._v("Now, we can already define the mapping entries for the wanted properties:")]),t._v(" "),a("div",{staticClass:"language-obda extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("mappingId\tMAPID-has-title\ntarget\t\tdata:worker/{worker_id} :hasTitle {title} .\nsource\t\tSELECT worker_id, title FROM lenses.flattened_titles;\n\nmappingId\tMAPID-preferred-title\ntarget\t\tdata:worker/{worker_id} :preferredTitle {title} .\nsource\t\tSELECT worker_id, title FROM lenses.flattened_titles WHERE index = 1;\n")])])]),a("div",{staticClass:"custom-block tip"},[a("p",{staticClass:"custom-block-title"},[t._v("NOTE")]),t._v(" "),a("p",[t._v("Instead of using a source query with a "),a("code",[t._v("WHERE")]),t._v(" condition in the second mapping, we could also wrap a basic lens around the flatten lens that performs the filter operation, but we kept it like this for the sake of simplicity.")])]),t._v(" "),a("p",[t._v("Let us now run a SPARQL query over the Ontop endpoint to test our mappings and lenses.")]),t._v(" "),a("div",{staticClass:"language-SPARQL extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sparql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("PREFIX")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token url"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("http://example.org/museum_kg/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("SELECT")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?name")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?title")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?prefTitle")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("WHERE")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?worker")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("a")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("Worker")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?worker")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("name")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?name")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?worker")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("hasTitle")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?title")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?worker")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("preferredTitle")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?prefTitle")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("This should result in a list of all employees, together with their titles and their preferred title.")]),t._v(" "),a("h3",{attrs:{id:"flattening-other-types-of-arrays"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#flattening-other-types-of-arrays"}},[t._v("#")]),t._v(" Flattening other types of arrays")]),t._v(" "),a("p",[t._v("The flatten lens works on all types of arrays, and, depending on the capabilities of the dialect, can infer the output type of the flattened column. As a further exercise, try looking at the table "),a("code",[t._v("museums")]),t._v(".")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("column")]),t._v(" "),a("th",[t._v("type")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("museum_id")]),t._v(" "),a("td",[t._v("integer")])]),t._v(" "),a("tr",[a("td",[t._v("name")]),t._v(" "),a("td",[t._v("string")])]),t._v(" "),a("tr",[a("td",[t._v("address")]),t._v(" "),a("td",[t._v("string")])]),t._v(" "),a("tr",[a("td",[t._v("yearly_income")]),t._v(" "),a("td",[t._v("integer")])]),t._v(" "),a("tr",[a("td",[t._v("yearly_spendings")]),t._v(" "),a("td",[t._v("integer")])]),t._v(" "),a("tr",[a("td",[t._v("ratings")]),t._v(" "),a("td",[t._v("array of floats")])])])]),t._v(" "),a("p",[t._v("The field "),a("code",[t._v("ratings")]),t._v(" is an array of floating point numbers between 1 and 10. Try creating a flatten lens that can unnest this array to populate the datatype property "),a("code",[t._v(":hasRating")]),t._v("! Ontop will be able to automatically detect that the flattened column has the type "),a("code",[t._v("FLOAT")]),t._v('. Keep in mind that we do not necessarily need a "position" column for this use case.')]),t._v(" "),a("div",{staticClass:"custom-block warning"},[a("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),a("p",[t._v("When arrays in a given dialect are defined as "),a("code",[t._v("ARRAY")]),t._v(", "),a("code",[t._v("T[]")]),t._v(", or similarly, Ontop is able to infer the data type of the output column after flattening. However, when this is not the case (either the array was provided as JSON or the array data type of the dialect is simply called "),a("code",[t._v("ARRAY")]),t._v(" or similarly), Ontop cannot perform this inference. In those cases, it is suggested to put a basic lens over the flatten lens that explicitly performs a "),a("code",[t._v("CAST")]),t._v(" on the output, to allow Ontop to know the column type once again.")])]),t._v(" "),a("div",{staticClass:"custom-block warning"},[a("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),a("p",[t._v("The level of support for the flatten lens depends strongly on the dialect. Please consult the "),a("RouterLink",{attrs:{to:"/guide/advanced/lenses.html"}},[t._v("flatten lens documentation page")]),t._v(" for more info on each supported dialect.")],1)])])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/90.19ee6bbc.js b/assets/js/90.ebfcdd76.js similarity index 99% rename from assets/js/90.19ee6bbc.js rename to assets/js/90.ebfcdd76.js index 6a9410d8d..4f6ddc1a0 100644 --- a/assets/js/90.19ee6bbc.js +++ b/assets/js/90.ebfcdd76.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[90],{468:function(t,s,a){"use strict";a.r(s);var n=a(51),e=Object(n.a)({},(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"join-lens"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#join-lens"}},[t._v("#")]),t._v(" Join Lens")]),t._v(" "),a("p",[t._v("Join lenses can be used to combine multiple relations into one. Additionally, a filter expression can be provided as a join condition.")]),t._v(" "),a("p",[t._v("For this example, we will look at the tables "),a("code",[t._v("museums")]),t._v(" and "),a("code",[t._v("workers")]),t._v(" from the DuckDB database. For each individual of the "),a("code",[t._v(":Worker")]),t._v(" class, we want to set its property "),a("code",[t._v(":workAddress")]),t._v(" to the address of the museum they work at.\nThe tables have the following schemas:")]),t._v(" "),a("p",[a("em",[t._v("museums")])]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("column")]),t._v(" "),a("th",[t._v("type")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("museum_id")]),t._v(" "),a("td",[t._v("integer")])]),t._v(" "),a("tr",[a("td",[t._v("name")]),t._v(" "),a("td",[t._v("string")])]),t._v(" "),a("tr",[a("td",[t._v("address")]),t._v(" "),a("td",[t._v("string")])]),t._v(" "),a("tr",[a("td",[t._v("yearly_income")]),t._v(" "),a("td",[t._v("integer")])]),t._v(" "),a("tr",[a("td",[t._v("yearly_spendings")]),t._v(" "),a("td",[t._v("integer")])]),t._v(" "),a("tr",[a("td",[t._v("ratings")]),t._v(" "),a("td",[t._v("array of floats")])])])]),t._v(" "),a("p",[a("em",[t._v("workers")])]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("column")]),t._v(" "),a("th",[t._v("type")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("worker_id")]),t._v(" "),a("td",[t._v("integer")])]),t._v(" "),a("tr",[a("td",[t._v("full_name")]),t._v(" "),a("td",[t._v("string")])]),t._v(" "),a("tr",[a("td",[t._v("role")]),t._v(" "),a("td",[t._v("string")])]),t._v(" "),a("tr",[a("td",[t._v("museum_id")]),t._v(" "),a("td",[t._v("integer")])]),t._v(" "),a("tr",[a("td",[t._v("titles")]),t._v(" "),a("td",[t._v("array of strings")])]),t._v(" "),a("tr",[a("td",[t._v("access_level")]),t._v(" "),a("td",[t._v("integer")])])])]),t._v(" "),a("p",[t._v("Notably, the table "),a("code",[t._v("workers")]),t._v(" has the column "),a("code",[t._v("museum_id")]),t._v(" which references the primary key of the table "),a("code",[t._v("museums")]),t._v(". In SQL, we can run a "),a("code",[t._v("JOIN")]),t._v(" query over these two tables to combine all rows of "),a("code",[t._v("worker")]),t._v(" with their corresponding museums. In Ontop, we can instead create a join lens, that can be referenced by the mapping.")]),t._v(" "),a("p",[t._v("The join lens has the following structure:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"join"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"relations"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"columnPrefixes"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"columns"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"added"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"expression"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hidden"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"filterExpression"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"JoinLens"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("The "),a("code",[t._v("join")]),t._v(" field takes an object consisting of a list of relation references and a list of "),a("em",[t._v("column prefixes")]),t._v(". For each relation, its corresponding column prefix will be prepended to the names of all of its columns.")]),t._v(" "),a("p",[t._v("The fields "),a("code",[t._v("columns")]),t._v(" and "),a("code",[t._v("filterExpression")]),t._v(" work exactly the way they worked for "),a("RouterLink",{attrs:{to:"/tutorial/lenses/basic-lens.html"}},[t._v("basic lenses")]),t._v(", with the only reference being that now, column names have to be combined with the individual relation's prefix when referencing them in expressions.")],1),t._v(" "),a("p",[t._v("In this example, the relations we use are "),a("code",[t._v("museums")]),t._v(" and "),a("code",[t._v("workers")]),t._v(", and we choose the prefixes "),a("code",[t._v("m_")]),t._v(" and "),a("code",[t._v("w_")]),t._v(" for them respectively. Since we want to perform a "),a("code",[t._v("JOIN")]),t._v(" operation, rather than a cross-product, we also have to supply the filter expression "),a("code",[t._v("m_museum_id = w_museum_id")]),t._v(". After including these values, the "),a("code",[t._v("lenses.json")]),t._v(" file should look like this:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"relations"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"lenses"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"museums_workers"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"join"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"relations"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"museums"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"workers"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"columnPrefixes"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"m_"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"w_"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"columns"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" ..."),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"filterExpression"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"m_museum_id = w_museum_id"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"JoinLens"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("The only remaining field is "),a("code",[t._v("columns")]),t._v(". As mentioned earlier, this field is handled analogously to the basic lens "),a("code",[t._v("columns")]),t._v(" field, allowing the user to add and remove specific columns. For this example, we want to set the property "),a("code",[t._v(":workAddress")]),t._v(" for each "),a("code",[t._v(":Worker")]),t._v(" individual. Because of that, we only require the column "),a("code",[t._v("worker_id")]),t._v(" from "),a("code",[t._v("workers")]),t._v(" and "),a("code",[t._v("address")]),t._v(" from "),a("code",[t._v("museums")]),t._v(" - all other columns can be hidden, and no column has to be added:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"relations"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"lenses"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"museum_workers"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"join"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"relations"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"museums"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"workers"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"columnPrefixes"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"m_"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"w_"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"columns"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"added"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hidden"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"m_museum_id"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"m_name"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"m_yearly_income"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"m_yearly_spendings"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"m_ratings"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"w_full_name"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"w_role"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"w_museum_id"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"w_titles"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"w_access_level"')]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"filterExpression"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"m_museum_id = w_museum_id"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"JoinLens"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h3",{attrs:{id:"mapping"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#mapping"}},[t._v("#")]),t._v(" Mapping")]),t._v(" "),a("p",[t._v("Now that the lens file is created, we can construct our mapping. For this, we once again start from the mapping template file provided with the tutorial files.")]),t._v(" "),a("p",[t._v("We can add a mapping entry to it, referencing the newly created lens.")]),t._v(" "),a("div",{staticClass:"language-obda extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("mappingId\tMAPID-museum-worker-address\ntarget\t\tdata:worker/{w_worker_id} :workAddress {m_address} .\nsource\t\tSELECT w_worker_id, m_address FROM lenses.museum_workers;\n")])])]),a("p",[t._v("Now, we can test the lens and mapping, by copying the corresponding files to the Ontop endpoint directory and running the following query:")]),t._v(" "),a("div",{staticClass:"language-SPARQL extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sparql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("PREFIX")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token url"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("http://example.org/museum_kg/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("SELECT")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?name")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?address")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("WHERE")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?worker")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("a")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("Worker")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?worker")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("name")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?name")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?worker")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("workAddress")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?address")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("If everything was prepared correctly, this should result in a list of employee names, together with the address of the museum they work at.")])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[90],{467:function(t,s,a){"use strict";a.r(s);var n=a(51),e=Object(n.a)({},(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"join-lens"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#join-lens"}},[t._v("#")]),t._v(" Join Lens")]),t._v(" "),a("p",[t._v("Join lenses can be used to combine multiple relations into one. Additionally, a filter expression can be provided as a join condition.")]),t._v(" "),a("p",[t._v("For this example, we will look at the tables "),a("code",[t._v("museums")]),t._v(" and "),a("code",[t._v("workers")]),t._v(" from the DuckDB database. For each individual of the "),a("code",[t._v(":Worker")]),t._v(" class, we want to set its property "),a("code",[t._v(":workAddress")]),t._v(" to the address of the museum they work at.\nThe tables have the following schemas:")]),t._v(" "),a("p",[a("em",[t._v("museums")])]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("column")]),t._v(" "),a("th",[t._v("type")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("museum_id")]),t._v(" "),a("td",[t._v("integer")])]),t._v(" "),a("tr",[a("td",[t._v("name")]),t._v(" "),a("td",[t._v("string")])]),t._v(" "),a("tr",[a("td",[t._v("address")]),t._v(" "),a("td",[t._v("string")])]),t._v(" "),a("tr",[a("td",[t._v("yearly_income")]),t._v(" "),a("td",[t._v("integer")])]),t._v(" "),a("tr",[a("td",[t._v("yearly_spendings")]),t._v(" "),a("td",[t._v("integer")])]),t._v(" "),a("tr",[a("td",[t._v("ratings")]),t._v(" "),a("td",[t._v("array of floats")])])])]),t._v(" "),a("p",[a("em",[t._v("workers")])]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("column")]),t._v(" "),a("th",[t._v("type")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("worker_id")]),t._v(" "),a("td",[t._v("integer")])]),t._v(" "),a("tr",[a("td",[t._v("full_name")]),t._v(" "),a("td",[t._v("string")])]),t._v(" "),a("tr",[a("td",[t._v("role")]),t._v(" "),a("td",[t._v("string")])]),t._v(" "),a("tr",[a("td",[t._v("museum_id")]),t._v(" "),a("td",[t._v("integer")])]),t._v(" "),a("tr",[a("td",[t._v("titles")]),t._v(" "),a("td",[t._v("array of strings")])]),t._v(" "),a("tr",[a("td",[t._v("access_level")]),t._v(" "),a("td",[t._v("integer")])])])]),t._v(" "),a("p",[t._v("Notably, the table "),a("code",[t._v("workers")]),t._v(" has the column "),a("code",[t._v("museum_id")]),t._v(" which references the primary key of the table "),a("code",[t._v("museums")]),t._v(". In SQL, we can run a "),a("code",[t._v("JOIN")]),t._v(" query over these two tables to combine all rows of "),a("code",[t._v("worker")]),t._v(" with their corresponding museums. In Ontop, we can instead create a join lens, that can be referenced by the mapping.")]),t._v(" "),a("p",[t._v("The join lens has the following structure:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"join"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"relations"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"columnPrefixes"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"columns"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"added"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"expression"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hidden"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"filterExpression"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"JoinLens"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("The "),a("code",[t._v("join")]),t._v(" field takes an object consisting of a list of relation references and a list of "),a("em",[t._v("column prefixes")]),t._v(". For each relation, its corresponding column prefix will be prepended to the names of all of its columns.")]),t._v(" "),a("p",[t._v("The fields "),a("code",[t._v("columns")]),t._v(" and "),a("code",[t._v("filterExpression")]),t._v(" work exactly the way they worked for "),a("RouterLink",{attrs:{to:"/tutorial/lenses/basic-lens.html"}},[t._v("basic lenses")]),t._v(", with the only reference being that now, column names have to be combined with the individual relation's prefix when referencing them in expressions.")],1),t._v(" "),a("p",[t._v("In this example, the relations we use are "),a("code",[t._v("museums")]),t._v(" and "),a("code",[t._v("workers")]),t._v(", and we choose the prefixes "),a("code",[t._v("m_")]),t._v(" and "),a("code",[t._v("w_")]),t._v(" for them respectively. Since we want to perform a "),a("code",[t._v("JOIN")]),t._v(" operation, rather than a cross-product, we also have to supply the filter expression "),a("code",[t._v("m_museum_id = w_museum_id")]),t._v(". After including these values, the "),a("code",[t._v("lenses.json")]),t._v(" file should look like this:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"relations"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"lenses"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"museums_workers"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"join"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"relations"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"museums"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"workers"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"columnPrefixes"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"m_"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"w_"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"columns"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" ..."),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"filterExpression"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"m_museum_id = w_museum_id"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"JoinLens"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("The only remaining field is "),a("code",[t._v("columns")]),t._v(". As mentioned earlier, this field is handled analogously to the basic lens "),a("code",[t._v("columns")]),t._v(" field, allowing the user to add and remove specific columns. For this example, we want to set the property "),a("code",[t._v(":workAddress")]),t._v(" for each "),a("code",[t._v(":Worker")]),t._v(" individual. Because of that, we only require the column "),a("code",[t._v("worker_id")]),t._v(" from "),a("code",[t._v("workers")]),t._v(" and "),a("code",[t._v("address")]),t._v(" from "),a("code",[t._v("museums")]),t._v(" - all other columns can be hidden, and no column has to be added:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"relations"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"lenses"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"museum_workers"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"join"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"relations"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"museums"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"workers"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"columnPrefixes"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"m_"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"w_"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"columns"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"added"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hidden"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"m_museum_id"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"m_name"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"m_yearly_income"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"m_yearly_spendings"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"m_ratings"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"w_full_name"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"w_role"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"w_museum_id"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"w_titles"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"w_access_level"')]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"filterExpression"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"m_museum_id = w_museum_id"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"JoinLens"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h3",{attrs:{id:"mapping"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#mapping"}},[t._v("#")]),t._v(" Mapping")]),t._v(" "),a("p",[t._v("Now that the lens file is created, we can construct our mapping. For this, we once again start from the mapping template file provided with the tutorial files.")]),t._v(" "),a("p",[t._v("We can add a mapping entry to it, referencing the newly created lens.")]),t._v(" "),a("div",{staticClass:"language-obda extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("mappingId\tMAPID-museum-worker-address\ntarget\t\tdata:worker/{w_worker_id} :workAddress {m_address} .\nsource\t\tSELECT w_worker_id, m_address FROM lenses.museum_workers;\n")])])]),a("p",[t._v("Now, we can test the lens and mapping, by copying the corresponding files to the Ontop endpoint directory and running the following query:")]),t._v(" "),a("div",{staticClass:"language-SPARQL extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sparql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("PREFIX")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token url"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("http://example.org/museum_kg/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("SELECT")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?name")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?address")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("WHERE")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?worker")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("a")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("Worker")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?worker")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("name")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?name")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?worker")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("workAddress")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?address")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("If everything was prepared correctly, this should result in a list of employee names, together with the address of the museum they work at.")])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/91.648b844a.js b/assets/js/91.7445e6fd.js similarity index 99% rename from assets/js/91.648b844a.js rename to assets/js/91.7445e6fd.js index 21ccdcfc2..fd114a5c5 100644 --- a/assets/js/91.648b844a.js +++ b/assets/js/91.7445e6fd.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[91],{467:function(t,e,a){"use strict";a.r(e);var s=a(51),n=Object(s.a)({},(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"database-and-ontop-setup"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#database-and-ontop-setup"}},[t._v("#")]),t._v(" Database and Ontop Setup")]),t._v(" "),a("p",[t._v("In this tutorial, we run a "),a("a",{attrs:{href:"duckdb.org"}},[a("em",[t._v("DuckDB")])]),t._v(" database of museums that includes information about the museums themselves, their employees and their exhibits.")]),t._v(" "),a("h2",{attrs:{id:"database-setup"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#database-setup"}},[t._v("#")]),t._v(" Database setup")]),t._v(" "),a("p",[t._v("Procedure to set up the datebase for the following exercises:")]),t._v(" "),a("ol",[a("li",[t._v("Unzip the archive of DuckDB "),a("a",{attrs:{href:"../duckdb.zip"}},[a("em",[t._v("(duckdb.zip)")])]),t._v(".")]),t._v(" "),a("li",[t._v("That's it! The "),a("em",[t._v("data")]),t._v(" directory contains the already prepared databases, compatible with "),a("em",[t._v("DuckDB version 0.7.1")]),t._v(".\n"),a("ul",[a("li",[t._v("If you want to have a first look at the database, you can open it with the DuckDB client application that can be downloaded from the "),a("a",{attrs:{href:"https://duckdb.org/#quickinstall",target:"_blank",rel:"noopener"}},[t._v("official site"),a("OutboundLink")],1),t._v(".")])])])]),t._v(" "),a("h2",{attrs:{id:"ontop-sparql-endpoint-setup"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#ontop-sparql-endpoint-setup"}},[t._v("#")]),t._v(" Ontop SPARQL endpoint setup")]),t._v(" "),a("p",[t._v("For this tutorial, we use a SPARQL endpoint provided by ontop to test our mappings and lenses. Here, we walk through the preparation of the endpoint via "),a("em",[t._v("Ontop CLI")]),t._v(", but a docker-image-based endpoint can be created in a similar fashion, as explained in the "),a("RouterLink",{attrs:{to:"/tutorial/endpoint/endpoint-docker.html"}},[t._v("endpoint tutorial")]),t._v(".")],1),t._v(" "),a("ol",[a("li",[t._v("Download "),a("a",{attrs:{href:"https://github.com/ontop/ontop/releases",target:"_blank",rel:"noopener"}},[t._v("Ontop CLI"),a("OutboundLink")],1),t._v(" and unzip it to a directory, which is denoted as "),a("code",[t._v("$ONTOP_CLI_DIR")]),t._v(" below.")]),t._v(" "),a("li",[t._v("Copy the DuckDB jdbc driver to "),a("code",[t._v("$ONTOP_CLI_DIR/jdbc")]),t._v(" from the "),a("em",[t._v("duckdb.zip")]),t._v(" archive.")]),t._v(" "),a("li",[t._v("Copy the directory "),a("code",[t._v("data")]),t._v(" containing the database file "),a("code",[t._v("data/tutorial.db")]),t._v(" into "),a("code",[t._v("$ONTOP_CLI_DIR")]),t._v(".")]),t._v(" "),a("li",[t._v("Paste your "),a("em",[t._v("mapping")]),t._v(" and "),a("em",[t._v("lenses")]),t._v(" files, as well as the "),a("em",[t._v("ontology")]),t._v(" and "),a("em",[t._v("properties")]),t._v(" files into a new directory called "),a("code",[t._v("input")]),t._v(" inside of "),a("code",[t._v("$ONTOP_CLI")]),t._v(".\n"),a("ul",[a("li",[t._v("You will create the "),a("em",[t._v("mapping")]),t._v(" and "),a("em",[t._v("lenses")]),t._v(" files throughout the course of this tutorial. Alternatively, the "),a("em",[t._v("duckdb.zip")]),t._v(" archive contains one directory for each of the lens tutorials, with sample mappings and lenses already pre-made.")]),t._v(" "),a("li",[t._v("The "),a("em",[t._v("ontology")]),t._v(" and "),a("em",[t._v("properties")]),t._v(" files will be the same throughout all tutorials. They are already provided in the "),a("em",[t._v("duckdb.zip")]),t._v(" archive.")])])]),t._v(" "),a("li",[t._v("Start the Ontop endpoint. On Mac/Linux:")])]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$ONTOP_CLI_DIR")]),t._v("/ontop endpoint "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("\n --ontology"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("input/ontology.ttl "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("\n --mapping"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("input/mapping.obda "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("\n --lenses"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("input/lenses.json "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("\n --properties"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("input/duckdb.properties "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("\n --cors-allowed-origins"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("http://yasgui.org "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# if needed")]),t._v("\n")])])]),a("p",[t._v("On Windows:")]),t._v(" "),a("div",{staticClass:"language-batch extra-class"},[a("pre",{pre:!0,attrs:{class:"language-batch"}},[a("code",[a("span",{pre:!0,attrs:{class:"token command"}},[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("ontop")]),t._v(" endpoint "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("^")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token parameter attr-name"}},[t._v("--ontology")]),t._v("=input/ontology.ttl "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("^")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token parameter attr-name"}},[t._v("--mapping")]),t._v("=input/mapping.obda "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("^")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token parameter attr-name"}},[t._v("--lenses")]),t._v("=input/lenses.json "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("^")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token parameter attr-name"}},[t._v("--properties")]),t._v("=input/duckdb.properties "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("^")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token parameter attr-name"}},[t._v("--cors-allowed-origins")]),t._v("=http://yasgui.org ")]),t._v("\n")])])]),a("ol",{attrs:{start:"6"}},[a("li",[t._v("Open the web interface of the SPARQL endpoint to try some queries:\n"),a("a",{attrs:{href:"http://localhost:8080/",target:"_blank",rel:"noopener"}},[t._v("http://localhost:8080/"),a("OutboundLink")],1)])])])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[91],{469:function(t,e,a){"use strict";a.r(e);var s=a(51),n=Object(s.a)({},(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"database-and-ontop-setup"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#database-and-ontop-setup"}},[t._v("#")]),t._v(" Database and Ontop Setup")]),t._v(" "),a("p",[t._v("In this tutorial, we run a "),a("a",{attrs:{href:"duckdb.org"}},[a("em",[t._v("DuckDB")])]),t._v(" database of museums that includes information about the museums themselves, their employees and their exhibits.")]),t._v(" "),a("h2",{attrs:{id:"database-setup"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#database-setup"}},[t._v("#")]),t._v(" Database setup")]),t._v(" "),a("p",[t._v("Procedure to set up the datebase for the following exercises:")]),t._v(" "),a("ol",[a("li",[t._v("Unzip the archive of DuckDB "),a("a",{attrs:{href:"../duckdb.zip"}},[a("em",[t._v("(duckdb.zip)")])]),t._v(".")]),t._v(" "),a("li",[t._v("That's it! The "),a("em",[t._v("data")]),t._v(" directory contains the already prepared databases, compatible with "),a("em",[t._v("DuckDB version 0.7.1")]),t._v(".\n"),a("ul",[a("li",[t._v("If you want to have a first look at the database, you can open it with the DuckDB client application that can be downloaded from the "),a("a",{attrs:{href:"https://duckdb.org/#quickinstall",target:"_blank",rel:"noopener"}},[t._v("official site"),a("OutboundLink")],1),t._v(".")])])])]),t._v(" "),a("h2",{attrs:{id:"ontop-sparql-endpoint-setup"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#ontop-sparql-endpoint-setup"}},[t._v("#")]),t._v(" Ontop SPARQL endpoint setup")]),t._v(" "),a("p",[t._v("For this tutorial, we use a SPARQL endpoint provided by ontop to test our mappings and lenses. Here, we walk through the preparation of the endpoint via "),a("em",[t._v("Ontop CLI")]),t._v(", but a docker-image-based endpoint can be created in a similar fashion, as explained in the "),a("RouterLink",{attrs:{to:"/tutorial/endpoint/endpoint-docker.html"}},[t._v("endpoint tutorial")]),t._v(".")],1),t._v(" "),a("ol",[a("li",[t._v("Download "),a("a",{attrs:{href:"https://github.com/ontop/ontop/releases",target:"_blank",rel:"noopener"}},[t._v("Ontop CLI"),a("OutboundLink")],1),t._v(" and unzip it to a directory, which is denoted as "),a("code",[t._v("$ONTOP_CLI_DIR")]),t._v(" below.")]),t._v(" "),a("li",[t._v("Copy the DuckDB jdbc driver to "),a("code",[t._v("$ONTOP_CLI_DIR/jdbc")]),t._v(" from the "),a("em",[t._v("duckdb.zip")]),t._v(" archive.")]),t._v(" "),a("li",[t._v("Copy the directory "),a("code",[t._v("data")]),t._v(" containing the database file "),a("code",[t._v("data/tutorial.db")]),t._v(" into "),a("code",[t._v("$ONTOP_CLI_DIR")]),t._v(".")]),t._v(" "),a("li",[t._v("Paste your "),a("em",[t._v("mapping")]),t._v(" and "),a("em",[t._v("lenses")]),t._v(" files, as well as the "),a("em",[t._v("ontology")]),t._v(" and "),a("em",[t._v("properties")]),t._v(" files into a new directory called "),a("code",[t._v("input")]),t._v(" inside of "),a("code",[t._v("$ONTOP_CLI")]),t._v(".\n"),a("ul",[a("li",[t._v("You will create the "),a("em",[t._v("mapping")]),t._v(" and "),a("em",[t._v("lenses")]),t._v(" files throughout the course of this tutorial. Alternatively, the "),a("em",[t._v("duckdb.zip")]),t._v(" archive contains one directory for each of the lens tutorials, with sample mappings and lenses already pre-made.")]),t._v(" "),a("li",[t._v("The "),a("em",[t._v("ontology")]),t._v(" and "),a("em",[t._v("properties")]),t._v(" files will be the same throughout all tutorials. They are already provided in the "),a("em",[t._v("duckdb.zip")]),t._v(" archive.")])])]),t._v(" "),a("li",[t._v("Start the Ontop endpoint. On Mac/Linux:")])]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$ONTOP_CLI_DIR")]),t._v("/ontop endpoint "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("\n --ontology"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("input/ontology.ttl "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("\n --mapping"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("input/mapping.obda "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("\n --lenses"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("input/lenses.json "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("\n --properties"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("input/duckdb.properties "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("\n --cors-allowed-origins"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("http://yasgui.org "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# if needed")]),t._v("\n")])])]),a("p",[t._v("On Windows:")]),t._v(" "),a("div",{staticClass:"language-batch extra-class"},[a("pre",{pre:!0,attrs:{class:"language-batch"}},[a("code",[a("span",{pre:!0,attrs:{class:"token command"}},[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("ontop")]),t._v(" endpoint "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("^")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token parameter attr-name"}},[t._v("--ontology")]),t._v("=input/ontology.ttl "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("^")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token parameter attr-name"}},[t._v("--mapping")]),t._v("=input/mapping.obda "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("^")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token parameter attr-name"}},[t._v("--lenses")]),t._v("=input/lenses.json "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("^")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token parameter attr-name"}},[t._v("--properties")]),t._v("=input/duckdb.properties "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("^")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token parameter attr-name"}},[t._v("--cors-allowed-origins")]),t._v("=http://yasgui.org ")]),t._v("\n")])])]),a("ol",{attrs:{start:"6"}},[a("li",[t._v("Open the web interface of the SPARQL endpoint to try some queries:\n"),a("a",{attrs:{href:"http://localhost:8080/",target:"_blank",rel:"noopener"}},[t._v("http://localhost:8080/"),a("OutboundLink")],1)])])])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/92.31c648c7.js b/assets/js/92.6712858d.js similarity index 99% rename from assets/js/92.31c648c7.js rename to assets/js/92.6712858d.js index 876b726ec..f6e901b6f 100644 --- a/assets/js/92.31c648c7.js +++ b/assets/js/92.6712858d.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[92],{471:function(t,s,a){"use strict";a.r(s);var e=a(51),n=Object(e.a)({},(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"sql-lens"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#sql-lens"}},[t._v("#")]),t._v(" SQL Lens")]),t._v(" "),a("p",[t._v("SQL lenses are a special type of lens that can generate virtual views over any number of base relations through an arbitrary SQL query. While this allows for more flexibility, as any SQL functionalities can be used by this lens, it risks to obfuscate the inner workings towards Ontop as it may not be handled by the Ontop's SQL parser, preventing it from performing any meaningful inference and optimization.")]),t._v(" "),a("p",[t._v("One major use case for SQL lenses is to perform complex operations that are currently not supported by other Ontop lenses. For this example, we will look at the table "),a("code",[t._v("art_exhibits")]),t._v(". This table has the following schema:")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("column")]),t._v(" "),a("th",[t._v("type")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("exhibit_id")]),t._v(" "),a("td",[t._v("integer")])]),t._v(" "),a("tr",[a("td",[t._v("name")]),t._v(" "),a("td",[t._v("string")])]),t._v(" "),a("tr",[a("td",[t._v("artist_name")]),t._v(" "),a("td",[t._v("string")])]),t._v(" "),a("tr",[a("td",[t._v("museum_id")]),t._v(" "),a("td",[t._v("integer")])])])]),t._v(" "),a("p",[t._v("We now want to gather more information on artists. Including how many exhibits they created and in how many museums their works appear. In SQL, this can be achieved easily by running aggregate functions on a "),a("code",[t._v("GROUP BY")]),t._v(" query, but there is no corresponding lens for aggregate functions in Ontop. We, therefore, have to take advantage of the SQL lens.")]),t._v(" "),a("p",[t._v("This lens has the following structure:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"query"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"SQLLens"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("Here, the "),a("code",[t._v("query")]),t._v(" field is a single SQL query that projects all attributes that are of interest to us. In our example, we want to group all artists' names and count their number of exhibits and "),a("strong",[t._v("distinct")]),t._v(" museums. A corresponding SQL lens could look like this:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"lenses"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"artists"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"query"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"SELECT artist_name, COUNT(exhibit_id) as exhibits, COUNT(DISTINCT museum_id) as museums FROM art_exhibits GROUP BY artist_name"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"SQLLens"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("This will now create a virtual relation inside Ontop, that has the columns "),a("code",[t._v("artist_name")]),t._v(", "),a("code",[t._v("exhibits")]),t._v(", and "),a("code",[t._v("museums")]),t._v(".")]),t._v(" "),a("h3",{attrs:{id:"mapping"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#mapping"}},[t._v("#")]),t._v(" Mapping")]),t._v(" "),a("p",[t._v("Finally, we just need to create a mapping entry for the artist, extending our mapping template:")]),t._v(" "),a("div",{staticClass:"language-obda extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("mappingId\tMAPID-artists\ntarget\t\tdata:artist/{artist_name} a :Artist ; :name {artist_name}^^xsd:string ; :exhibitCount {exhibits}^^xsd:integer ; :museumCount {museums}^^xsd:integer.\nsource\t\tSELECT artist_name, exhibits, museums FROM lenses.artists;\n")])])]),a("div",{staticClass:"custom-block tip"},[a("p",{staticClass:"custom-block-title"},[t._v("NOTE")]),t._v(" "),a("p",[t._v("In the "),a("code",[t._v("target")]),t._v(" clause of the mapping, our datatype properties have to be marked by their individual types. This is because Ontop can no longer infer the types of the columns we are using, as they are obfuscated by the SQL lens.")])]),t._v(" "),a("p",[t._v("To test our lenses and mapping, let us run the Ontop endpoint, copying the "),a("code",[t._v("lenses.json")]),t._v(" and "),a("code",[t._v("mapping.obda")]),t._v(" files into the endpoint's directory.\nThen, we can run the following SPARQL query:")]),t._v(" "),a("div",{staticClass:"language-SPARQL extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sparql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("PREFIX")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token url"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("http://example.org/museum_kg/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("SELECT")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?name")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?exhibits")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?museums")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("WHERE")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?artist")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("a")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("Artist")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?artist")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("name")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?name")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?artist")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("exhibitCount")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?exhibits")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?artist")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("museumCount")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?museums")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("If everything was done correctly, you should get a list of three artists with the number of their exhibits and the number of museums they are featured in.")]),t._v(" "),a("h3",{attrs:{id:"adding-unique-constraints"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#adding-unique-constraints"}},[t._v("#")]),t._v(" Adding Unique Constraints")]),t._v(" "),a("p",[t._v("Ontop cannot infer unique constraints from the expressions used in SQL lenses. However, as the user, it is clear to us that the field "),a("code",[t._v("artist_name")]),t._v(" will be "),a("em",[t._v("unique")]),t._v(", as it is used by the "),a("code",[t._v("GROUP BY")]),t._v(" clause. In such cases, explicitly adding unique constraints is a useful feature. Similarly to how it was shown in the "),a("RouterLink",{attrs:{to:"/tutorial/lenses/basic-lens.html"}},[t._v("basic lens section")]),t._v(", we can achieve this by adding an additional field to the lens:")],1),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"relations"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"lenses"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"artists"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"query"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"SELECT artist_name, COUNT(exhibit_id) as exhibits, COUNT(DISTINCT museum_id) as museums FROM art_exhibits GROUP BY artist_name"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"SQLLens"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"uniqueConstraints"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"added"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"uc"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"determinants"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"artist_name"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("While this will not change the output of the sample query, it may help Ontop optimize its queries in specific instances (see "),a("RouterLink",{attrs:{to:"/tutorial/mapping/primary-keys.html"}},[t._v("primary key")]),t._v(").")],1),t._v(" "),a("div",{staticClass:"custom-block warning"},[a("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),a("p",[t._v("It is advised to be cautious when using SQL lenses. Generally, they should not refer to other lenses if the SQL expression is complex, and they may not be able to infer integrity constraints. For more information, please visit the "),a("RouterLink",{attrs:{to:"/guide/advanced/lenses.html"}},[t._v("documentation page of lenses")]),t._v(".")],1)])])}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[92],{468:function(t,s,a){"use strict";a.r(s);var e=a(51),n=Object(e.a)({},(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"sql-lens"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#sql-lens"}},[t._v("#")]),t._v(" SQL Lens")]),t._v(" "),a("p",[t._v("SQL lenses are a special type of lens that can generate virtual views over any number of base relations through an arbitrary SQL query. While this allows for more flexibility, as any SQL functionalities can be used by this lens, it risks to obfuscate the inner workings towards Ontop as it may not be handled by the Ontop's SQL parser, preventing it from performing any meaningful inference and optimization.")]),t._v(" "),a("p",[t._v("One major use case for SQL lenses is to perform complex operations that are currently not supported by other Ontop lenses. For this example, we will look at the table "),a("code",[t._v("art_exhibits")]),t._v(". This table has the following schema:")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("column")]),t._v(" "),a("th",[t._v("type")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("exhibit_id")]),t._v(" "),a("td",[t._v("integer")])]),t._v(" "),a("tr",[a("td",[t._v("name")]),t._v(" "),a("td",[t._v("string")])]),t._v(" "),a("tr",[a("td",[t._v("artist_name")]),t._v(" "),a("td",[t._v("string")])]),t._v(" "),a("tr",[a("td",[t._v("museum_id")]),t._v(" "),a("td",[t._v("integer")])])])]),t._v(" "),a("p",[t._v("We now want to gather more information on artists. Including how many exhibits they created and in how many museums their works appear. In SQL, this can be achieved easily by running aggregate functions on a "),a("code",[t._v("GROUP BY")]),t._v(" query, but there is no corresponding lens for aggregate functions in Ontop. We, therefore, have to take advantage of the SQL lens.")]),t._v(" "),a("p",[t._v("This lens has the following structure:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"query"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"SQLLens"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("Here, the "),a("code",[t._v("query")]),t._v(" field is a single SQL query that projects all attributes that are of interest to us. In our example, we want to group all artists' names and count their number of exhibits and "),a("strong",[t._v("distinct")]),t._v(" museums. A corresponding SQL lens could look like this:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"lenses"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"artists"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"query"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"SELECT artist_name, COUNT(exhibit_id) as exhibits, COUNT(DISTINCT museum_id) as museums FROM art_exhibits GROUP BY artist_name"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"SQLLens"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("This will now create a virtual relation inside Ontop, that has the columns "),a("code",[t._v("artist_name")]),t._v(", "),a("code",[t._v("exhibits")]),t._v(", and "),a("code",[t._v("museums")]),t._v(".")]),t._v(" "),a("h3",{attrs:{id:"mapping"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#mapping"}},[t._v("#")]),t._v(" Mapping")]),t._v(" "),a("p",[t._v("Finally, we just need to create a mapping entry for the artist, extending our mapping template:")]),t._v(" "),a("div",{staticClass:"language-obda extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("mappingId\tMAPID-artists\ntarget\t\tdata:artist/{artist_name} a :Artist ; :name {artist_name}^^xsd:string ; :exhibitCount {exhibits}^^xsd:integer ; :museumCount {museums}^^xsd:integer.\nsource\t\tSELECT artist_name, exhibits, museums FROM lenses.artists;\n")])])]),a("div",{staticClass:"custom-block tip"},[a("p",{staticClass:"custom-block-title"},[t._v("NOTE")]),t._v(" "),a("p",[t._v("In the "),a("code",[t._v("target")]),t._v(" clause of the mapping, our datatype properties have to be marked by their individual types. This is because Ontop can no longer infer the types of the columns we are using, as they are obfuscated by the SQL lens.")])]),t._v(" "),a("p",[t._v("To test our lenses and mapping, let us run the Ontop endpoint, copying the "),a("code",[t._v("lenses.json")]),t._v(" and "),a("code",[t._v("mapping.obda")]),t._v(" files into the endpoint's directory.\nThen, we can run the following SPARQL query:")]),t._v(" "),a("div",{staticClass:"language-SPARQL extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sparql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("PREFIX")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token url"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("http://example.org/museum_kg/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("SELECT")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?name")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?exhibits")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?museums")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("WHERE")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?artist")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("a")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("Artist")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?artist")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("name")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?name")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?artist")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("exhibitCount")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?exhibits")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?artist")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("museumCount")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?museums")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("If everything was done correctly, you should get a list of three artists with the number of their exhibits and the number of museums they are featured in.")]),t._v(" "),a("h3",{attrs:{id:"adding-unique-constraints"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#adding-unique-constraints"}},[t._v("#")]),t._v(" Adding Unique Constraints")]),t._v(" "),a("p",[t._v("Ontop cannot infer unique constraints from the expressions used in SQL lenses. However, as the user, it is clear to us that the field "),a("code",[t._v("artist_name")]),t._v(" will be "),a("em",[t._v("unique")]),t._v(", as it is used by the "),a("code",[t._v("GROUP BY")]),t._v(" clause. In such cases, explicitly adding unique constraints is a useful feature. Similarly to how it was shown in the "),a("RouterLink",{attrs:{to:"/tutorial/lenses/basic-lens.html"}},[t._v("basic lens section")]),t._v(", we can achieve this by adding an additional field to the lens:")],1),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"relations"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"lenses"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"artists"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"query"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"SELECT artist_name, COUNT(exhibit_id) as exhibits, COUNT(DISTINCT museum_id) as museums FROM art_exhibits GROUP BY artist_name"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"SQLLens"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"uniqueConstraints"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"added"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"uc"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"determinants"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"artist_name"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("While this will not change the output of the sample query, it may help Ontop optimize its queries in specific instances (see "),a("RouterLink",{attrs:{to:"/tutorial/mapping/primary-keys.html"}},[t._v("primary key")]),t._v(").")],1),t._v(" "),a("div",{staticClass:"custom-block warning"},[a("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),a("p",[t._v("It is advised to be cautious when using SQL lenses. Generally, they should not refer to other lenses if the SQL expression is complex, and they may not be able to infer integrity constraints. For more information, please visit the "),a("RouterLink",{attrs:{to:"/guide/advanced/lenses.html"}},[t._v("documentation page of lenses")]),t._v(".")],1)])])}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/93.54e43d53.js b/assets/js/93.3e2318ba.js similarity index 99% rename from assets/js/93.54e43d53.js rename to assets/js/93.3e2318ba.js index 2010c6e8a..3058f03a2 100644 --- a/assets/js/93.54e43d53.js +++ b/assets/js/93.3e2318ba.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[93],{469:function(t,s,a){"use strict";a.r(s);var e=a(51),n=Object(e.a)({},(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"union-lens"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#union-lens"}},[t._v("#")]),t._v(" Union Lens")]),t._v(" "),a("p",[a("em",[t._v("Union lenses will be supported starting with version 5.1.0 (beta).")])]),t._v(" "),a("p",[t._v("Union lenses can be used to concatenate multiple relations with the same schema into one. Additionally, a "),a("em",[t._v("provenance")]),t._v(" field can be added to each row, determining the source relation the row originates from.")]),t._v(" "),a("p",[t._v("For this example, we will look at the tables "),a("code",[t._v("nature_exhibits")]),t._v(", "),a("code",[t._v("historical_exhibits")]),t._v(" and "),a("code",[t._v("art_exhibits")]),t._v(" from the DuckDB database. We want to combine them into a single relation containing all exhibits.")]),t._v(" "),a("p",[t._v("The tables "),a("code",[t._v("nature_exhibits")]),t._v(" and "),a("code",[t._v("historical_exhibits")]),t._v(" have the following schema:")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("column")]),t._v(" "),a("th",[t._v("type")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("exhibit_id")]),t._v(" "),a("td",[t._v("integer")])]),t._v(" "),a("tr",[a("td",[t._v("name")]),t._v(" "),a("td",[t._v("string")])]),t._v(" "),a("tr",[a("td",[t._v("museum_id")]),t._v(" "),a("td",[t._v("integer")])])])]),t._v(" "),a("p",[t._v("The table "),a("code",[t._v("art_exhibits")]),t._v(" has the following schema:")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("column")]),t._v(" "),a("th",[t._v("type")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("exhibit_id")]),t._v(" "),a("td",[t._v("integer")])]),t._v(" "),a("tr",[a("td",[t._v("name")]),t._v(" "),a("td",[t._v("string")])]),t._v(" "),a("tr",[a("td",[t._v("artist_name")]),t._v(" "),a("td",[t._v("string")])]),t._v(" "),a("tr",[a("td",[t._v("museum_id")]),t._v(" "),a("td",[t._v("integer")])])])]),t._v(" "),a("p",[t._v("For each table, "),a("code",[t._v("exhibit_id")]),t._v(" is a primary key and "),a("code",[t._v("museum_id")]),t._v(" is a foreign key, referencing the table "),a("code",[t._v("museums")]),t._v(".")]),t._v(" "),a("h2",{attrs:{id:"relations-with-the-same-schema"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#relations-with-the-same-schema"}},[t._v("#")]),t._v(" Relations with the same schema")]),t._v(" "),a("p",[t._v("This concatenation can be achieved using a union lens. However, as all base relations of a union lens must have the exact same columns, we will only be working on the tables "),a("code",[t._v("nature_exhibits")]),t._v(" and "),a("code",[t._v("historical_exhibits")]),t._v(" at first.")]),t._v(" "),a("p",[t._v("The union lens has the following structure:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"unionRelations"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"makeDistinct"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" boolean"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"provenanceColumn"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"UnionLens"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("Here, "),a("code",[t._v("unionRelations")]),t._v(" is a list of relations that should be concatenated, "),a("code",[t._v("makeDistinct")]),t._v(" indicates if a distinct constraint should be enforced on the result, and "),a("code",[t._v("provenanceColumn")]),t._v(" is an optional parameter, indicating the name of the provenance column in the result, which tells us what relation each row originated from.")]),t._v(" "),a("p",[t._v("As the tables "),a("code",[t._v("nature_exhibits")]),t._v(" and "),a("code",[t._v("historical_exhibits")]),t._v(" have the same set of columns, we can reference them from a union lens to create a new, concatenated view.")]),t._v(" "),a("div",{staticClass:"custom-block warning"},[a("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),a("p",[t._v("The columns of all tables used by a union lens must be "),a("em",[t._v("exactly")]),t._v(" equal. Their columns must have "),a("em",[t._v("the same names")]),t._v(" and the "),a("strong",[t._v("exact")]),t._v(" "),a("em",[t._v("same data types")]),t._v(". The order of the columns does not matter.")])]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"relations"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"lenses"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"all_exhibits"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"unionRelations"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"historical_exhibits"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nature_exhibits"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"provenanceColumn"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" ..."),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"makeDistinct"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" ..."),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"UnionLens"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("The remaining fields are "),a("code",[t._v("provenanceColumn")]),t._v(" and "),a("code",[t._v("makeDistinct")]),t._v(". As we do not expect the entries of any of the tables to be equal, we can just neglect the "),a("code",[t._v("makeDistinct")]),t._v(" parameter. To preserve the source of each entry, we want to include a provenance column. We can call it "),a("code",[t._v("exhibit_type")]),t._v(". This results in the following "),a("code",[t._v("lenses.json")]),t._v(" file:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"relations"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"lenses"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"all_exhibits"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"unionRelations"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"historical_exhibits"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nature_exhibits"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"provenanceColumn"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"exhibit_type"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"UnionLens"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("div",{staticClass:"custom-block tip"},[a("p",{staticClass:"custom-block-title"},[t._v("NOTE")]),t._v(" "),a("p",[t._v("If the "),a("code",[t._v("provenanceColumn")]),t._v(" field is not provided, then no information on the source relation will be preserved for the concatenated rows. If the field "),a("code",[t._v("makeDistinct")]),t._v(" is not provided, its default value is assumed to be "),a("code",[t._v("false")]),t._v(".")])]),t._v(" "),a("div",{staticClass:"custom-block tip"},[a("p",{staticClass:"custom-block-title"},[t._v("NOTE")]),t._v(" "),a("p",[t._v("Including a "),a("code",[t._v("provenanceColumn")]),t._v(" in a UnionLens where each of the source relations is distinct will render the "),a("code",[t._v("makeDistinct")]),t._v(" field redundant. This is because, under a union, the composite uniqueness constraint "),a("code",[t._v("(provenanceColumns, childUniquenessConstraint)")]),t._v(" will always hold. On the other hand, if no provenance column is included, then uniqueness constraints from the base relations will be lost, as there is no guarantee that a specific value does not appear again in a different table.")])]),t._v(" "),a("h3",{attrs:{id:"mapping"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#mapping"}},[t._v("#")]),t._v(" Mapping")]),t._v(" "),a("p",[t._v("Now, let us use this lens definition in our mapping. Starting from the mapping template file, add the following mapping entry:")]),t._v(" "),a("div",{staticClass:"language-obda extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("mappingId\tMAPID-exhibits\ntarget\t\tdata:exhibit/{exhibit_id} a :Exhibit ; :name {name} ; :displayedIn data:museum/{museum_id} ; :exhibitType {exhibit_type} .\nsource\t\tSELECT exhibit_id, name, museum_id, exhibit_type FROM lenses.all_exhibits;\n")])])]),a("p",[t._v("Starting the Ontop SPARQL endpoint using this mapping and lens file, we can now run the SPARQL query:")]),t._v(" "),a("div",{staticClass:"language-SPARQL extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sparql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("PREFIX")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token url"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("http://example.org/museum_kg/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("SELECT")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?name")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?type")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("WHERE")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?exhibit")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("a")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("Exhibit")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?exhibit")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("name")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?name")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?exhibit")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("exhibitType")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?type")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("This should result in a set of exhibit names that have the values "),a("code",[t._v("historical_exhibits")]),t._v(" and "),a("code",[t._v("nature_exhibits")]),t._v(" as their exhibit type.")]),t._v(" "),a("h2",{attrs:{id:"relations-with-different-schemas"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#relations-with-different-schemas"}},[t._v("#")]),t._v(" Relations with different schemas")]),t._v(" "),a("p",[t._v("If we further want to include the table "),a("code",[t._v("art_exhibits")]),t._v(" to the union lens, we cannot just add it to the list of "),a("code",[t._v("unionRelations")]),t._v(". This is because it has one additional column, "),a("code",[t._v("artist_name")]),t._v(', that does not appear in the other tables.\nTo work around this issue, we can take advantage of basic lenses, putting them "underneath" the union lens, to ensure the equality of columns.')]),t._v(" "),a("p",[t._v("There are two possibilities to achieve this:")]),t._v(" "),a("ol",[a("li",[t._v("Hide the conflicting column(s) from its/their table(s)")]),t._v(" "),a("li",[t._v("Add the conflicting column(s) to the tables that do not include them.")])]),t._v(" "),a("p",[t._v("To retain a maximum of information, we will choose the second approach for this example. That means, that we have to construct basic lenses to add the column "),a("code",[t._v("artist_name")]),t._v(" to the tables "),a("code",[t._v("historical_exhibits")]),t._v(" and "),a("code",[t._v("nature_exhibits")]),t._v(". One possible way to achieve this is by adding new columns that have "),a("code",[t._v("NULL")]),t._v(" as their expressions.")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"relations"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"lenses"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"historical_exhibits_extended"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"baseRelation"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"historical_exhibits"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"columns"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"added"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"artist_name"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"expression"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("\"'None'\"")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hidden"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"BasicLens"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("After doing the same for the "),a("code",[t._v("nature_exhibits")]),t._v(" table, referencing the new extended lenses from the union lens, and adding "),a("code",[t._v("art_exhibits")]),t._v(" as one of its union relations, get the following lens file:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"relations"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"lenses"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"historical_exhibits_extended"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"baseRelation"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"historical_exhibits"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"columns"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"added"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"artist_name"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"expression"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("\"'None'\"")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hidden"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"BasicLens"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"lenses"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nature_exhibits_extended"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"baseRelation"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nature_exhibits"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"columns"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"added"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"artist_name"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"expression"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("\"'None'\"")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hidden"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"BasicLens"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"lenses"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"all_exhibits"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"unionRelations"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"lenses"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"historical_exhibits_extended"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"lenses"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nature_exhibits_extended"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"art_exhibits"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"provenanceColumn"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"exhibit_type"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"UnionLens"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h3",{attrs:{id:"mapping-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#mapping-2"}},[t._v("#")]),t._v(" Mapping")]),t._v(" "),a("p",[t._v("We can now extend the mapping file to also include artist names:")]),t._v(" "),a("div",{staticClass:"language-obda extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("mappingId\tMAPID-exhibits\ntarget\t\tdata:exhibit/{exhibit_id} a :Exhibit ; :name {name} ; :displayedIn data:museum/{museum_id} ; :exhibitType {exhibit_type} ; :artistName {artist_name} .\nsource\t\tSELECT exhibit_id, name, museum_id, exhibit_type, artist_name FROM lenses.all_exhibits;\n")])])]),a("p",[t._v("Now, running this slightly modified SPARQL query:")]),t._v(" "),a("div",{staticClass:"language-SPARQL extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sparql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("PREFIX")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token url"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("http://example.org/museum_kg/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("SELECT")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?name")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?type")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?artist")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("WHERE")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?exhibit")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("a")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("Exhibit")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?exhibit")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("name")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?name")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?exhibit")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("exhibitType")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?type")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?exhibit")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("artistName")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?artist")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("we will once again get all earlier results, in addition to all exhibits contained in the "),a("code",[t._v("art_exhibit")]),t._v(" table. While the earlier results will have the value "),a("code",[t._v("None")]),t._v(" as their artist name, the "),a("code",[t._v("art_exhibits")]),t._v(" entries will include the name of their artists.")]),t._v(" "),a("hr"),t._v(" "),a("p",[t._v("As a further exercise, notice how the values of "),a("code",[t._v(":exhibitType")]),t._v(" are rather ugly: "),a("code",[t._v('"art_exhibits"')]),t._v(", "),a("code",[t._v('"lenses.historical_exhibits_extended"')]),t._v(", and "),a("code",[t._v('"lenses.nature_exhibits_extended"')]),t._v(". Try adding a new basic lens over the union lens that transforms these into the values "),a("code",[t._v('"art"')]),t._v(", "),a("code",[t._v('"historical"')]),t._v(", and "),a("code",[t._v('"nature"')]),t._v(" instead.")]),t._v(" "),a("p",[a("em",[t._v("Hint: Look at the SQL function "),a("code",[t._v("REPLACE")]),t._v(". Could it be used in the "),a("code",[t._v("expression")]),t._v(" field of an added column to get rid of the "),a("code",[t._v("_exhibits")]),t._v(", "),a("code",[t._v("_extended")]),t._v(", and "),a("code",[t._v("lenses.")]),t._v(" part?")])]),t._v(" "),a("p",[t._v("Notice how the union lens allowed you to perform this operation on all three of its base relations by just defining it once. Without the union lens, you would have required three such basic lenses, one for each table, with the exact same contents.")])])}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[93],{471:function(t,s,a){"use strict";a.r(s);var e=a(51),n=Object(e.a)({},(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"union-lens"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#union-lens"}},[t._v("#")]),t._v(" Union Lens")]),t._v(" "),a("p",[a("em",[t._v("Union lenses will be supported starting with version 5.1.0 (beta).")])]),t._v(" "),a("p",[t._v("Union lenses can be used to concatenate multiple relations with the same schema into one. Additionally, a "),a("em",[t._v("provenance")]),t._v(" field can be added to each row, determining the source relation the row originates from.")]),t._v(" "),a("p",[t._v("For this example, we will look at the tables "),a("code",[t._v("nature_exhibits")]),t._v(", "),a("code",[t._v("historical_exhibits")]),t._v(" and "),a("code",[t._v("art_exhibits")]),t._v(" from the DuckDB database. We want to combine them into a single relation containing all exhibits.")]),t._v(" "),a("p",[t._v("The tables "),a("code",[t._v("nature_exhibits")]),t._v(" and "),a("code",[t._v("historical_exhibits")]),t._v(" have the following schema:")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("column")]),t._v(" "),a("th",[t._v("type")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("exhibit_id")]),t._v(" "),a("td",[t._v("integer")])]),t._v(" "),a("tr",[a("td",[t._v("name")]),t._v(" "),a("td",[t._v("string")])]),t._v(" "),a("tr",[a("td",[t._v("museum_id")]),t._v(" "),a("td",[t._v("integer")])])])]),t._v(" "),a("p",[t._v("The table "),a("code",[t._v("art_exhibits")]),t._v(" has the following schema:")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("column")]),t._v(" "),a("th",[t._v("type")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("exhibit_id")]),t._v(" "),a("td",[t._v("integer")])]),t._v(" "),a("tr",[a("td",[t._v("name")]),t._v(" "),a("td",[t._v("string")])]),t._v(" "),a("tr",[a("td",[t._v("artist_name")]),t._v(" "),a("td",[t._v("string")])]),t._v(" "),a("tr",[a("td",[t._v("museum_id")]),t._v(" "),a("td",[t._v("integer")])])])]),t._v(" "),a("p",[t._v("For each table, "),a("code",[t._v("exhibit_id")]),t._v(" is a primary key and "),a("code",[t._v("museum_id")]),t._v(" is a foreign key, referencing the table "),a("code",[t._v("museums")]),t._v(".")]),t._v(" "),a("h2",{attrs:{id:"relations-with-the-same-schema"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#relations-with-the-same-schema"}},[t._v("#")]),t._v(" Relations with the same schema")]),t._v(" "),a("p",[t._v("This concatenation can be achieved using a union lens. However, as all base relations of a union lens must have the exact same columns, we will only be working on the tables "),a("code",[t._v("nature_exhibits")]),t._v(" and "),a("code",[t._v("historical_exhibits")]),t._v(" at first.")]),t._v(" "),a("p",[t._v("The union lens has the following structure:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"unionRelations"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"makeDistinct"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" boolean"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"provenanceColumn"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"UnionLens"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("Here, "),a("code",[t._v("unionRelations")]),t._v(" is a list of relations that should be concatenated, "),a("code",[t._v("makeDistinct")]),t._v(" indicates if a distinct constraint should be enforced on the result, and "),a("code",[t._v("provenanceColumn")]),t._v(" is an optional parameter, indicating the name of the provenance column in the result, which tells us what relation each row originated from.")]),t._v(" "),a("p",[t._v("As the tables "),a("code",[t._v("nature_exhibits")]),t._v(" and "),a("code",[t._v("historical_exhibits")]),t._v(" have the same set of columns, we can reference them from a union lens to create a new, concatenated view.")]),t._v(" "),a("div",{staticClass:"custom-block warning"},[a("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),a("p",[t._v("The columns of all tables used by a union lens must be "),a("em",[t._v("exactly")]),t._v(" equal. Their columns must have "),a("em",[t._v("the same names")]),t._v(" and the "),a("strong",[t._v("exact")]),t._v(" "),a("em",[t._v("same data types")]),t._v(". The order of the columns does not matter.")])]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"relations"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"lenses"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"all_exhibits"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"unionRelations"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"historical_exhibits"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nature_exhibits"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"provenanceColumn"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" ..."),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"makeDistinct"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" ..."),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"UnionLens"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("The remaining fields are "),a("code",[t._v("provenanceColumn")]),t._v(" and "),a("code",[t._v("makeDistinct")]),t._v(". As we do not expect the entries of any of the tables to be equal, we can just neglect the "),a("code",[t._v("makeDistinct")]),t._v(" parameter. To preserve the source of each entry, we want to include a provenance column. We can call it "),a("code",[t._v("exhibit_type")]),t._v(". This results in the following "),a("code",[t._v("lenses.json")]),t._v(" file:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"relations"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"lenses"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"all_exhibits"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"unionRelations"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"historical_exhibits"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nature_exhibits"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"provenanceColumn"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"exhibit_type"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"UnionLens"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("div",{staticClass:"custom-block tip"},[a("p",{staticClass:"custom-block-title"},[t._v("NOTE")]),t._v(" "),a("p",[t._v("If the "),a("code",[t._v("provenanceColumn")]),t._v(" field is not provided, then no information on the source relation will be preserved for the concatenated rows. If the field "),a("code",[t._v("makeDistinct")]),t._v(" is not provided, its default value is assumed to be "),a("code",[t._v("false")]),t._v(".")])]),t._v(" "),a("div",{staticClass:"custom-block tip"},[a("p",{staticClass:"custom-block-title"},[t._v("NOTE")]),t._v(" "),a("p",[t._v("Including a "),a("code",[t._v("provenanceColumn")]),t._v(" in a UnionLens where each of the source relations is distinct will render the "),a("code",[t._v("makeDistinct")]),t._v(" field redundant. This is because, under a union, the composite uniqueness constraint "),a("code",[t._v("(provenanceColumns, childUniquenessConstraint)")]),t._v(" will always hold. On the other hand, if no provenance column is included, then uniqueness constraints from the base relations will be lost, as there is no guarantee that a specific value does not appear again in a different table.")])]),t._v(" "),a("h3",{attrs:{id:"mapping"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#mapping"}},[t._v("#")]),t._v(" Mapping")]),t._v(" "),a("p",[t._v("Now, let us use this lens definition in our mapping. Starting from the mapping template file, add the following mapping entry:")]),t._v(" "),a("div",{staticClass:"language-obda extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("mappingId\tMAPID-exhibits\ntarget\t\tdata:exhibit/{exhibit_id} a :Exhibit ; :name {name} ; :displayedIn data:museum/{museum_id} ; :exhibitType {exhibit_type} .\nsource\t\tSELECT exhibit_id, name, museum_id, exhibit_type FROM lenses.all_exhibits;\n")])])]),a("p",[t._v("Starting the Ontop SPARQL endpoint using this mapping and lens file, we can now run the SPARQL query:")]),t._v(" "),a("div",{staticClass:"language-SPARQL extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sparql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("PREFIX")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token url"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("http://example.org/museum_kg/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("SELECT")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?name")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?type")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("WHERE")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?exhibit")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("a")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("Exhibit")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?exhibit")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("name")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?name")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?exhibit")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("exhibitType")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?type")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("This should result in a set of exhibit names that have the values "),a("code",[t._v("historical_exhibits")]),t._v(" and "),a("code",[t._v("nature_exhibits")]),t._v(" as their exhibit type.")]),t._v(" "),a("h2",{attrs:{id:"relations-with-different-schemas"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#relations-with-different-schemas"}},[t._v("#")]),t._v(" Relations with different schemas")]),t._v(" "),a("p",[t._v("If we further want to include the table "),a("code",[t._v("art_exhibits")]),t._v(" to the union lens, we cannot just add it to the list of "),a("code",[t._v("unionRelations")]),t._v(". This is because it has one additional column, "),a("code",[t._v("artist_name")]),t._v(', that does not appear in the other tables.\nTo work around this issue, we can take advantage of basic lenses, putting them "underneath" the union lens, to ensure the equality of columns.')]),t._v(" "),a("p",[t._v("There are two possibilities to achieve this:")]),t._v(" "),a("ol",[a("li",[t._v("Hide the conflicting column(s) from its/their table(s)")]),t._v(" "),a("li",[t._v("Add the conflicting column(s) to the tables that do not include them.")])]),t._v(" "),a("p",[t._v("To retain a maximum of information, we will choose the second approach for this example. That means, that we have to construct basic lenses to add the column "),a("code",[t._v("artist_name")]),t._v(" to the tables "),a("code",[t._v("historical_exhibits")]),t._v(" and "),a("code",[t._v("nature_exhibits")]),t._v(". One possible way to achieve this is by adding new columns that have "),a("code",[t._v("NULL")]),t._v(" as their expressions.")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"relations"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"lenses"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"historical_exhibits_extended"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"baseRelation"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"historical_exhibits"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"columns"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"added"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"artist_name"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"expression"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("\"'None'\"")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hidden"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"BasicLens"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("After doing the same for the "),a("code",[t._v("nature_exhibits")]),t._v(" table, referencing the new extended lenses from the union lens, and adding "),a("code",[t._v("art_exhibits")]),t._v(" as one of its union relations, get the following lens file:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"relations"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"lenses"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"historical_exhibits_extended"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"baseRelation"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"historical_exhibits"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"columns"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"added"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"artist_name"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"expression"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("\"'None'\"")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hidden"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"BasicLens"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"lenses"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nature_exhibits_extended"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"baseRelation"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nature_exhibits"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"columns"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"added"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"artist_name"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"expression"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("\"'None'\"")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hidden"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"BasicLens"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"lenses"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"all_exhibits"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"unionRelations"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"lenses"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"historical_exhibits_extended"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"lenses"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nature_exhibits_extended"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"art_exhibits"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"provenanceColumn"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"exhibit_type"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"UnionLens"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h3",{attrs:{id:"mapping-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#mapping-2"}},[t._v("#")]),t._v(" Mapping")]),t._v(" "),a("p",[t._v("We can now extend the mapping file to also include artist names:")]),t._v(" "),a("div",{staticClass:"language-obda extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("mappingId\tMAPID-exhibits\ntarget\t\tdata:exhibit/{exhibit_id} a :Exhibit ; :name {name} ; :displayedIn data:museum/{museum_id} ; :exhibitType {exhibit_type} ; :artistName {artist_name} .\nsource\t\tSELECT exhibit_id, name, museum_id, exhibit_type, artist_name FROM lenses.all_exhibits;\n")])])]),a("p",[t._v("Now, running this slightly modified SPARQL query:")]),t._v(" "),a("div",{staticClass:"language-SPARQL extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sparql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("PREFIX")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token url"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("http://example.org/museum_kg/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("SELECT")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?name")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?type")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?artist")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("WHERE")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?exhibit")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("a")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("Exhibit")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?exhibit")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("name")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?name")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?exhibit")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("exhibitType")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?type")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?exhibit")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("artistName")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?artist")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("we will once again get all earlier results, in addition to all exhibits contained in the "),a("code",[t._v("art_exhibit")]),t._v(" table. While the earlier results will have the value "),a("code",[t._v("None")]),t._v(" as their artist name, the "),a("code",[t._v("art_exhibits")]),t._v(" entries will include the name of their artists.")]),t._v(" "),a("hr"),t._v(" "),a("p",[t._v("As a further exercise, notice how the values of "),a("code",[t._v(":exhibitType")]),t._v(" are rather ugly: "),a("code",[t._v('"art_exhibits"')]),t._v(", "),a("code",[t._v('"lenses.historical_exhibits_extended"')]),t._v(", and "),a("code",[t._v('"lenses.nature_exhibits_extended"')]),t._v(". Try adding a new basic lens over the union lens that transforms these into the values "),a("code",[t._v('"art"')]),t._v(", "),a("code",[t._v('"historical"')]),t._v(", and "),a("code",[t._v('"nature"')]),t._v(" instead.")]),t._v(" "),a("p",[a("em",[t._v("Hint: Look at the SQL function "),a("code",[t._v("REPLACE")]),t._v(". Could it be used in the "),a("code",[t._v("expression")]),t._v(" field of an added column to get rid of the "),a("code",[t._v("_exhibits")]),t._v(", "),a("code",[t._v("_extended")]),t._v(", and "),a("code",[t._v("lenses.")]),t._v(" part?")])]),t._v(" "),a("p",[t._v("Notice how the union lens allowed you to perform this operation on all three of its base relations by just defining it once. Without the union lens, you would have required three such basic lenses, one for each table, with the exact same contents.")])])}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/94.c2f356cb.js b/assets/js/94.60c614e2.js similarity index 94% rename from assets/js/94.c2f356cb.js rename to assets/js/94.60c614e2.js index 9998aa954..05427b13d 100644 --- a/assets/js/94.c2f356cb.js +++ b/assets/js/94.60c614e2.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[94],{472:function(e,t,n){"use strict";n.r(t);var i=n(51),a=Object(i.a)({},(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[n("h1",{attrs:{id:"second-session-mapping-engineering"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#second-session-mapping-engineering"}},[e._v("#")]),e._v(" Second session: Mapping Engineering")]),e._v(" "),n("p",[e._v("We discuss here some advanced topics related to mappings engineering and the exploitation of\navailable database constraints, which affect the performance of generated SQL queries:")]),e._v(" "),n("ol",[n("li",[n("RouterLink",{attrs:{to:"/tutorial/mapping/primary-keys.html"}},[e._v("Role of primary keys")])],1),e._v(" "),n("li",[n("RouterLink",{attrs:{to:"/tutorial/mapping/foreign-keys.html"}},[e._v("Role of foreign keys")])],1),e._v(" "),n("li",[n("RouterLink",{attrs:{to:"/tutorial/mapping/uri-templates.html"}},[e._v("Choice of the IRI templates")])],1),e._v(" "),n("li",[n("RouterLink",{attrs:{to:"/tutorial/mapping/existential.html"}},[e._v("Existential reasoning")])],1)])])}),[],!1,null,null,null);t.default=a.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[94],{470:function(e,t,n){"use strict";n.r(t);var i=n(51),a=Object(i.a)({},(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[n("h1",{attrs:{id:"second-session-mapping-engineering"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#second-session-mapping-engineering"}},[e._v("#")]),e._v(" Second session: Mapping Engineering")]),e._v(" "),n("p",[e._v("We discuss here some advanced topics related to mappings engineering and the exploitation of\navailable database constraints, which affect the performance of generated SQL queries:")]),e._v(" "),n("ol",[n("li",[n("RouterLink",{attrs:{to:"/tutorial/mapping/primary-keys.html"}},[e._v("Role of primary keys")])],1),e._v(" "),n("li",[n("RouterLink",{attrs:{to:"/tutorial/mapping/foreign-keys.html"}},[e._v("Role of foreign keys")])],1),e._v(" "),n("li",[n("RouterLink",{attrs:{to:"/tutorial/mapping/uri-templates.html"}},[e._v("Choice of the IRI templates")])],1),e._v(" "),n("li",[n("RouterLink",{attrs:{to:"/tutorial/mapping/existential.html"}},[e._v("Existential reasoning")])],1)])])}),[],!1,null,null,null);t.default=a.exports}}]); \ No newline at end of file diff --git a/assets/js/95.4647eb76.js b/assets/js/95.5ebe6cd9.js similarity index 98% rename from assets/js/95.4647eb76.js rename to assets/js/95.5ebe6cd9.js index 7ec474e48..7575888e5 100644 --- a/assets/js/95.4647eb76.js +++ b/assets/js/95.5ebe6cd9.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[95],{470:function(t,s,a){"use strict";a.r(s);var e=a(51),n=Object(e.a)({},(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"bonus-existential-reasoning"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#bonus-existential-reasoning"}},[t._v("#")]),t._v(" Bonus: existential reasoning")]),t._v(" "),a("p",[t._v("Ontop includes a "),a("em",[t._v("tree-witness query rewriting algorithm")]),t._v(" implementing "),a("em",[t._v("existential reasoning")]),t._v(".")]),t._v(" "),a("p",[t._v("To enable it, in Protégé go to "),a("em",[t._v("Preferences")]),t._v(" -> "),a("em",[t._v("Ontop reasoner")]),t._v(" tab and enable the option "),a("em",[t._v("reasoning over anonymous individuals")]),t._v(".")]),t._v(" "),a("p",[t._v("Then, restart the reasoner and try the following query that looks for people supervised by some "),a("em",[t._v("Professor")]),t._v(":")]),t._v(" "),a("div",{staticClass:"language-sparql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sparql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("PREFIX")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token url"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("http://example.org/voc#"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("SELECT")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?x")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?x")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("isSupervisedBy")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("a")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("Professor")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("Note that there is no mapping assertion for the property "),a("em",[t._v("isSupervisedBy")]),t._v(".\nHowever, the ontology states that for every "),a("em",[t._v("GraduateStudent")]),t._v(" there must exist some "),a("em",[t._v("Professor")]),t._v(" so that the student "),a("em",[t._v("isSupervisedBy")]),t._v(" the professor.\nOntop can thus infer that all "),a("em",[t._v("GraduateStudent")]),t._v(" are answers to the query, which is then rewritten as the following equivalent query prior to evaluation:")]),t._v(" "),a("div",{staticClass:"language-sparql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sparql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("PREFIX")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token url"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("http://example.org/voc#"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("SELECT")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?x")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?x")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("a")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("GraduateStudent")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])])}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[95],{473:function(t,s,a){"use strict";a.r(s);var e=a(51),n=Object(e.a)({},(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"bonus-existential-reasoning"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#bonus-existential-reasoning"}},[t._v("#")]),t._v(" Bonus: existential reasoning")]),t._v(" "),a("p",[t._v("Ontop includes a "),a("em",[t._v("tree-witness query rewriting algorithm")]),t._v(" implementing "),a("em",[t._v("existential reasoning")]),t._v(".")]),t._v(" "),a("p",[t._v("To enable it, in Protégé go to "),a("em",[t._v("Preferences")]),t._v(" -> "),a("em",[t._v("Ontop reasoner")]),t._v(" tab and enable the option "),a("em",[t._v("reasoning over anonymous individuals")]),t._v(".")]),t._v(" "),a("p",[t._v("Then, restart the reasoner and try the following query that looks for people supervised by some "),a("em",[t._v("Professor")]),t._v(":")]),t._v(" "),a("div",{staticClass:"language-sparql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sparql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("PREFIX")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token url"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("http://example.org/voc#"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("SELECT")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?x")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?x")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("isSupervisedBy")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("a")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("Professor")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("Note that there is no mapping assertion for the property "),a("em",[t._v("isSupervisedBy")]),t._v(".\nHowever, the ontology states that for every "),a("em",[t._v("GraduateStudent")]),t._v(" there must exist some "),a("em",[t._v("Professor")]),t._v(" so that the student "),a("em",[t._v("isSupervisedBy")]),t._v(" the professor.\nOntop can thus infer that all "),a("em",[t._v("GraduateStudent")]),t._v(" are answers to the query, which is then rewritten as the following equivalent query prior to evaluation:")]),t._v(" "),a("div",{staticClass:"language-sparql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sparql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("PREFIX")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token url"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("http://example.org/voc#"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("SELECT")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?x")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[t._v("?x")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("a")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[t._v("GraduateStudent")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])])}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/96.0ba55a6d.js b/assets/js/96.399936b5.js similarity index 99% rename from assets/js/96.0ba55a6d.js rename to assets/js/96.399936b5.js index 684a7f261..68b45643f 100644 --- a/assets/js/96.0ba55a6d.js +++ b/assets/js/96.399936b5.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[96],{474:function(s,t,a){"use strict";a.r(t);var n=a(51),e=Object(n.a)({},(function(){var s=this,t=s.$createElement,a=s._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":s.$parent.slotKey}},[a("h1",{attrs:{id:"role-of-foreign-keys"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#role-of-foreign-keys"}},[s._v("#")]),s._v(" Role of foreign keys")]),s._v(" "),a("p",[s._v("Foreign keys play a crucial role for optimizing the saturated mapping assertions by doing some query containment checks.")]),s._v(" "),a("p",[s._v("Let us now consider the case where foreign keys are missing.\nPlease download the following files: "),a("a",{attrs:{href:"university-no-fk.ttl"}},[s._v("university-no-fk.ttl")]),s._v(", "),a("a",{attrs:{href:"university-no-fk.obda"}},[s._v("university-no-fk.obda")]),s._v(" and "),a("a",{attrs:{href:"university-no-fk.properties"}},[s._v("university-no-fk.properties")]),s._v(" files.")]),s._v(" "),a("p",[s._v("Let us consider the case of "),a("code",[s._v("foaf:Person")]),s._v(".\nIf you run the following SPARQL query in the absence of foreign keys:")]),s._v(" "),a("div",{staticClass:"language-sparql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sparql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("PREFIX")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token url"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("<")]),s._v("http://xmlns.com/foaf/0.1/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(">")])]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?p")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?p")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("a")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("Person")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n")])])]),a("p",[s._v("you will obtain a SQL query similar to the following one (after some minor reformatting):")]),s._v(" "),a("div",{staticClass:"language-sql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pQuestType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pLang"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v("'http://example.org/uni2/person/'")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("||")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lab_teacher"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"p"')]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"course"')]),s._v(" QVIEW1\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("WHERE")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lab_teacher"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("UNION")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("ALL")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pQuestType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pLang"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v("'http://example.org/uni2/person/'")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("||")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lecturer"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"p"')]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"course"')]),s._v(" QVIEW1\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("WHERE")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lecturer"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("UNION")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("ALL")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pQuestType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pLang"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v("'http://example.org/uni1/academic/'")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("||")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"a_id"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"p"')]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"teaching"')]),s._v(" QVIEW1\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("WHERE")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"a_id"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("UNION")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("ALL")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pQuestType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pLang"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v("'http://example.org/uni2/person/'")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("||")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pid"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"p"')]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"registration"')]),s._v(" QVIEW1\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("WHERE")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pid"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("UNION")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("ALL")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pQuestType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pLang"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v("'http://example.org/uni1/student/'")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("||")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"s_id"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"p"')]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"course-registration"')]),s._v(" QVIEW1\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("WHERE")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"s_id"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("UNION")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("ALL")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pQuestType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pLang"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v("'http://example.org/uni1/student/'")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("||")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"s_id"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"p"')]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"student"')]),s._v(" QVIEW1\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("WHERE")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"s_id"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("UNION")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("ALL")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pQuestType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pLang"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v("'http://example.org/uni1/academic/'")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("||")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"a_id"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"p"')]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"academic"')]),s._v(" QVIEW1\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("WHERE")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"a_id"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("UNION")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("ALL")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pQuestType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pLang"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v("'http://example.org/uni2/person/'")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("||")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pid"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"p"')]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"person"')]),s._v(" QVIEW1\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("WHERE")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pid"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v("\n")])])]),a("p",[s._v("This SQL query is the union of eight sub-queries. Basically, it queries\nthe tables "),a("code",[s._v("uni1.student")]),s._v(", "),a("code",[s._v("uni1.academic")]),s._v(", "),a("code",[s._v("uni2.person")]),s._v(" as expected, but also\n"),a("code",[s._v("uni1.teaching")]),s._v(", "),a("code",[s._v("uni1.course-registration")]),s._v(", "),a("code",[s._v("uni2.course")]),s._v(" and "),a("code",[s._v("uni2.registration")]),s._v(".\nRecall that the presence of the four latter tables is due to the fact that, according to the ontology, the respective domains of the properties "),a("code",[s._v(":givesLecture")]),s._v(", "),a("code",[s._v(":givesLab")]),s._v(" and "),a("code",[s._v(":attends")]),s._v(" are subsumed by "),a("code",[s._v("foaf:Person")]),s._v(".")]),s._v(" "),a("p",[s._v("With the setting of the first session which includes foreign keys, the generated SQL query contains only three unions:")]),s._v(" "),a("div",{staticClass:"language-sql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pQuestType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pLang"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v("'http://example.org/uni1/student/'")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("||")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"s_id"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"p"')]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"student"')]),s._v(" QVIEW1\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("WHERE")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"s_id"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("UNION")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("ALL")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pQuestType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pLang"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v("'http://example.org/uni1/academic/'")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("||")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"a_id"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"p"')]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"academic"')]),s._v(" QVIEW1\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("WHERE")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"a_id"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("UNION")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("ALL")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pQuestType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pLang"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v("'http://example.org/uni2/person/'")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("||")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pid"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"p"')]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"person"')]),s._v(" QVIEW1\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("WHERE")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pid"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v("\n")])])]),a("h3",{attrs:{id:"side-note"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#side-note"}},[s._v("#")]),s._v(" Side note")]),s._v(" "),a("p",[s._v("If we now consider also the first and the last names of persons, foreign keys are not needed to optimize the query.")]),s._v(" "),a("p",[s._v("Try:")]),s._v(" "),a("div",{staticClass:"language-sparql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sparql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("PREFIX")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token url"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("<")]),s._v("http://xmlns.com/foaf/0.1/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(">")])]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?p")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?firstName")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?lastName")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?p")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("a")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("Person")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("firstName")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?firstName")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("lastName")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?lastName")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n")])])]),a("p",[s._v("and observe that the query produces only three unions.")]),s._v(" "),a("p",[s._v("Why? Because the domain of "),a("code",[s._v("foaf:firstName")]),s._v(" and "),a("code",[s._v("foaf:lastName")]),s._v(" is "),a("code",[s._v("foaf:Person")]),s._v(".\nThe SPARQL query can thus be safely rewritten as follow:")]),s._v(" "),a("div",{staticClass:"language-sparql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sparql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("PREFIX")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token url"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("<")]),s._v("http://xmlns.com/foaf/0.1/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(">")])]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?p")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?firstName")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?lastName")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?p")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("firstName")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?firstName")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("lastName")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?lastName")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n")])])])])}),[],!1,null,null,null);t.default=e.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[96],{472:function(s,t,a){"use strict";a.r(t);var n=a(51),e=Object(n.a)({},(function(){var s=this,t=s.$createElement,a=s._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":s.$parent.slotKey}},[a("h1",{attrs:{id:"role-of-foreign-keys"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#role-of-foreign-keys"}},[s._v("#")]),s._v(" Role of foreign keys")]),s._v(" "),a("p",[s._v("Foreign keys play a crucial role for optimizing the saturated mapping assertions by doing some query containment checks.")]),s._v(" "),a("p",[s._v("Let us now consider the case where foreign keys are missing.\nPlease download the following files: "),a("a",{attrs:{href:"university-no-fk.ttl"}},[s._v("university-no-fk.ttl")]),s._v(", "),a("a",{attrs:{href:"university-no-fk.obda"}},[s._v("university-no-fk.obda")]),s._v(" and "),a("a",{attrs:{href:"university-no-fk.properties"}},[s._v("university-no-fk.properties")]),s._v(" files.")]),s._v(" "),a("p",[s._v("Let us consider the case of "),a("code",[s._v("foaf:Person")]),s._v(".\nIf you run the following SPARQL query in the absence of foreign keys:")]),s._v(" "),a("div",{staticClass:"language-sparql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sparql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("PREFIX")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token url"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("<")]),s._v("http://xmlns.com/foaf/0.1/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(">")])]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?p")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?p")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("a")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("Person")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n")])])]),a("p",[s._v("you will obtain a SQL query similar to the following one (after some minor reformatting):")]),s._v(" "),a("div",{staticClass:"language-sql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pQuestType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pLang"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v("'http://example.org/uni2/person/'")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("||")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lab_teacher"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"p"')]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"course"')]),s._v(" QVIEW1\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("WHERE")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lab_teacher"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("UNION")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("ALL")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pQuestType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pLang"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v("'http://example.org/uni2/person/'")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("||")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lecturer"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"p"')]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"course"')]),s._v(" QVIEW1\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("WHERE")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lecturer"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("UNION")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("ALL")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pQuestType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pLang"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v("'http://example.org/uni1/academic/'")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("||")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"a_id"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"p"')]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"teaching"')]),s._v(" QVIEW1\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("WHERE")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"a_id"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("UNION")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("ALL")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pQuestType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pLang"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v("'http://example.org/uni2/person/'")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("||")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pid"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"p"')]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"registration"')]),s._v(" QVIEW1\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("WHERE")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pid"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("UNION")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("ALL")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pQuestType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pLang"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v("'http://example.org/uni1/student/'")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("||")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"s_id"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"p"')]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"course-registration"')]),s._v(" QVIEW1\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("WHERE")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"s_id"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("UNION")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("ALL")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pQuestType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pLang"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v("'http://example.org/uni1/student/'")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("||")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"s_id"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"p"')]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"student"')]),s._v(" QVIEW1\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("WHERE")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"s_id"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("UNION")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("ALL")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pQuestType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pLang"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v("'http://example.org/uni1/academic/'")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("||")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"a_id"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"p"')]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"academic"')]),s._v(" QVIEW1\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("WHERE")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"a_id"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("UNION")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("ALL")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pQuestType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pLang"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v("'http://example.org/uni2/person/'")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("||")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pid"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"p"')]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"person"')]),s._v(" QVIEW1\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("WHERE")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pid"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v("\n")])])]),a("p",[s._v("This SQL query is the union of eight sub-queries. Basically, it queries\nthe tables "),a("code",[s._v("uni1.student")]),s._v(", "),a("code",[s._v("uni1.academic")]),s._v(", "),a("code",[s._v("uni2.person")]),s._v(" as expected, but also\n"),a("code",[s._v("uni1.teaching")]),s._v(", "),a("code",[s._v("uni1.course-registration")]),s._v(", "),a("code",[s._v("uni2.course")]),s._v(" and "),a("code",[s._v("uni2.registration")]),s._v(".\nRecall that the presence of the four latter tables is due to the fact that, according to the ontology, the respective domains of the properties "),a("code",[s._v(":givesLecture")]),s._v(", "),a("code",[s._v(":givesLab")]),s._v(" and "),a("code",[s._v(":attends")]),s._v(" are subsumed by "),a("code",[s._v("foaf:Person")]),s._v(".")]),s._v(" "),a("p",[s._v("With the setting of the first session which includes foreign keys, the generated SQL query contains only three unions:")]),s._v(" "),a("div",{staticClass:"language-sql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pQuestType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pLang"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v("'http://example.org/uni1/student/'")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("||")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"s_id"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"p"')]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"student"')]),s._v(" QVIEW1\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("WHERE")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"s_id"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("UNION")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("ALL")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pQuestType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pLang"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v("'http://example.org/uni1/academic/'")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("||")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"a_id"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"p"')]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"academic"')]),s._v(" QVIEW1\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("WHERE")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"a_id"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("UNION")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("ALL")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pQuestType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pLang"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v("'http://example.org/uni2/person/'")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("||")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pid"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"p"')]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"person"')]),s._v(" QVIEW1\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("WHERE")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pid"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v("\n")])])]),a("h3",{attrs:{id:"side-note"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#side-note"}},[s._v("#")]),s._v(" Side note")]),s._v(" "),a("p",[s._v("If we now consider also the first and the last names of persons, foreign keys are not needed to optimize the query.")]),s._v(" "),a("p",[s._v("Try:")]),s._v(" "),a("div",{staticClass:"language-sparql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sparql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("PREFIX")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token url"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("<")]),s._v("http://xmlns.com/foaf/0.1/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(">")])]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?p")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?firstName")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?lastName")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?p")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("a")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("Person")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("firstName")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?firstName")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("lastName")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?lastName")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n")])])]),a("p",[s._v("and observe that the query produces only three unions.")]),s._v(" "),a("p",[s._v("Why? Because the domain of "),a("code",[s._v("foaf:firstName")]),s._v(" and "),a("code",[s._v("foaf:lastName")]),s._v(" is "),a("code",[s._v("foaf:Person")]),s._v(".\nThe SPARQL query can thus be safely rewritten as follow:")]),s._v(" "),a("div",{staticClass:"language-sparql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sparql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("PREFIX")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token url"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("<")]),s._v("http://xmlns.com/foaf/0.1/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(">")])]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?p")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?firstName")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?lastName")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?p")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("firstName")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?firstName")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("lastName")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?lastName")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n")])])])])}),[],!1,null,null,null);t.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/97.1b6a9de2.js b/assets/js/97.95667eff.js similarity index 99% rename from assets/js/97.1b6a9de2.js rename to assets/js/97.95667eff.js index d0df01337..2b6330dae 100644 --- a/assets/js/97.1b6a9de2.js +++ b/assets/js/97.95667eff.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[97],{473:function(s,t,a){"use strict";a.r(t);var n=a(51),r=Object(n.a)({},(function(){var s=this,t=s.$createElement,a=s._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":s.$parent.slotKey}},[a("h1",{attrs:{id:"role-of-primary-keys-unique-constraints"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#role-of-primary-keys-unique-constraints"}},[s._v("#")]),s._v(" Role of primary keys (unique constraints)")]),s._v(" "),a("p",[s._v("Unique constraints (such as primary keys) are very useful for removing self-joins and thus improving query answering performance.")]),s._v(" "),a("p",[s._v("Let us now consider the following files: "),a("a",{attrs:{href:"university-no-pk.ttl"}},[s._v("university-no-pk.ttl")]),s._v(", "),a("a",{attrs:{href:"university-no-pk.obda"}},[s._v("university-no-pk.obda")]),s._v(" and "),a("a",{attrs:{href:"university-no-pk.properties"}},[s._v("university-no-pk.properties")]),s._v(" files.\nThe mapping assertions are the same as during the first session.\nThe only difference is that primary keys have been removed.")]),s._v(" "),a("p",[s._v("Open the new ontology file in Protégé and run the following SPARQL query:")]),s._v(" "),a("div",{staticClass:"language-sparql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sparql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("PREFIX")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token url"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("<")]),s._v("http://example.org/voc#"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(">")])]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("PREFIX")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token url"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("<")]),s._v("http://xmlns.com/foaf/0.1/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(">")])]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("DISTINCT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?prof")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?lastName")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?prof")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("a")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("FullProfessor")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("firstName")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?firstName")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("lastName")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?lastName")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n")])])]),a("p",[s._v("Due to the absence of primary keys, the generated SQL is, after some minor reformatting, the following:")]),s._v(" "),a("div",{staticClass:"language-sql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("*")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"profQuestType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"profLang"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v("'http://example.org/uni2/person/'")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("||")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pid"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"prof"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("7")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lastNameQuestType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lastNameLang"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n QVIEW3"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lname"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lastName"')]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"person"')]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"person"')]),s._v(" QVIEW2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"person"')]),s._v(" QVIEW3\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("WHERE")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"status"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("7")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("AND")]),s._v("\n QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pid"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("AND")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pid"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" QVIEW2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pid"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("AND")]),s._v("\n QVIEW2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"fname"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("AND")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pid"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" QVIEW3"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pid"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("AND")]),s._v("\n QVIEW3"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lname"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("UNION")]),s._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"profQuestType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"profLang"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v("'http://example.org/uni1/academic/'")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("||")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"a_id"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"prof"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("7")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lastNameQuestType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lastNameLang"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n QVIEW3"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"last_name"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lastName"')]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"academic"')]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"academic"')]),s._v(" QVIEW2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"academic"')]),s._v(" QVIEW3\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("WHERE")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"position"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("AND")]),s._v("\n QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"a_id"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("AND")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"a_id"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" QVIEW2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"a_id"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("AND")]),s._v("\n QVIEW2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"first_name"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("AND")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"a_id"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" QVIEW3"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"a_id"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("AND")]),s._v("\n QVIEW3"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"last_name"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" SUB_QVIEW\n")])])]),a("p",[s._v("In each sub-query, one can observe two self-joins, between "),a("code",[s._v("QVIEW1")]),s._v(", "),a("code",[s._v("QVIEW2")]),s._v(" and "),a("code",[s._v("QVIEW3")]),s._v(".")]),s._v(" "),a("p",[s._v("If you run the same query with the setting of the first session, you will obtain the following query:")]),s._v(" "),a("div",{staticClass:"language-sql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pQuestType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pLang"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v("'http://example.org/uni2/person/'")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("||")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pid"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"p"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("7")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lastNameQuestType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lastNameLang"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lname"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lastName"')]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"person"')]),s._v(" QVIEW1\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("WHERE")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pid"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("AND")]),s._v("\n QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"fname"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("AND")]),s._v("\n QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lname"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("UNION")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("ALL")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pQuestType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pLang"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v("'http://example.org/uni1/academic/'")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("||")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"a_id"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"p"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("7")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"firstNameQuestType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"firstNameLang"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"first_name"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"firstName"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("7")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lastNameQuestType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lastNameLang"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"last_name"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lastName"')]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"academic"')]),s._v(" QVIEW1\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("WHERE")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"a_id"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("AND")]),s._v("\n QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"first_name"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("AND")]),s._v("\n QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"last_name"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("UNION")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("ALL")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pQuestType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pLang"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v("'http://example.org/uni1/student/'")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("||")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"s_id"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"p"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("7")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"firstNameQuestType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"firstNameLang"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"first_name"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"firstName"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("7")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lastNameQuestType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lastNameLang"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"last_name"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lastName"')]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"student"')]),s._v(" QVIEW1\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("WHERE")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"s_id"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("AND")]),s._v("\n QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"first_name"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("AND")]),s._v("\n QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"last_name"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v("\n")])])]),a("p",[s._v("As you can see, the self-joins are removed when primary keys are provided and used as joining conditions.")])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[97],{475:function(s,t,a){"use strict";a.r(t);var n=a(51),r=Object(n.a)({},(function(){var s=this,t=s.$createElement,a=s._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":s.$parent.slotKey}},[a("h1",{attrs:{id:"role-of-primary-keys-unique-constraints"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#role-of-primary-keys-unique-constraints"}},[s._v("#")]),s._v(" Role of primary keys (unique constraints)")]),s._v(" "),a("p",[s._v("Unique constraints (such as primary keys) are very useful for removing self-joins and thus improving query answering performance.")]),s._v(" "),a("p",[s._v("Let us now consider the following files: "),a("a",{attrs:{href:"university-no-pk.ttl"}},[s._v("university-no-pk.ttl")]),s._v(", "),a("a",{attrs:{href:"university-no-pk.obda"}},[s._v("university-no-pk.obda")]),s._v(" and "),a("a",{attrs:{href:"university-no-pk.properties"}},[s._v("university-no-pk.properties")]),s._v(" files.\nThe mapping assertions are the same as during the first session.\nThe only difference is that primary keys have been removed.")]),s._v(" "),a("p",[s._v("Open the new ontology file in Protégé and run the following SPARQL query:")]),s._v(" "),a("div",{staticClass:"language-sparql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sparql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("PREFIX")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token url"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("<")]),s._v("http://example.org/voc#"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(">")])]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("PREFIX")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token url"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("<")]),s._v("http://xmlns.com/foaf/0.1/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(">")])]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("DISTINCT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?prof")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?lastName")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?prof")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("a")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("FullProfessor")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("firstName")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?firstName")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("lastName")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?lastName")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n")])])]),a("p",[s._v("Due to the absence of primary keys, the generated SQL is, after some minor reformatting, the following:")]),s._v(" "),a("div",{staticClass:"language-sql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("*")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"profQuestType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"profLang"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v("'http://example.org/uni2/person/'")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("||")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pid"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"prof"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("7")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lastNameQuestType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lastNameLang"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n QVIEW3"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lname"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lastName"')]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"person"')]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"person"')]),s._v(" QVIEW2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"person"')]),s._v(" QVIEW3\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("WHERE")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"status"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("7")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("AND")]),s._v("\n QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pid"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("AND")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pid"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" QVIEW2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pid"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("AND")]),s._v("\n QVIEW2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"fname"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("AND")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pid"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" QVIEW3"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pid"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("AND")]),s._v("\n QVIEW3"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lname"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("UNION")]),s._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"profQuestType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"profLang"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v("'http://example.org/uni1/academic/'")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("||")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"a_id"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"prof"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("7")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lastNameQuestType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lastNameLang"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n QVIEW3"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"last_name"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lastName"')]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"academic"')]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"academic"')]),s._v(" QVIEW2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"academic"')]),s._v(" QVIEW3\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("WHERE")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"position"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("AND")]),s._v("\n QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"a_id"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("AND")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"a_id"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" QVIEW2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"a_id"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("AND")]),s._v("\n QVIEW2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"first_name"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("AND")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"a_id"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" QVIEW3"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"a_id"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("AND")]),s._v("\n QVIEW3"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"last_name"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" SUB_QVIEW\n")])])]),a("p",[s._v("In each sub-query, one can observe two self-joins, between "),a("code",[s._v("QVIEW1")]),s._v(", "),a("code",[s._v("QVIEW2")]),s._v(" and "),a("code",[s._v("QVIEW3")]),s._v(".")]),s._v(" "),a("p",[s._v("If you run the same query with the setting of the first session, you will obtain the following query:")]),s._v(" "),a("div",{staticClass:"language-sql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pQuestType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pLang"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v("'http://example.org/uni2/person/'")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("||")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pid"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"p"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("7")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lastNameQuestType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lastNameLang"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lname"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lastName"')]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"person"')]),s._v(" QVIEW1\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("WHERE")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pid"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("AND")]),s._v("\n QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"fname"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("AND")]),s._v("\n QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lname"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("UNION")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("ALL")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pQuestType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pLang"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v("'http://example.org/uni1/academic/'")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("||")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"a_id"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"p"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("7")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"firstNameQuestType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"firstNameLang"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"first_name"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"firstName"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("7")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lastNameQuestType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lastNameLang"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"last_name"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lastName"')]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"academic"')]),s._v(" QVIEW1\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("WHERE")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"a_id"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("AND")]),s._v("\n QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"first_name"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("AND")]),s._v("\n QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"last_name"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("UNION")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("ALL")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pQuestType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pLang"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v("'http://example.org/uni1/student/'")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("||")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"s_id"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"p"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("7")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"firstNameQuestType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"firstNameLang"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"first_name"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"firstName"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("7")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lastNameQuestType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lastNameLang"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"last_name"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("AS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lastName"')]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"student"')]),s._v(" QVIEW1\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("WHERE")]),s._v(" QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"s_id"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("AND")]),s._v("\n QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"first_name"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("AND")]),s._v("\n QVIEW1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"last_name"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("IS")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("NOT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("NULL")]),s._v("\n")])])]),a("p",[s._v("As you can see, the self-joins are removed when primary keys are provided and used as joining conditions.")])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/98.f5e3d29a.js b/assets/js/98.f718a3ad.js similarity index 99% rename from assets/js/98.f5e3d29a.js rename to assets/js/98.f718a3ad.js index 8f2bedae4..82ee65a66 100644 --- a/assets/js/98.f5e3d29a.js +++ b/assets/js/98.f718a3ad.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[98],{475:function(s,t,a){"use strict";a.r(t);var n=a(51),e=Object(n.a)({},(function(){var s=this,t=s.$createElement,a=s._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":s.$parent.slotKey}},[a("h1",{attrs:{id:"choice-of-the-iri-templates"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#choice-of-the-iri-templates"}},[s._v("#")]),s._v(" Choice of the IRI templates")]),s._v(" "),a("p",[s._v("The choice of IRI templates may impact query complexity and performance, depending on whether joins have to be introduced to materialize those templates.")]),s._v(" "),a("p",[s._v("Until now, we have been using local identifiers from the data sources to build three different IRI templates for the persons of the two universities:")]),s._v(" "),a("ul",[a("li",[a("code",[s._v("ex:uni1/student/{*}")])]),s._v(" "),a("li",[a("code",[s._v("ex:uni1/academic/{*}")])]),s._v(" "),a("li",[a("code",[s._v("ex:uni2/person/{*}")])])]),s._v(" "),a("p",[s._v("Let us now consider the case where the tables "),a("code",[s._v("uni1.student")]),s._v(", "),a("code",[s._v("uni1.academic")]),s._v(" and "),a("code",[s._v("uni2.person")]),s._v(" have\na new column: "),a("code",[s._v("ssn")]),s._v(". This column corresponds to the social security number of the person.")]),s._v(" "),a("p",[s._v("This new column gives us the opportunity to use a common IRI template for all the persons. Such IRI template would allow us to collect information about a person registered in both universities.")]),s._v(" "),a("p",[s._v("As we will see, there are actually some persons that are teaching or studying in both universities.")]),s._v(" "),a("p",[s._v("Given that we already have the mapping assertions produced during the first session, we will consider\ntwo ways to change the IRI templates: first by doing it manually, then using the notion of "),a("em",[s._v("canonical IRIs")]),s._v(".")]),s._v(" "),a("p",[s._v("We will also see that using this new IRI template has a negative impact on the performance of some queries.")]),s._v(" "),a("h2",{attrs:{id:"manual-approach"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#manual-approach"}},[s._v("#")]),s._v(" Manual approach")]),s._v(" "),a("p",[s._v("Download the following files:")]),s._v(" "),a("ul",[a("li",[a("a",{attrs:{href:"university-manual-ssn.ttl"}},[s._v("university-manual-ssn.ttl")])]),s._v(" "),a("li",[a("a",{attrs:{href:"university-manual-ssn.obda"}},[s._v("university-manual-ssn.obda")])]),s._v(" "),a("li",[a("a",{attrs:{href:"university-manual-ssn.properties"}},[s._v("university-manual-ssn.properties")])])]),s._v(" "),a("p",[s._v("The mapping assertions are currently the same as during the first hands-on session.\nLet us now update them with the new IRI template for persons.")]),s._v(" "),a("h4",{attrs:{id:"mapping-uni1-student"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#mapping-uni1-student"}},[s._v("#")]),s._v(" Mapping uni1.student")]),s._v(" "),a("ul",[a("li",[s._v("Target:")])]),s._v(" "),a("div",{staticClass:"language-turtle extra-class"},[a("pre",{pre:!0,attrs:{class:"language-turtle"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("ex"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("person")])]),s._v("/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("ssn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("a")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("Student")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("firstName")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("first_name"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("^^")]),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("xsd"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("string")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("lastName")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("last_name"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("^^")]),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("xsd"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("string")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("\n")])])]),a("ul",[a("li",[s._v("Source:")])]),s._v(" "),a("div",{staticClass:"language-sql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("*")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"student"')]),s._v("\n")])])]),a("h4",{attrs:{id:"mapping-uni1-academic"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#mapping-uni1-academic"}},[s._v("#")]),s._v(" Mapping uni1-academic")]),s._v(" "),a("ul",[a("li",[s._v("Target:")])]),s._v(" "),a("div",{staticClass:"language-turtle extra-class"},[a("pre",{pre:!0,attrs:{class:"language-turtle"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("ex"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("person")])]),s._v("/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("ssn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("a")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("FacultyMember")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("firstName")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("first_name"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("^^")]),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("xsd"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("string")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("lastName")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("last_name"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("^^")]),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("xsd"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("string")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("\n")])])]),a("ul",[a("li",[s._v("Source:")])]),s._v(" "),a("div",{staticClass:"language-sql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("*")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"academic"')]),s._v("\n")])])]),a("h4",{attrs:{id:"mapping-uni1-teaching"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#mapping-uni1-teaching"}},[s._v("#")]),s._v(" Mapping uni1-teaching")]),s._v(" "),a("ul",[a("li",[s._v("Target:")])]),s._v(" "),a("div",{staticClass:"language-turtle extra-class"},[a("pre",{pre:!0,attrs:{class:"language-turtle"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("ex"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("person")])]),s._v("/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("ssn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("teaches")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("ex"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("uni1")])]),s._v("/course/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("c_id"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("\n")])])]),a("ul",[a("li",[s._v("Source:")])]),s._v(" "),a("div",{staticClass:"language-sql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" ac"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"ssn"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" te"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"c_id"')]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"teaching"')]),s._v(" te"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"academic"')]),s._v(" ac\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("WHERE")]),s._v(" te"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"a_id"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" ac"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"a_id"')]),s._v("\n")])])]),a("p",[s._v("As you can see, a join is needed to get the SSN of the teacher.")]),s._v(" "),a("h4",{attrs:{id:"mapping-uni1-registration"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#mapping-uni1-registration"}},[s._v("#")]),s._v(" Mapping uni1-registration")]),s._v(" "),a("ul",[a("li",[s._v("Target:")])]),s._v(" "),a("div",{staticClass:"language-turtle extra-class"},[a("pre",{pre:!0,attrs:{class:"language-turtle"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("ex"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("person")])]),s._v("/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("ssn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("attends")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("ex"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("uni1")])]),s._v("/course/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("c_id"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("\n")])])]),a("ul",[a("li",[s._v("Source:")])]),s._v(" "),a("div",{staticClass:"language-sql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" st"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"ssn"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" re"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"c_id"')]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"course-registration"')]),s._v(" re"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"student"')]),s._v(" st\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("WHERE")]),s._v(" re"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"s_id"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" st"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"s_id"')]),s._v("\n")])])]),a("h4",{attrs:{id:"mapping-uni1-fullprofessor"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#mapping-uni1-fullprofessor"}},[s._v("#")]),s._v(" Mapping uni1-fullProfessor")]),s._v(" "),a("ul",[a("li",[s._v("Target:")])]),s._v(" "),a("div",{staticClass:"language-turtle extra-class"},[a("pre",{pre:!0,attrs:{class:"language-turtle"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("ex"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("person")])]),s._v("/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("ssn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("a")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("FullProfessor")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("\n")])])]),a("ul",[a("li",[s._v("Source:")])]),s._v(" "),a("div",{staticClass:"language-sql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("*")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"academic"')]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("WHERE")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"position"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),s._v("\n")])])]),a("p",[s._v("Then proceed in a similar way for the other positions (assistant professor, postdoc, etc.).")]),s._v(" "),a("h4",{attrs:{id:"mapping-uni2-person"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#mapping-uni2-person"}},[s._v("#")]),s._v(" Mapping uni2.person")]),s._v(" "),a("ul",[a("li",[s._v("Target:")])]),s._v(" "),a("div",{staticClass:"language-turtle extra-class"},[a("pre",{pre:!0,attrs:{class:"language-turtle"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("ex"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("person")])]),s._v("/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("ssn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("a")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("Person")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("firstName")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("fname"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("^^")]),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("xsd"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("string")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("lastName")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("lname"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("^^")]),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("xsd"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("string")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("\n")])])]),a("ul",[a("li",[s._v("Source:")])]),s._v(" "),a("div",{staticClass:"language-sql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("*")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"person"')]),s._v("\n")])])]),a("h4",{attrs:{id:"mapping-uni2-lecturer"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#mapping-uni2-lecturer"}},[s._v("#")]),s._v(" Mapping uni2-lecturer")]),s._v(" "),a("ul",[a("li",[s._v("Target:")])]),s._v(" "),a("div",{staticClass:"language-turtle extra-class"},[a("pre",{pre:!0,attrs:{class:"language-turtle"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("ex"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("person")])]),s._v("/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("ssn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("givesLecture")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("ex"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("uni2")])]),s._v("/course/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("cid"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("\n")])])]),a("ul",[a("li",[s._v("Source:")])]),s._v(" "),a("div",{staticClass:"language-sql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" pe"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"ssn"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" co"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"cid"')]),s._v(" \n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"course"')]),s._v(" co"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"person"')]),s._v(" pe\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("WHERE")]),s._v(" co"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lecturer"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" pe"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pid"')]),s._v("\n")])])]),a("h4",{attrs:{id:"mapping-uni2-lab-teacher"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#mapping-uni2-lab-teacher"}},[s._v("#")]),s._v(" Mapping uni2-lab-teacher")]),s._v(" "),a("ul",[a("li",[s._v("Target:")])]),s._v(" "),a("div",{staticClass:"language-turtle extra-class"},[a("pre",{pre:!0,attrs:{class:"language-turtle"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("ex"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("person")])]),s._v("/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("ssn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("givesLab")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("ex"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("uni2")])]),s._v("/course/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("cid"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("\n")])])]),a("ul",[a("li",[s._v("Source:")])]),s._v(" "),a("div",{staticClass:"language-sql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" pe"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"ssn"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" co"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"cid"')]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"course"')]),s._v(" co"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"person"')]),s._v(" pe\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("WHERE")]),s._v(" co"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lab_teacher"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" pe"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pid"')]),s._v("\n")])])]),a("h4",{attrs:{id:"mapping-uni2-registration"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#mapping-uni2-registration"}},[s._v("#")]),s._v(" Mapping uni2-registration")]),s._v(" "),a("ul",[a("li",[s._v("Target:")])]),s._v(" "),a("div",{staticClass:"language-turtle extra-class"},[a("pre",{pre:!0,attrs:{class:"language-turtle"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("ex"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("person")])]),s._v("/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("ssn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("attends")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("ex"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("uni2")])]),s._v("/course/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("cid"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("\n")])])]),a("ul",[a("li",[s._v("Source:")])]),s._v(" "),a("div",{staticClass:"language-sql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" pe"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"ssn"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" re"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"cid"')]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"registration"')]),s._v(" re"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"person"')]),s._v(" pe\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("WHERE")]),s._v(" re"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pid"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" pe"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pid"')]),s._v("\n")])])]),a("h4",{attrs:{id:"mapping-uni2-undergraduate"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#mapping-uni2-undergraduate"}},[s._v("#")]),s._v(" Mapping uni2-undergraduate")]),s._v(" "),a("ul",[a("li",[s._v("Target:")])]),s._v(" "),a("div",{staticClass:"language-turtle extra-class"},[a("pre",{pre:!0,attrs:{class:"language-turtle"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("ex"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("person")])]),s._v("/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("ssn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("a")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("UndergraduateStudent")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("\n")])])]),a("ul",[a("li",[s._v("Source:")])]),s._v(" "),a("div",{staticClass:"language-sql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("*")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"person"')]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("WHERE")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"status"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),s._v("\n")])])]),a("p",[s._v("Then proceed in a similar way for the other positions (assistant professor, postdoc, etc.).")]),s._v(" "),a("h3",{attrs:{id:"sparql-queries"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#sparql-queries"}},[s._v("#")]),s._v(" SPARQL queries")]),s._v(" "),a("p",[s._v("With the new mapping assertions, the following SPARQL query should now return some results:")]),s._v(" "),a("div",{staticClass:"language-sparql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sparql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("PREFIX")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token url"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("<")]),s._v("http://example.org/voc#"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(">")])]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("PREFIX")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token url"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("<")]),s._v("http://xmlns.com/foaf/0.1/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(">")])]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("DISTINCT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?firstName")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?lastName")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?ins1")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?ins2")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?p")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("firstName")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?firstName")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("lastName")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?lastName")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("teaches")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("isGivenAt")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?ins1")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("isGivenAt")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?ins2")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FILTER")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("str")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?ins1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" < "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("str")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?ins2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n")])])]),a("p",[s._v("However, if you execute another variant, you will see it is now very inefficient:")]),s._v(" "),a("div",{staticClass:"language-sparql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sparql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("PREFIX")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token url"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("<")]),s._v("http://example.org/voc#"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(">")])]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("PREFIX")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token url"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("<")]),s._v("http://xmlns.com/foaf/0.1/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(">")])]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?firstName")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?lastName")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?ins1")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?ins2")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?p1")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("firstName")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?firstName")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("lastName")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?lastName")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("teaches")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("isGivenAt")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?ins1")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("\n\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?p2")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("firstName")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?firstName")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("lastName")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?lastName")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("teaches")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("isGivenAt")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?ins2")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FILTER")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("str")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?ins1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" < "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("str")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?ins2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n")])])]),a("p",[s._v("Look at the SQL query, it should be very long as it suffers from a substantial exponential blowup.\nNote that the first query also suffers from an exponential blowup but the latter is less important and thus less sensible on our small dataset.")]),s._v(" "),a("h2",{attrs:{id:"canonical-iris"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#canonical-iris"}},[s._v("#")]),s._v(" Canonical IRIs")]),s._v(" "),a("p",[s._v("Instead of changing the mapping assertions manually, Ontop allows you to declare a canonical IRI template for "),a("code",[s._v("ex:uni1/student/{*}")]),s._v(", "),a("code",[s._v("ex:uni1/academic/{*}")]),s._v(" and "),a("code",[s._v("ex:uni2/person/{*}")]),s._v(".")]),s._v(" "),a("p",[s._v("This takes the form of three additional mapping assertions that can be found in the "),a("a",{attrs:{href:"university-canonical.ttl"}},[s._v("university-canonical.ttl")]),s._v(", "),a("a",{attrs:{href:"university-canonical.obda"}},[s._v("university-canonical.obda")]),s._v(", and "),a("a",{attrs:{href:"university-canonical.properties"}},[s._v("university-canonical.properties")]),s._v(" files.")]),s._v(" "),a("h4",{attrs:{id:"mapping-uni1-academic-canonical"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#mapping-uni1-academic-canonical"}},[s._v("#")]),s._v(" Mapping uni1-academic-canonical")]),s._v(" "),a("ul",[a("li",[s._v("Target:")])]),s._v(" "),a("div",{staticClass:"language-turtle extra-class"},[a("pre",{pre:!0,attrs:{class:"language-turtle"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("person")])]),s._v("/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("ssn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("obda"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("isCanonicalIRIOf")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("uni1")])]),s._v("/academic/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("a_id"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v(" \n")])])]),a("ul",[a("li",[s._v("Source:")])]),s._v(" "),a("div",{staticClass:"language-sql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("*")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"academic"')]),s._v("\n")])])]),a("h4",{attrs:{id:"mapping-uni1-student-canonical"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#mapping-uni1-student-canonical"}},[s._v("#")]),s._v(" Mapping uni1.student-canonical")]),s._v(" "),a("ul",[a("li",[s._v("Target:")])]),s._v(" "),a("div",{staticClass:"language-turtle extra-class"},[a("pre",{pre:!0,attrs:{class:"language-turtle"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("person")])]),s._v("/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("ssn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("obda"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("isCanonicalIRIOf")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("uni1")])]),s._v("/student/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("s_id"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v(" \n")])])]),a("ul",[a("li",[s._v("Source:")])]),s._v(" "),a("div",{staticClass:"language-sql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("*")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"student"')]),s._v("\n")])])]),a("h4",{attrs:{id:"mapping-uni2-person-canonical"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#mapping-uni2-person-canonical"}},[s._v("#")]),s._v(" Mapping uni2.person-canonical")]),s._v(" "),a("ul",[a("li",[s._v("Target:")])]),s._v(" "),a("div",{staticClass:"language-turtle extra-class"},[a("pre",{pre:!0,attrs:{class:"language-turtle"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("person")])]),s._v("/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("ssn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("obda"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("isCanonicalIRIOf")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("uni2")])]),s._v("/person/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("pid"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v(" \n")])])]),a("ul",[a("li",[s._v("Source:")])]),s._v(" "),a("div",{staticClass:"language-sql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("*")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"person"')]),s._v("\n")])])]),a("p",[s._v("With these three mapping assertions and the ones of the first session, Ontop produces the same saturated mapping assertions as in the manual approach.\nQuery evaluation performance is thus the same (and similarly affected to the additional joins needed to build person IRIs), but the use of canonical IRI templates makes simpler for users to define and adapt mappings.")])])}),[],!1,null,null,null);t.default=e.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[98],{474:function(s,t,a){"use strict";a.r(t);var n=a(51),e=Object(n.a)({},(function(){var s=this,t=s.$createElement,a=s._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":s.$parent.slotKey}},[a("h1",{attrs:{id:"choice-of-the-iri-templates"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#choice-of-the-iri-templates"}},[s._v("#")]),s._v(" Choice of the IRI templates")]),s._v(" "),a("p",[s._v("The choice of IRI templates may impact query complexity and performance, depending on whether joins have to be introduced to materialize those templates.")]),s._v(" "),a("p",[s._v("Until now, we have been using local identifiers from the data sources to build three different IRI templates for the persons of the two universities:")]),s._v(" "),a("ul",[a("li",[a("code",[s._v("ex:uni1/student/{*}")])]),s._v(" "),a("li",[a("code",[s._v("ex:uni1/academic/{*}")])]),s._v(" "),a("li",[a("code",[s._v("ex:uni2/person/{*}")])])]),s._v(" "),a("p",[s._v("Let us now consider the case where the tables "),a("code",[s._v("uni1.student")]),s._v(", "),a("code",[s._v("uni1.academic")]),s._v(" and "),a("code",[s._v("uni2.person")]),s._v(" have\na new column: "),a("code",[s._v("ssn")]),s._v(". This column corresponds to the social security number of the person.")]),s._v(" "),a("p",[s._v("This new column gives us the opportunity to use a common IRI template for all the persons. Such IRI template would allow us to collect information about a person registered in both universities.")]),s._v(" "),a("p",[s._v("As we will see, there are actually some persons that are teaching or studying in both universities.")]),s._v(" "),a("p",[s._v("Given that we already have the mapping assertions produced during the first session, we will consider\ntwo ways to change the IRI templates: first by doing it manually, then using the notion of "),a("em",[s._v("canonical IRIs")]),s._v(".")]),s._v(" "),a("p",[s._v("We will also see that using this new IRI template has a negative impact on the performance of some queries.")]),s._v(" "),a("h2",{attrs:{id:"manual-approach"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#manual-approach"}},[s._v("#")]),s._v(" Manual approach")]),s._v(" "),a("p",[s._v("Download the following files:")]),s._v(" "),a("ul",[a("li",[a("a",{attrs:{href:"university-manual-ssn.ttl"}},[s._v("university-manual-ssn.ttl")])]),s._v(" "),a("li",[a("a",{attrs:{href:"university-manual-ssn.obda"}},[s._v("university-manual-ssn.obda")])]),s._v(" "),a("li",[a("a",{attrs:{href:"university-manual-ssn.properties"}},[s._v("university-manual-ssn.properties")])])]),s._v(" "),a("p",[s._v("The mapping assertions are currently the same as during the first hands-on session.\nLet us now update them with the new IRI template for persons.")]),s._v(" "),a("h4",{attrs:{id:"mapping-uni1-student"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#mapping-uni1-student"}},[s._v("#")]),s._v(" Mapping uni1.student")]),s._v(" "),a("ul",[a("li",[s._v("Target:")])]),s._v(" "),a("div",{staticClass:"language-turtle extra-class"},[a("pre",{pre:!0,attrs:{class:"language-turtle"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("ex"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("person")])]),s._v("/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("ssn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("a")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("Student")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("firstName")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("first_name"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("^^")]),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("xsd"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("string")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("lastName")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("last_name"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("^^")]),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("xsd"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("string")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("\n")])])]),a("ul",[a("li",[s._v("Source:")])]),s._v(" "),a("div",{staticClass:"language-sql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("*")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"student"')]),s._v("\n")])])]),a("h4",{attrs:{id:"mapping-uni1-academic"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#mapping-uni1-academic"}},[s._v("#")]),s._v(" Mapping uni1-academic")]),s._v(" "),a("ul",[a("li",[s._v("Target:")])]),s._v(" "),a("div",{staticClass:"language-turtle extra-class"},[a("pre",{pre:!0,attrs:{class:"language-turtle"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("ex"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("person")])]),s._v("/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("ssn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("a")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("FacultyMember")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("firstName")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("first_name"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("^^")]),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("xsd"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("string")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("lastName")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("last_name"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("^^")]),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("xsd"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("string")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("\n")])])]),a("ul",[a("li",[s._v("Source:")])]),s._v(" "),a("div",{staticClass:"language-sql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("*")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"academic"')]),s._v("\n")])])]),a("h4",{attrs:{id:"mapping-uni1-teaching"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#mapping-uni1-teaching"}},[s._v("#")]),s._v(" Mapping uni1-teaching")]),s._v(" "),a("ul",[a("li",[s._v("Target:")])]),s._v(" "),a("div",{staticClass:"language-turtle extra-class"},[a("pre",{pre:!0,attrs:{class:"language-turtle"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("ex"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("person")])]),s._v("/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("ssn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("teaches")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("ex"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("uni1")])]),s._v("/course/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("c_id"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("\n")])])]),a("ul",[a("li",[s._v("Source:")])]),s._v(" "),a("div",{staticClass:"language-sql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" ac"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"ssn"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" te"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"c_id"')]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"teaching"')]),s._v(" te"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"academic"')]),s._v(" ac\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("WHERE")]),s._v(" te"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"a_id"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" ac"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"a_id"')]),s._v("\n")])])]),a("p",[s._v("As you can see, a join is needed to get the SSN of the teacher.")]),s._v(" "),a("h4",{attrs:{id:"mapping-uni1-registration"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#mapping-uni1-registration"}},[s._v("#")]),s._v(" Mapping uni1-registration")]),s._v(" "),a("ul",[a("li",[s._v("Target:")])]),s._v(" "),a("div",{staticClass:"language-turtle extra-class"},[a("pre",{pre:!0,attrs:{class:"language-turtle"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("ex"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("person")])]),s._v("/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("ssn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("attends")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("ex"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("uni1")])]),s._v("/course/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("c_id"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("\n")])])]),a("ul",[a("li",[s._v("Source:")])]),s._v(" "),a("div",{staticClass:"language-sql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" st"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"ssn"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" re"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"c_id"')]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"course-registration"')]),s._v(" re"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"student"')]),s._v(" st\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("WHERE")]),s._v(" re"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"s_id"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" st"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"s_id"')]),s._v("\n")])])]),a("h4",{attrs:{id:"mapping-uni1-fullprofessor"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#mapping-uni1-fullprofessor"}},[s._v("#")]),s._v(" Mapping uni1-fullProfessor")]),s._v(" "),a("ul",[a("li",[s._v("Target:")])]),s._v(" "),a("div",{staticClass:"language-turtle extra-class"},[a("pre",{pre:!0,attrs:{class:"language-turtle"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("ex"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("person")])]),s._v("/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("ssn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("a")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("FullProfessor")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("\n")])])]),a("ul",[a("li",[s._v("Source:")])]),s._v(" "),a("div",{staticClass:"language-sql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("*")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"academic"')]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("WHERE")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"position"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),s._v("\n")])])]),a("p",[s._v("Then proceed in a similar way for the other positions (assistant professor, postdoc, etc.).")]),s._v(" "),a("h4",{attrs:{id:"mapping-uni2-person"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#mapping-uni2-person"}},[s._v("#")]),s._v(" Mapping uni2.person")]),s._v(" "),a("ul",[a("li",[s._v("Target:")])]),s._v(" "),a("div",{staticClass:"language-turtle extra-class"},[a("pre",{pre:!0,attrs:{class:"language-turtle"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("ex"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("person")])]),s._v("/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("ssn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("a")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("Person")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("firstName")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("fname"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("^^")]),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("xsd"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("string")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("lastName")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("lname"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("^^")]),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("xsd"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("string")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("\n")])])]),a("ul",[a("li",[s._v("Source:")])]),s._v(" "),a("div",{staticClass:"language-sql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("*")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"person"')]),s._v("\n")])])]),a("h4",{attrs:{id:"mapping-uni2-lecturer"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#mapping-uni2-lecturer"}},[s._v("#")]),s._v(" Mapping uni2-lecturer")]),s._v(" "),a("ul",[a("li",[s._v("Target:")])]),s._v(" "),a("div",{staticClass:"language-turtle extra-class"},[a("pre",{pre:!0,attrs:{class:"language-turtle"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("ex"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("person")])]),s._v("/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("ssn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("givesLecture")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("ex"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("uni2")])]),s._v("/course/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("cid"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("\n")])])]),a("ul",[a("li",[s._v("Source:")])]),s._v(" "),a("div",{staticClass:"language-sql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" pe"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"ssn"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" co"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"cid"')]),s._v(" \n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"course"')]),s._v(" co"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"person"')]),s._v(" pe\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("WHERE")]),s._v(" co"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lecturer"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" pe"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pid"')]),s._v("\n")])])]),a("h4",{attrs:{id:"mapping-uni2-lab-teacher"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#mapping-uni2-lab-teacher"}},[s._v("#")]),s._v(" Mapping uni2-lab-teacher")]),s._v(" "),a("ul",[a("li",[s._v("Target:")])]),s._v(" "),a("div",{staticClass:"language-turtle extra-class"},[a("pre",{pre:!0,attrs:{class:"language-turtle"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("ex"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("person")])]),s._v("/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("ssn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("givesLab")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("ex"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("uni2")])]),s._v("/course/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("cid"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("\n")])])]),a("ul",[a("li",[s._v("Source:")])]),s._v(" "),a("div",{staticClass:"language-sql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" pe"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"ssn"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" co"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"cid"')]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"course"')]),s._v(" co"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"person"')]),s._v(" pe\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("WHERE")]),s._v(" co"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"lab_teacher"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" pe"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pid"')]),s._v("\n")])])]),a("h4",{attrs:{id:"mapping-uni2-registration"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#mapping-uni2-registration"}},[s._v("#")]),s._v(" Mapping uni2-registration")]),s._v(" "),a("ul",[a("li",[s._v("Target:")])]),s._v(" "),a("div",{staticClass:"language-turtle extra-class"},[a("pre",{pre:!0,attrs:{class:"language-turtle"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("ex"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("person")])]),s._v("/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("ssn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("attends")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("ex"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("uni2")])]),s._v("/course/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("cid"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("\n")])])]),a("ul",[a("li",[s._v("Source:")])]),s._v(" "),a("div",{staticClass:"language-sql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" pe"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"ssn"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" re"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"cid"')]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"registration"')]),s._v(" re"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"person"')]),s._v(" pe\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("WHERE")]),s._v(" re"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pid"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" pe"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"pid"')]),s._v("\n")])])]),a("h4",{attrs:{id:"mapping-uni2-undergraduate"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#mapping-uni2-undergraduate"}},[s._v("#")]),s._v(" Mapping uni2-undergraduate")]),s._v(" "),a("ul",[a("li",[s._v("Target:")])]),s._v(" "),a("div",{staticClass:"language-turtle extra-class"},[a("pre",{pre:!0,attrs:{class:"language-turtle"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("ex"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("person")])]),s._v("/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("ssn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("a")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("UndergraduateStudent")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("\n")])])]),a("ul",[a("li",[s._v("Source:")])]),s._v(" "),a("div",{staticClass:"language-sql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("*")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"person"')]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("WHERE")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"status"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),s._v("\n")])])]),a("p",[s._v("Then proceed in a similar way for the other positions (assistant professor, postdoc, etc.).")]),s._v(" "),a("h3",{attrs:{id:"sparql-queries"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#sparql-queries"}},[s._v("#")]),s._v(" SPARQL queries")]),s._v(" "),a("p",[s._v("With the new mapping assertions, the following SPARQL query should now return some results:")]),s._v(" "),a("div",{staticClass:"language-sparql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sparql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("PREFIX")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token url"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("<")]),s._v("http://example.org/voc#"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(">")])]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("PREFIX")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token url"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("<")]),s._v("http://xmlns.com/foaf/0.1/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(">")])]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("DISTINCT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?firstName")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?lastName")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?ins1")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?ins2")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?p")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("firstName")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?firstName")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("lastName")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?lastName")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("teaches")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("isGivenAt")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?ins1")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("isGivenAt")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?ins2")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FILTER")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("str")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?ins1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" < "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("str")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?ins2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n")])])]),a("p",[s._v("However, if you execute another variant, you will see it is now very inefficient:")]),s._v(" "),a("div",{staticClass:"language-sparql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sparql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("PREFIX")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token url"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("<")]),s._v("http://example.org/voc#"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(">")])]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("PREFIX")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token url"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("<")]),s._v("http://xmlns.com/foaf/0.1/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(">")])]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?firstName")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?lastName")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?ins1")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?ins2")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?p1")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("firstName")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?firstName")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("lastName")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?lastName")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("teaches")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("isGivenAt")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?ins1")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("\n\n "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?p2")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("firstName")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?firstName")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("foaf"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("lastName")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?lastName")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("teaches")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("isGivenAt")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?ins2")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FILTER")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("str")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?ins1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" < "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("str")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token variable"}},[s._v("?ins2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n")])])]),a("p",[s._v("Look at the SQL query, it should be very long as it suffers from a substantial exponential blowup.\nNote that the first query also suffers from an exponential blowup but the latter is less important and thus less sensible on our small dataset.")]),s._v(" "),a("h2",{attrs:{id:"canonical-iris"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#canonical-iris"}},[s._v("#")]),s._v(" Canonical IRIs")]),s._v(" "),a("p",[s._v("Instead of changing the mapping assertions manually, Ontop allows you to declare a canonical IRI template for "),a("code",[s._v("ex:uni1/student/{*}")]),s._v(", "),a("code",[s._v("ex:uni1/academic/{*}")]),s._v(" and "),a("code",[s._v("ex:uni2/person/{*}")]),s._v(".")]),s._v(" "),a("p",[s._v("This takes the form of three additional mapping assertions that can be found in the "),a("a",{attrs:{href:"university-canonical.ttl"}},[s._v("university-canonical.ttl")]),s._v(", "),a("a",{attrs:{href:"university-canonical.obda"}},[s._v("university-canonical.obda")]),s._v(", and "),a("a",{attrs:{href:"university-canonical.properties"}},[s._v("university-canonical.properties")]),s._v(" files.")]),s._v(" "),a("h4",{attrs:{id:"mapping-uni1-academic-canonical"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#mapping-uni1-academic-canonical"}},[s._v("#")]),s._v(" Mapping uni1-academic-canonical")]),s._v(" "),a("ul",[a("li",[s._v("Target:")])]),s._v(" "),a("div",{staticClass:"language-turtle extra-class"},[a("pre",{pre:!0,attrs:{class:"language-turtle"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("person")])]),s._v("/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("ssn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("obda"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("isCanonicalIRIOf")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("uni1")])]),s._v("/academic/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("a_id"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v(" \n")])])]),a("ul",[a("li",[s._v("Source:")])]),s._v(" "),a("div",{staticClass:"language-sql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("*")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"academic"')]),s._v("\n")])])]),a("h4",{attrs:{id:"mapping-uni1-student-canonical"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#mapping-uni1-student-canonical"}},[s._v("#")]),s._v(" Mapping uni1.student-canonical")]),s._v(" "),a("ul",[a("li",[s._v("Target:")])]),s._v(" "),a("div",{staticClass:"language-turtle extra-class"},[a("pre",{pre:!0,attrs:{class:"language-turtle"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("person")])]),s._v("/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("ssn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("obda"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("isCanonicalIRIOf")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("uni1")])]),s._v("/student/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("s_id"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v(" \n")])])]),a("ul",[a("li",[s._v("Source:")])]),s._v(" "),a("div",{staticClass:"language-sql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("*")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"student"')]),s._v("\n")])])]),a("h4",{attrs:{id:"mapping-uni2-person-canonical"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#mapping-uni2-person-canonical"}},[s._v("#")]),s._v(" Mapping uni2.person-canonical")]),s._v(" "),a("ul",[a("li",[s._v("Target:")])]),s._v(" "),a("div",{staticClass:"language-turtle extra-class"},[a("pre",{pre:!0,attrs:{class:"language-turtle"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("person")])]),s._v("/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("ssn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[s._v("obda"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("isCanonicalIRIOf")])]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[a("span",{pre:!0,attrs:{class:"token prefix"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")])]),a("span",{pre:!0,attrs:{class:"token local-name"}},[s._v("uni2")])]),s._v("/person/"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("pid"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v(" \n")])])]),a("ul",[a("li",[s._v("Source:")])]),s._v(" "),a("div",{staticClass:"language-sql extra-class"},[a("pre",{pre:!0,attrs:{class:"language-sql"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("SELECT")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("*")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("FROM")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"uni2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"person"')]),s._v("\n")])])]),a("p",[s._v("With these three mapping assertions and the ones of the first session, Ontop produces the same saturated mapping assertions as in the manual approach.\nQuery evaluation performance is thus the same (and similarly affected to the additional joins needed to build person IRIs), but the use of canonical IRI templates makes simpler for users to define and adapt mappings.")])])}),[],!1,null,null,null);t.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/app.53efddd8.js b/assets/js/app.642e4dc8.js similarity index 68% rename from assets/js/app.53efddd8.js rename to assets/js/app.642e4dc8.js index 7f24b3fd0..da4e3423e 100644 --- a/assets/js/app.53efddd8.js +++ b/assets/js/app.642e4dc8.js @@ -1,9 +1,9 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[0],[]]);!function(t){function e(e){for(var r,a,l=e[0],s=e[1],u=e[2],f=0,p=[];f=0&&Math.floor(e)===e&&isFinite(t)}function d(t){return i(t)&&"function"==typeof t.then&&"function"==typeof t.catch}function h(t){return null==t?"":Array.isArray(t)||c(t)&&t.toString===u?JSON.stringify(t,null,2):String(t)}function v(t){var e=parseFloat(t);return isNaN(e)?t:e}function m(t,e){for(var n=Object.create(null),r=t.split(","),o=0;o-1)return t.splice(n,1)}}var b=Object.prototype.hasOwnProperty;function x(t,e){return b.call(t,e)}function _(t){var e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}var w=/-(\w)/g,P=_((function(t){return t.replace(w,(function(t,e){return e?e.toUpperCase():""}))})),k=_((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})),O=/\B([A-Z])/g,S=_((function(t){return t.replace(O,"-$1").toLowerCase()}));var E=Function.prototype.bind?function(t,e){return t.bind(e)}:function(t,e){function n(n){var r=arguments.length;return r?r>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n};function j(t,e){e=e||0;for(var n=t.length-e,r=new Array(n);n--;)r[n]=t[n+e];return r}function A(t,e){for(var n in e)t[n]=e[n];return t}function C(t){for(var e={},n=0;n0,Y=G&&G.indexOf("edge/")>0,X=(G&&G.indexOf("android"),G&&/iphone|ipad|ipod|ios/.test(G)||"ios"===Q),Z=(G&&/chrome\/\d+/.test(G),G&&/phantomjs/.test(G),G&&G.match(/firefox\/(\d+)/)),tt={}.watch,et=!1;if(W)try{var nt={};Object.defineProperty(nt,"passive",{get:function(){et=!0}}),window.addEventListener("test-passive",null,nt)}catch(t){}var rt=function(){return void 0===B&&(B=!W&&!H&&"undefined"!=typeof global&&(global.process&&"server"===global.process.env.VUE_ENV)),B},ot=W&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function it(t){return"function"==typeof t&&/native code/.test(t.toString())}var at,lt="undefined"!=typeof Symbol&&it(Symbol)&&"undefined"!=typeof Reflect&&it(Reflect.ownKeys);at="undefined"!=typeof Set&&it(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var st=L,ut=0,ct=function(){this.id=ut++,this.subs=[]};ct.prototype.addSub=function(t){this.subs.push(t)},ct.prototype.removeSub=function(t){y(this.subs,t)},ct.prototype.depend=function(){ct.target&&ct.target.addDep(this)},ct.prototype.notify=function(){var t=this.subs.slice();for(var e=0,n=t.length;e-1)if(i&&!x(o,"default"))a=!1;else if(""===a||a===S(t)){var s=zt(String,o.type);(s<0||l0&&(fe((s=t(s,(n||"")+"_"+r))[0])&&fe(c)&&(f[u]=gt(c.text+s[0].text),s.shift()),f.push.apply(f,s)):l(s)?fe(c)?f[u]=gt(c.text+s):""!==s&&f.push(gt(s)):fe(s)&&fe(c)?f[u]=gt(c.text+s.text):(a(e._isVList)&&i(s.tag)&&o(s.key)&&i(n)&&(s.key="__vlist"+n+"_"+r+"__"),f.push(s)));return f}(t):void 0}function fe(t){return i(t)&&i(t.text)&&!1===t.isComment}function pe(t,e){if(t){for(var n=Object.create(null),r=lt?Reflect.ownKeys(t):Object.keys(t),o=0;o0,a=t?!!t.$stable:!i,l=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(a&&n&&n!==r&&l===n.$key&&!i&&!n.$hasNormal)return n;for(var s in o={},t)t[s]&&"$"!==s[0]&&(o[s]=ge(e,s,t[s]))}else o={};for(var u in e)u in o||(o[u]=ye(e,u));return t&&Object.isExtensible(t)&&(t._normalized=o),F(o,"$stable",a),F(o,"$key",l),F(o,"$hasNormal",i),o}function ge(t,e,n){var r=function(){var t=arguments.length?n.apply(null,arguments):n({}),e=(t=t&&"object"==typeof t&&!Array.isArray(t)?[t]:ce(t))&&t[0];return t&&(!e||1===t.length&&e.isComment&&!ve(e))?void 0:t};return n.proxy&&Object.defineProperty(t,e,{get:r,enumerable:!0,configurable:!0}),r}function ye(t,e){return function(){return t[e]}}function be(t,e){var n,r,o,a,l;if(Array.isArray(t)||"string"==typeof t)for(n=new Array(t.length),r=0,o=t.length;rdocument.createEvent("Event").timeStamp&&(un=function(){return cn.now()})}function fn(){var t,e;for(sn=un(),an=!0,en.sort((function(t,e){return t.id-e.id})),ln=0;lnln&&en[n].id>t.id;)n--;en.splice(n+1,0,t)}else en.push(t);on||(on=!0,ne(fn))}}(this)},dn.prototype.run=function(){if(this.active){var t=this.get();if(t!==this.value||s(t)||this.deep){var e=this.value;if(this.value=t,this.user){var n='callback for watcher "'+this.expression+'"';Vt(this.cb,this.vm,[t,e],this.vm,n)}else this.cb.call(this.vm,t,e)}}},dn.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},dn.prototype.depend=function(){for(var t=this.deps.length;t--;)this.deps[t].depend()},dn.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||y(this.vm._watchers,this);for(var t=this.deps.length;t--;)this.deps[t].removeSub(this);this.active=!1}};var hn={enumerable:!0,configurable:!0,get:L,set:L};function vn(t,e,n){hn.get=function(){return this[e][n]},hn.set=function(t){this[e][n]=t},Object.defineProperty(t,n,hn)}function mn(t){t._watchers=[];var e=t.$options;e.props&&function(t,e){var n=t.$options.propsData||{},r=t._props={},o=t.$options._propKeys=[];t.$parent&&Pt(!1);var i=function(i){o.push(i);var a=Ut(i,e,n,t);St(r,i,a),i in t||vn(t,"_props",i)};for(var a in e)i(a);Pt(!0)}(t,e.props),e.methods&&function(t,e){t.$options.props;for(var n in e)t[n]="function"!=typeof e[n]?L:E(e[n],t)}(t,e.methods),e.data?function(t){var e=t.$options.data;c(e=t._data="function"==typeof e?function(t,e){pt();try{return t.call(e,e)}catch(t){return Bt(t,e,"data()"),{}}finally{dt()}}(e,t):e||{})||(e={});var n=Object.keys(e),r=t.$options.props,o=(t.$options.methods,n.length);for(;o--;){var i=n[o];0,r&&x(r,i)||(a=void 0,36!==(a=(i+"").charCodeAt(0))&&95!==a&&vn(t,"_data",i))}var a;Ot(e,!0)}(t):Ot(t._data={},!0),e.computed&&function(t,e){var n=t._computedWatchers=Object.create(null),r=rt();for(var o in e){var i=e[o],a="function"==typeof i?i:i.get;0,r||(n[o]=new dn(t,a||L,L,gn)),o in t||yn(t,o,i)}}(t,e.computed),e.watch&&e.watch!==tt&&function(t,e){for(var n in e){var r=e[n];if(Array.isArray(r))for(var o=0;o-1:"string"==typeof t?t.split(",").indexOf(e)>-1:!!f(t)&&t.test(e)}function jn(t,e){var n=t.cache,r=t.keys,o=t._vnode;for(var i in n){var a=n[i];if(a){var l=a.name;l&&!e(l)&&An(n,i,r,o)}}}function An(t,e,n,r){var o=t[e];!o||r&&o.tag===r.tag||o.componentInstance.$destroy(),t[e]=null,y(n,e)}!function(t){t.prototype._init=function(t){var e=this;e._uid=wn++,e._isVue=!0,t&&t._isComponent?function(t,e){var n=t.$options=Object.create(t.constructor.options),r=e._parentVnode;n.parent=e.parent,n._parentVnode=r;var o=r.componentOptions;n.propsData=o.propsData,n._parentListeners=o.listeners,n._renderChildren=o.children,n._componentTag=o.tag,e.render&&(n.render=e.render,n.staticRenderFns=e.staticRenderFns)}(e,t):e.$options=Dt(Pn(e.constructor),t||{},e),e._renderProxy=e,e._self=e,function(t){var e=t.$options,n=e.parent;if(n&&!e.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(t)}t.$parent=n,t.$root=n?n.$root:t,t.$children=[],t.$refs={},t._watcher=null,t._inactive=null,t._directInactive=!1,t._isMounted=!1,t._isDestroyed=!1,t._isBeingDestroyed=!1}(e),function(t){t._events=Object.create(null),t._hasHookEvent=!1;var e=t.$options._parentListeners;e&&Je(t,e)}(e),function(t){t._vnode=null,t._staticTrees=null;var e=t.$options,n=t.$vnode=e._parentVnode,o=n&&n.context;t.$slots=de(e._renderChildren,o),t.$scopedSlots=r,t._c=function(e,n,r,o){return Fe(t,e,n,r,o,!1)},t.$createElement=function(e,n,r,o){return Fe(t,e,n,r,o,!0)};var i=n&&n.data;St(t,"$attrs",i&&i.attrs||r,null,!0),St(t,"$listeners",e._parentListeners||r,null,!0)}(e),tn(e,"beforeCreate"),function(t){var e=pe(t.$options.inject,t);e&&(Pt(!1),Object.keys(e).forEach((function(n){St(t,n,e[n])})),Pt(!0))}(e),mn(e),function(t){var e=t.$options.provide;e&&(t._provided="function"==typeof e?e.call(t):e)}(e),tn(e,"created"),e.$options.el&&e.$mount(e.$options.el)}}(kn),function(t){var e={get:function(){return this._data}},n={get:function(){return this._props}};Object.defineProperty(t.prototype,"$data",e),Object.defineProperty(t.prototype,"$props",n),t.prototype.$set=Et,t.prototype.$delete=jt,t.prototype.$watch=function(t,e,n){if(c(e))return _n(this,t,e,n);(n=n||{}).user=!0;var r=new dn(this,t,e,n);if(n.immediate){var o='callback for immediate watcher "'+r.expression+'"';pt(),Vt(e,this,[r.value],this,o),dt()}return function(){r.teardown()}}}(kn),function(t){var e=/^hook:/;t.prototype.$on=function(t,n){var r=this;if(Array.isArray(t))for(var o=0,i=t.length;o1?j(n):n;for(var r=j(arguments,1),o='event handler for "'+t+'"',i=0,a=n.length;iparseInt(this.max)&&An(t,e[0],e,this._vnode),this.vnodeToCache=null}}},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var t in this.cache)An(this.cache,t,this.keys)},mounted:function(){var t=this;this.cacheVNode(),this.$watch("include",(function(e){jn(t,(function(t){return En(e,t)}))})),this.$watch("exclude",(function(e){jn(t,(function(t){return!En(e,t)}))}))},updated:function(){this.cacheVNode()},render:function(){var t=this.$slots.default,e=We(t),n=e&&e.componentOptions;if(n){var r=Sn(n),o=this.include,i=this.exclude;if(o&&(!r||!En(o,r))||i&&r&&En(i,r))return e;var a=this.cache,l=this.keys,s=null==e.key?n.Ctor.cid+(n.tag?"::"+n.tag:""):e.key;a[s]?(e.componentInstance=a[s].componentInstance,y(l,s),l.push(s)):(this.vnodeToCache=e,this.keyToCache=s),e.data.keepAlive=!0}return e||t&&t[0]}}};!function(t){var e={get:function(){return q}};Object.defineProperty(t,"config",e),t.util={warn:st,extend:A,mergeOptions:Dt,defineReactive:St},t.set=Et,t.delete=jt,t.nextTick=ne,t.observable=function(t){return Ot(t),t},t.options=Object.create(null),I.forEach((function(e){t.options[e+"s"]=Object.create(null)})),t.options._base=t,A(t.options.components,Ln),function(t){t.use=function(t){var e=this._installedPlugins||(this._installedPlugins=[]);if(e.indexOf(t)>-1)return this;var n=j(arguments,1);return n.unshift(this),"function"==typeof t.install?t.install.apply(t,n):"function"==typeof t&&t.apply(null,n),e.push(t),this}}(t),function(t){t.mixin=function(t){return this.options=Dt(this.options,t),this}}(t),On(t),function(t){I.forEach((function(e){t[e]=function(t,n){return n?("component"===e&&c(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&"function"==typeof n&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}}))}(t)}(kn),Object.defineProperty(kn.prototype,"$isServer",{get:rt}),Object.defineProperty(kn.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(kn,"FunctionalRenderContext",{value:Me}),kn.version="2.6.14";var $n=m("style,class"),Tn=m("input,textarea,option,select,progress"),Mn=m("contenteditable,draggable,spellcheck"),Rn=m("events,caret,typing,plaintext-only"),Dn=m("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,truespeed,typemustmatch,visible"),In="http://www.w3.org/1999/xlink",Un=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},qn=function(t){return Un(t)?t.slice(6,t.length):""},Nn=function(t){return null==t||!1===t};function Fn(t){for(var e=t.data,n=t,r=t;i(r.componentInstance);)(r=r.componentInstance._vnode)&&r.data&&(e=zn(r.data,e));for(;i(n=n.parent);)n&&n.data&&(e=zn(e,n.data));return function(t,e){if(i(t)||i(e))return Bn(t,Vn(e));return""}(e.staticClass,e.class)}function zn(t,e){return{staticClass:Bn(t.staticClass,e.staticClass),class:i(t.class)?[t.class,e.class]:e.class}}function Bn(t,e){return t?e?t+" "+e:t:e||""}function Vn(t){return Array.isArray(t)?function(t){for(var e,n="",r=0,o=t.length;r-1?dr(t,e,n):Dn(e)?Nn(n)?t.removeAttribute(e):(n="allowfullscreen"===e&&"EMBED"===t.tagName?"true":e,t.setAttribute(e,n)):Mn(e)?t.setAttribute(e,function(t,e){return Nn(e)||"false"===e?"false":"contenteditable"===t&&Rn(e)?e:"true"}(e,n)):Un(e)?Nn(n)?t.removeAttributeNS(In,qn(e)):t.setAttributeNS(In,e,n):dr(t,e,n)}function dr(t,e,n){if(Nn(n))t.removeAttribute(e);else{if(J&&!K&&"TEXTAREA"===t.tagName&&"placeholder"===e&&""!==n&&!t.__ieph){var r=function(e){e.stopImmediatePropagation(),t.removeEventListener("input",r)};t.addEventListener("input",r),t.__ieph=!0}t.setAttribute(e,n)}}var hr={create:fr,update:fr};function vr(t,e){var n=e.elm,r=e.data,a=t.data;if(!(o(r.staticClass)&&o(r.class)&&(o(a)||o(a.staticClass)&&o(a.class)))){var l=Fn(e),s=n._transitionClasses;i(s)&&(l=Bn(l,Vn(s))),l!==n._prevClass&&(n.setAttribute("class",l),n._prevClass=l)}}var mr,gr={create:vr,update:vr};function yr(t,e,n){var r=mr;return function o(){var i=e.apply(null,arguments);null!==i&&_r(t,o,n,r)}}var br=Gt&&!(Z&&Number(Z[1])<=53);function xr(t,e,n,r){if(br){var o=sn,i=e;e=i._wrapper=function(t){if(t.target===t.currentTarget||t.timeStamp>=o||t.timeStamp<=0||t.target.ownerDocument!==document)return i.apply(this,arguments)}}mr.addEventListener(t,e,et?{capture:n,passive:r}:n)}function _r(t,e,n,r){(r||mr).removeEventListener(t,e._wrapper||e,n)}function wr(t,e){if(!o(t.data.on)||!o(e.data.on)){var n=e.data.on||{},r=t.data.on||{};mr=e.elm,function(t){if(i(t.__r)){var e=J?"change":"input";t[e]=[].concat(t.__r,t[e]||[]),delete t.__r}i(t.__c)&&(t.change=[].concat(t.__c,t.change||[]),delete t.__c)}(n),le(n,r,xr,_r,yr,e.context),mr=void 0}}var Pr,kr={create:wr,update:wr};function Or(t,e){if(!o(t.data.domProps)||!o(e.data.domProps)){var n,r,a=e.elm,l=t.data.domProps||{},s=e.data.domProps||{};for(n in i(s.__ob__)&&(s=e.data.domProps=A({},s)),l)n in s||(a[n]="");for(n in s){if(r=s[n],"textContent"===n||"innerHTML"===n){if(e.children&&(e.children.length=0),r===l[n])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===n&&"PROGRESS"!==a.tagName){a._value=r;var u=o(r)?"":String(r);Sr(a,u)&&(a.value=u)}else if("innerHTML"===n&&Qn(a.tagName)&&o(a.innerHTML)){(Pr=Pr||document.createElement("div")).innerHTML=""+r+"";for(var c=Pr.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;c.firstChild;)a.appendChild(c.firstChild)}else if(r!==l[n])try{a[n]=r}catch(t){}}}}function Sr(t,e){return!t.composing&&("OPTION"===t.tagName||function(t,e){var n=!0;try{n=document.activeElement!==t}catch(t){}return n&&t.value!==e}(t,e)||function(t,e){var n=t.value,r=t._vModifiers;if(i(r)){if(r.number)return v(n)!==v(e);if(r.trim)return n.trim()!==e.trim()}return n!==e}(t,e))}var Er={create:Or,update:Or},jr=_((function(t){var e={},n=/:(.+)/;return t.split(/;(?![^(]*\))/g).forEach((function(t){if(t){var r=t.split(n);r.length>1&&(e[r[0].trim()]=r[1].trim())}})),e}));function Ar(t){var e=Cr(t.style);return t.staticStyle?A(t.staticStyle,e):e}function Cr(t){return Array.isArray(t)?C(t):"string"==typeof t?jr(t):t}var Lr,$r=/^--/,Tr=/\s*!important$/,Mr=function(t,e,n){if($r.test(e))t.style.setProperty(e,n);else if(Tr.test(n))t.style.setProperty(S(e),n.replace(Tr,""),"important");else{var r=Dr(e);if(Array.isArray(n))for(var o=0,i=n.length;o-1?e.split(qr).forEach((function(e){return t.classList.add(e)})):t.classList.add(e);else{var n=" "+(t.getAttribute("class")||"")+" ";n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}}function Fr(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(qr).forEach((function(e){return t.classList.remove(e)})):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else{for(var n=" "+(t.getAttribute("class")||"")+" ",r=" "+e+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?t.setAttribute("class",n):t.removeAttribute("class")}}function zr(t){if(t){if("object"==typeof t){var e={};return!1!==t.css&&A(e,Br(t.name||"v")),A(e,t),e}return"string"==typeof t?Br(t):void 0}}var Br=_((function(t){return{enterClass:t+"-enter",enterToClass:t+"-enter-to",enterActiveClass:t+"-enter-active",leaveClass:t+"-leave",leaveToClass:t+"-leave-to",leaveActiveClass:t+"-leave-active"}})),Vr=W&&!K,Wr="transition",Hr="transitionend",Qr="animation",Gr="animationend";Vr&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(Wr="WebkitTransition",Hr="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Qr="WebkitAnimation",Gr="webkitAnimationEnd"));var Jr=W?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(t){return t()};function Kr(t){Jr((function(){Jr(t)}))}function Yr(t,e){var n=t._transitionClasses||(t._transitionClasses=[]);n.indexOf(e)<0&&(n.push(e),Nr(t,e))}function Xr(t,e){t._transitionClasses&&y(t._transitionClasses,e),Fr(t,e)}function Zr(t,e,n){var r=eo(t,e),o=r.type,i=r.timeout,a=r.propCount;if(!o)return n();var l="transition"===o?Hr:Gr,s=0,u=function(){t.removeEventListener(l,c),n()},c=function(e){e.target===t&&++s>=a&&u()};setTimeout((function(){s0&&(n="transition",c=a,f=i.length):"animation"===e?u>0&&(n="animation",c=u,f=s.length):f=(n=(c=Math.max(a,u))>0?a>u?"transition":"animation":null)?"transition"===n?i.length:s.length:0,{type:n,timeout:c,propCount:f,hasTransform:"transition"===n&&to.test(r[Wr+"Property"])}}function no(t,e){for(;t.length1}function so(t,e){!0!==e.data.show&&oo(e)}var uo=function(t){var e,n,r={},s=t.modules,u=t.nodeOps;for(e=0;eh?b(t,o(n[g+1])?null:n[g+1].elm,n,d,g,r):d>g&&_(e,p,h)}(p,m,g,n,c):i(g)?(i(t.text)&&u.setTextContent(p,""),b(p,null,g,0,g.length-1,n)):i(m)?_(m,0,m.length-1):i(t.text)&&u.setTextContent(p,""):t.text!==e.text&&u.setTextContent(p,e.text),i(h)&&i(d=h.hook)&&i(d=d.postpatch)&&d(t,e)}}}function O(t,e,n){if(a(n)&&i(t.parent))t.parent.data.pendingInsert=e;else for(var r=0;r-1,a.selected!==i&&(a.selected=i);else if(M(vo(a),r))return void(t.selectedIndex!==l&&(t.selectedIndex=l));o||(t.selectedIndex=-1)}}function ho(t,e){return e.every((function(e){return!M(e,t)}))}function vo(t){return"_value"in t?t._value:t.value}function mo(t){t.target.composing=!0}function go(t){t.target.composing&&(t.target.composing=!1,yo(t.target,"input"))}function yo(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)}function bo(t){return!t.componentInstance||t.data&&t.data.transition?t:bo(t.componentInstance._vnode)}var xo={model:co,show:{bind:function(t,e,n){var r=e.value,o=(n=bo(n)).data&&n.data.transition,i=t.__vOriginalDisplay="none"===t.style.display?"":t.style.display;r&&o?(n.data.show=!0,oo(n,(function(){t.style.display=i}))):t.style.display=r?i:"none"},update:function(t,e,n){var r=e.value;!r!=!e.oldValue&&((n=bo(n)).data&&n.data.transition?(n.data.show=!0,r?oo(n,(function(){t.style.display=t.__vOriginalDisplay})):io(n,(function(){t.style.display="none"}))):t.style.display=r?t.__vOriginalDisplay:"none")},unbind:function(t,e,n,r,o){o||(t.style.display=t.__vOriginalDisplay)}}},_o={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function wo(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?wo(We(e.children)):t}function Po(t){var e={},n=t.$options;for(var r in n.propsData)e[r]=t[r];var o=n._parentListeners;for(var i in o)e[P(i)]=o[i];return e}function ko(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}var Oo=function(t){return t.tag||ve(t)},So=function(t){return"show"===t.name},Eo={name:"transition",props:_o,abstract:!0,render:function(t){var e=this,n=this.$slots.default;if(n&&(n=n.filter(Oo)).length){0;var r=this.mode;0;var o=n[0];if(function(t){for(;t=t.parent;)if(t.data.transition)return!0}(this.$vnode))return o;var i=wo(o);if(!i)return o;if(this._leaving)return ko(t,o);var a="__transition-"+this._uid+"-";i.key=null==i.key?i.isComment?a+"comment":a+i.tag:l(i.key)?0===String(i.key).indexOf(a)?i.key:a+i.key:i.key;var s=(i.data||(i.data={})).transition=Po(this),u=this._vnode,c=wo(u);if(i.data.directives&&i.data.directives.some(So)&&(i.data.show=!0),c&&c.data&&!function(t,e){return e.key===t.key&&e.tag===t.tag}(i,c)&&!ve(c)&&(!c.componentInstance||!c.componentInstance._vnode.isComment)){var f=c.data.transition=A({},s);if("out-in"===r)return this._leaving=!0,se(f,"afterLeave",(function(){e._leaving=!1,e.$forceUpdate()})),ko(t,o);if("in-out"===r){if(ve(i))return u;var p,d=function(){p()};se(s,"afterEnter",d),se(s,"enterCancelled",d),se(f,"delayLeave",(function(t){p=t}))}}return o}}},jo=A({tag:String,moveClass:String},_o);function Ao(t){t.elm._moveCb&&t.elm._moveCb(),t.elm._enterCb&&t.elm._enterCb()}function Co(t){t.data.newPos=t.elm.getBoundingClientRect()}function Lo(t){var e=t.data.pos,n=t.data.newPos,r=e.left-n.left,o=e.top-n.top;if(r||o){t.data.moved=!0;var i=t.elm.style;i.transform=i.WebkitTransform="translate("+r+"px,"+o+"px)",i.transitionDuration="0s"}}delete jo.mode;var $o={Transition:Eo,TransitionGroup:{props:jo,beforeMount:function(){var t=this,e=this._update;this._update=function(n,r){var o=Ye(t);t.__patch__(t._vnode,t.kept,!1,!0),t._vnode=t.kept,o(),e.call(t,n,r)}},render:function(t){for(var e=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,o=this.$slots.default||[],i=this.children=[],a=Po(this),l=0;l-1?Jn[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:Jn[t]=/HTMLUnknownElement/.test(e.toString())},A(kn.options.directives,xo),A(kn.options.components,$o),kn.prototype.__patch__=W?uo:L,kn.prototype.$mount=function(t,e){return function(t,e,n){var r;return t.$el=e,t.$options.render||(t.$options.render=mt),tn(t,"beforeMount"),r=function(){t._update(t._render(),n)},new dn(t,r,L,{before:function(){t._isMounted&&!t._isDestroyed&&tn(t,"beforeUpdate")}},!0),n=!1,null==t.$vnode&&(t._isMounted=!0,tn(t,"mounted")),t}(this,t=t&&W?function(t){if("string"==typeof t){var e=document.querySelector(t);return e||document.createElement("div")}return t}(t):void 0,e)},W&&setTimeout((function(){q.devtools&&ot&&ot.emit("init",kn)}),0),e.default=kn},function(t,e,n){var r=n(3),o=n(28).f,i=n(17),a=n(14),l=n(81),s=n(125),u=n(105);t.exports=function(t,e){var n,c,f,p,d,h=t.target,v=t.global,m=t.stat;if(n=v?r:m?r[h]||l(h,{}):(r[h]||{}).prototype)for(c in e){if(p=e[c],f=t.noTargetGet?(d=o(n,c))&&d.value:n[c],!u(v?c:h+(m?".":"#")+c,t.forced)&&void 0!==f){if(typeof p==typeof f)continue;s(p,f)}(t.sham||f&&f.sham)&&i(p,"sham",!0),a(n,c,p,t)}}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){var n=function(t){return t&&t.Math==Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof global&&global)||function(){return this}()||Function("return this")()},function(t,e,n){var r=n(3),o=n(55),i=n(8),a=n(56),l=n(82),s=n(119),u=o("wks"),c=r.Symbol,f=s?c:c&&c.withoutSetter||a;t.exports=function(t){return i(u,t)&&(l||"string"==typeof u[t])||(l&&i(c,t)?u[t]=c[t]:u[t]=f("Symbol."+t)),u[t]}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){var r=n(5);t.exports=function(t){if(!r(t))throw TypeError(String(t)+" is not an object");return t}},function(t,e,n){var r=n(90),o=n(14),i=n(209);r||o(Object.prototype,"toString",i,{unsafe:!0})},function(t,e,n){var r=n(12),o={}.hasOwnProperty;t.exports=Object.hasOwn||function(t,e){return o.call(r(t),e)}},function(t,e,n){var r=n(2);t.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(t,e,n){var r=n(9),o=n(120),i=n(6),a=n(57),l=Object.defineProperty;e.f=r?l:function(t,e,n){if(i(t),e=a(e),i(n),o)try{return l(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){"use strict";var r=n(139).charAt,o=n(16),i=n(27),a=n(124),l=i.set,s=i.getterFor("String Iterator");a(String,"String",(function(t){l(this,{type:"String Iterator",string:o(t),index:0})}),(function(){var t,e=s(this),n=e.string,o=e.index;return o>=n.length?{value:void 0,done:!0}:(t=r(n,o),e.index+=t.length,{value:t,done:!1})}))},function(t,e,n){var r=n(22);t.exports=function(t){return Object(r(t))}},function(t,e,n){var r=n(60),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},function(t,e,n){var r=n(3),o=n(17),i=n(8),a=n(81),l=n(86),s=n(27),u=s.get,c=s.enforce,f=String(String).split("String");(t.exports=function(t,e,n,l){var s,u=!!l&&!!l.unsafe,p=!!l&&!!l.enumerable,d=!!l&&!!l.noTargetGet;"function"==typeof n&&("string"!=typeof e||i(n,"name")||o(n,"name",e),(s=c(n)).source||(s.source=f.join("string"==typeof e?e:""))),t!==r?(u?!d&&t[e]&&(p=!0):delete t[e],p?t[e]=n:o(t,e,n)):p?t[e]=n:a(e,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&u(this).source||l(this)}))},function(t,e,n){var r=n(3),o=n(140),i=n(118),a=n(17),l=n(4),s=l("iterator"),u=l("toStringTag"),c=i.values;for(var f in o){var p=r[f],d=p&&p.prototype;if(d){if(d[s]!==c)try{a(d,s,c)}catch(t){d[s]=c}if(d[u]||a(d,u,f),o[f])for(var h in i)if(d[h]!==i[h])try{a(d,h,i[h])}catch(t){d[h]=i[h]}}}},function(t,e,n){var r=n(58);t.exports=function(t){if(r(t))throw TypeError("Cannot convert a Symbol value to a string");return String(t)}},function(t,e,n){var r=n(9),o=n(10),i=n(44);t.exports=r?function(t,e,n){return o.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e){var n=Array.isArray;t.exports=n},function(t,e,n){var r=n(39),o=n(22);t.exports=function(t){return r(o(t))}},function(t,e,n){var r=n(3),o=function(t){return"function"==typeof t?t:void 0};t.exports=function(t,e){return arguments.length<2?o(r[t]):r[t]&&r[t][e]}},function(t,e,n){var r=n(152),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();t.exports=i},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,e){t.exports=!1},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}},function(t,e,n){var r=n(63),o=n(39),i=n(12),a=n(13),l=n(141),s=[].push,u=function(t){var e=1==t,n=2==t,u=3==t,c=4==t,f=6==t,p=7==t,d=5==t||f;return function(h,v,m,g){for(var y,b,x=i(h),_=o(x),w=r(v,m,3),P=a(_.length),k=0,O=g||l,S=e?O(h,P):n||p?O(h,0):void 0;P>k;k++)if((d||k in _)&&(b=w(y=_[k],k,x),t))if(e)S[k]=b;else if(b)switch(t){case 3:return!0;case 5:return y;case 6:return k;case 2:s.call(S,y)}else switch(t){case 4:return!1;case 7:s.call(S,y)}return f?-1:u||c?c:S}};t.exports={forEach:u(0),map:u(1),filter:u(2),some:u(3),every:u(4),find:u(5),findIndex:u(6),filterReject:u(7)}},function(t,e,n){var r=n(238),o=n(241);t.exports=function(t,e){var n=o(t,e);return r(n)?n:void 0}},function(t,e,n){var r,o,i,a=n(193),l=n(3),s=n(5),u=n(17),c=n(8),f=n(80),p=n(61),d=n(42),h=l.WeakMap;if(a||f.state){var v=f.state||(f.state=new h),m=v.get,g=v.has,y=v.set;r=function(t,e){if(g.call(v,t))throw new TypeError("Object already initialized");return e.facade=t,y.call(v,t,e),e},o=function(t){return m.call(v,t)||{}},i=function(t){return g.call(v,t)}}else{var b=p("state");d[b]=!0,r=function(t,e){if(c(t,b))throw new TypeError("Object already initialized");return e.facade=t,u(t,b,e),e},o=function(t){return c(t,b)?t[b]:{}},i=function(t){return c(t,b)}}t.exports={set:r,get:o,has:i,enforce:function(t){return i(t)?o(t):r(t,{})},getterFor:function(t){return function(e){var n;if(!s(e)||(n=o(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}}},function(t,e,n){var r=n(9),o=n(87),i=n(44),a=n(19),l=n(57),s=n(8),u=n(120),c=Object.getOwnPropertyDescriptor;e.f=r?c:function(t,e){if(t=a(t),e=l(e),u)try{return c(t,e)}catch(t){}if(s(t,e))return i(!o.f.call(t,e),t[e])}},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){var r,o=n(6),i=n(190),a=n(85),l=n(42),s=n(123),u=n(83),c=n(61),f=c("IE_PROTO"),p=function(){},d=function(t){return" + diff --git a/community/contributing/documentation.html b/community/contributing/documentation.html index f0f0dba38..04e8a2443 100644 --- a/community/contributing/documentation.html +++ b/community/contributing/documentation.html @@ -6,7 +6,7 @@ Documentation | Ontop - + @@ -49,11 +49,11 @@ # start the local server yarn docs:dev # commit your changes and push them back to Github -

VuePress (opens new window) requires Node.js >= 8.6.

VuePress (opens new window) requires Node.js >= 8.6.

- + diff --git a/community/contributing/index.html b/community/contributing/index.html index 3652fc623..2fc8d507f 100644 --- a/community/contributing/index.html +++ b/community/contributing/index.html @@ -6,7 +6,7 @@ How to contribute | Ontop - + @@ -42,7 +42,7 @@ Work with us GitHub - (opens new window)

# How to contribute

Contributions from the community are essential for an open-source project like Ontop and are warmly welcomed.

You can contribute in many differents ways, including:

- + diff --git a/community/contributing/pull-request.html b/community/contributing/pull-request.html index e91389254..6a8f2ce02 100644 --- a/community/contributing/pull-request.html +++ b/community/contributing/pull-request.html @@ -6,7 +6,7 @@ Pull request | Ontop - + @@ -42,7 +42,7 @@ Work with us GitHub - (opens new window)

# Pull request

Contributions to the project are welcome and encouraged. You can propose some Pull Requests (PR) on Github. By making a PR on the Github platform, you declare to agree with the standard "inbound = outbound" licensing practice, as foreseen by the Github terms (opens new window). There is no need anymore for regular contributors to sign a CLA.

If you are thinking about implementing a new feature, feel free to engage a discussion with the team through the mailing list or through another medium.

# Contribution License Agreement (for core developers)

Core developers should sign a Contribution License Agreement (CLA) that allows FUB and the Ontop team to redistribute their work under the terms of the Apache 2.0 license. If the contributor works for an institution that owns the work being contributed by the contributor, then a corporate CLA must be additionally signed. The CLAs are available for download below, once signed please email a scanned copy of them.

- + diff --git a/community/index.html b/community/index.html index 676859132..4a1e66666 100644 --- a/community/index.html +++ b/community/index.html @@ -6,7 +6,7 @@ People | Ontop - + @@ -43,11 +43,11 @@ GitHub (opens new window)

# People

Ontop has been initiated by the eponymous research group at the Free University of Bozen-Bolzano which is still highly involved into the development of the project and into the research around it. Over the years, new members from diverse horizons have joined the project, forming a vibrant international community.

Here we list the people who has been involved in the development of the Ontop project. -For the research side, see the dedicated page.

# Active Core Team Members

The development of Ontop is guided by an international team (reverse lexicographical order).

# Core Team Emeriti

Here we honor some no-longer-active core team members who have made important contributions in the past.

# Contributors

Some members of the Ontop community have so enriched it, that they deserve special mention.

  • Lukas Sundqvist
  • Mindaugas Slusnys
  • Damian Rovara
  • Sergey Pugacs
  • Tomas Kovachev
  • Dag Hovland
  • Manfred Gerstgrasser
  • Uğur Dönmez
  • Timea Bagosi
- + diff --git a/community/organizations.html b/community/organizations.html index 832e3e54e..20bc38853 100644 --- a/community/organizations.html +++ b/community/organizations.html @@ -6,7 +6,7 @@ Organizations | Ontop - + @@ -47,7 +47,7 @@ Ontopic provides a no-code mapping editor, Ontopic Studio, (opens new window) and professional services.

# Birkbeck, University of London

The Birkbeck (opens new window) group have been extensively involved in the development of Ontop since 2012. They have worked on the theoretical foundations of the VKG approach, including -query rewriting and optimisation, and contributed to the code base.

- + diff --git a/community/support.html b/community/support.html index 00ed33e06..8324ba02d 100644 --- a/community/support.html +++ b/community/support.html @@ -6,7 +6,7 @@ Support | Ontop - + @@ -42,7 +42,7 @@ Work with us GitHub - (opens new window)

# Support

# FAQ

Please visit our pages about Frequently Asked Questions.

# Mailing list (Google group)

We have a mailing list (Google group) (opens new window) for anything related to support, discussion and announcements. Please join for any inquiry.

# Bug tracking system

To see the list of open issues/bugs, visit our GitHub tracker (opens new window)

# Commercial support

Ontopic (opens new window) is offering commercial support for Ontop.

- + diff --git a/dev/build.html b/dev/build.html index 1650ba46d..5f9824156 100644 --- a/dev/build.html +++ b/dev/build.html @@ -6,7 +6,7 @@ Build Ontop Bundles | Ontop - + @@ -60,7 +60,7 @@

The command compiles Ontop modules and generates the Ontop bundles distributed on GitHub, whose files are written in two directories.

Under build/distribution/target/:

  • ontop-cli-[ontop-version].zip - libraries/scripts to use ontop from the command line and setup a SPARQL endpoint;

Under protege/distribution/target/:

  • it.unibz.inf.ontop.protege-[ontop-version].jar - plugin for Protégé 5.x installation files (drop it in Protégé’s plugins folder);
  • ontop-protege-bundle-platform-independent-[ontop-version].zip - Protégé 5.x bundled with Ontop plugin and ready to run (just unzip and use the run.sh or run.bat scripts);
  • ontop-protege-bundle-linux-[ontop-version].zip - as above, for Linux;
  • ontop-protege-bundle-os-x-[ontop-version].zip - as above, for Mac OS X;
  • ontop-protege-bundle-win-[ontop-version].zip - as above, for Windows.

Notes:

  • profile activation -Prelease enables the generation of all the Ontop bundles as well as source code and Javadoc JARs needed for publishing on Maven Central (if this profile is omitted, only JAR files for Ontop binaries are created);
  • option -Dmaven.test.skip disables the compiling and execution of unit and integration tests (generally performed at release time) to speed up the process - omit it to enable tests, e.g., for testing changes to source code (note: may also use -DskipTests that disables executing tests, but still compiles them);
  • the build may be performed also by running script build-release.sh (build-release.cmd on Windows), which works also in older Ontop versions (4.0.3 or earlier). In these older versions, the script generates bundles in sub-directories ontop-cli, ontop-protege, and ontop-webapps of directory build/distribution, and also generates bundles for Jetty 9 + RDF4J workbench + Ontop and for Tomcat 8 + RDF4J workbench + Ontop. These bundles have been deprecated in Ontop 4 (opens new window) and completely removed since Ontop 5 (opens new window).

# Build specific bundles

Starting from version 4.1 and further revised in version 5.0.2, we provide Maven profiles to build specific Ontop bundles as quickly as possible (with respect to using the above 'build all' command), which may come in handy when modifying Ontop source code. Specifically:

  • to build the Ontop command line tool only, i.e., ontop-cli-[ontop-version].zip (note: up to version 5.0.1, asset-cli was cli and tests were disabled by default)

    $ mvn -Dmaven.test.skip -Passet-cli
     
  • to build the Ontop Protégé plugin, i.e., it.unibz.inf.ontop.protege-[ontop-version].jar (profile available since version 5.0.2)

    $ mvn -Dmaven.test.skip -Passet-plugin
     
  • to build the Ontop Protégé plugin it.unibz.inf.ontop.protege-[ontop-version].jar as well as the ontop-protege-bundle-[platform]-[ontop-version].zip Protégé bundles including it (note: up to version 5.0.1, asset-protege was protege and tests were disabled by default)

    $ mvn -Dmaven.test.skip -Passet-protege
    -

The Maven profiles asset-cli, asset-plugin, asset-protege employed in the commands above exclude unneeded artifacts from the build, which is thus faster. These profiles can be arbitrarily combined to produce multiple bundles, e.g., mvn -Passet-cli,asset-protege to generate both command line tool and Protégé bundles (from version 4.1 up to version 5 excluded, it was possible to build the RDF4 workbench + Ontop files by enabling profile webapps, now removed).

# Compiling the Ontop Protégé plugin

Starting from version 5.0.2, it is necessary to enable profile plugin (or a profile depending on it, such as asset-plugin, asset-protege, or release) in order to compile ontop-protege-plugin. Note that commands mvn compile and mvn test will not work with profile plugin (or a depending profile) since compiling/testing ontop-protege-plugin requires building ontop-protege-dependencies:shaded first to relocate Guava via the Maven shade plugin (opens new window), but this happens only during the package lifecycle phase of Maven, i.e., starting from mvn package or later phase. Unfortunately, relocating Guava is needed to avoid conflicts with the older Guava version used in Protégé and cannot be avoided, and doing that before the package phase is not feasible. Therefore, developers should always use mvn package -Pplugin or later phase when working with ontop-protege-plugin, even when just compiling or testing is intended.

# Other useful Maven commands

The following Maven commands can be used to facilitate some build-related development tasks, the involved plugins (e.g., license-maven-plugin) being already configured in Ontop root pom.xml file:

  • mvn license:add-third-party - produces a report file build/distribution/THIRD-PARTY.txt useful to verify the use of Java libraries with compatible licenses
  • mvn org.codehaus.mojo:versions-maven-plugin:display-plugin-updates - check for Maven plugins that can be updated
  • mvn org.codehaus.mojo:versions-maven-plugin:display-dependency-updates - check for dependencies that can be updated
  • mvn dependency:analyze-duplicate - check there are no duplicate dependencies declared in pom.xml files
  • mvn dependency:analyze-dep-mgt - check that dependency versions under centralized <dependencyManagement> sections are not overridden in child pom.xml files
  • mvn dependency:analyze - check for used and undeclared dependencies and for unused and declared dependencies (both situations that should be avoided)
  • mvn com.github.ekryd.sortpom:sortpom-maven-plugin:sort - sorts section of pom.xml files, to improve consistency
  • mvn net.revelc.code.formatter:formatter-maven-plugin:format - auto-formats the pom.xml files, to improve consistency

The Maven profiles asset-cli, asset-plugin, asset-protege employed in the commands above exclude unneeded artifacts from the build, which is thus faster. These profiles can be arbitrarily combined to produce multiple bundles, e.g., mvn -Passet-cli,asset-protege to generate both command line tool and Protégé bundles (from version 4.1 up to version 5 excluded, it was possible to build the RDF4 workbench + Ontop files by enabling profile webapps, now removed).

# Compiling the Ontop Protégé plugin

Starting from version 5.0.2, it is necessary to enable profile plugin (or a profile depending on it, such as asset-plugin, asset-protege, or release) in order to compile ontop-protege-plugin. Note that commands mvn compile and mvn test will not work with profile plugin (or a depending profile) since compiling/testing ontop-protege-plugin requires building ontop-protege-dependencies:shaded first to relocate Guava via the Maven shade plugin (opens new window), but this happens only during the package lifecycle phase of Maven, i.e., starting from mvn package or later phase. Unfortunately, relocating Guava is needed to avoid conflicts with the older Guava version used in Protégé and cannot be avoided, and doing that before the package phase is not feasible. Therefore, developers should always use mvn package -Pplugin or later phase when working with ontop-protege-plugin, even when just compiling or testing is intended.

# Other useful Maven commands

The following Maven commands can be used to facilitate some build-related development tasks, the involved plugins (e.g., license-maven-plugin) being already configured in Ontop root pom.xml file:

  • mvn license:add-third-party - produces a report file build/distribution/THIRD-PARTY.txt useful to verify the use of Java libraries with compatible licenses
  • mvn org.codehaus.mojo:versions-maven-plugin:display-plugin-updates - check for Maven plugins that can be updated
  • mvn org.codehaus.mojo:versions-maven-plugin:display-dependency-updates - check for dependencies that can be updated
  • mvn dependency:analyze-duplicate - check there are no duplicate dependencies declared in pom.xml files
  • mvn dependency:analyze-dep-mgt - check that dependency versions under centralized <dependencyManagement> sections are not overridden in child pom.xml files
  • mvn dependency:analyze - check for used and undeclared dependencies and for unused and declared dependencies (both situations that should be avoided)
  • mvn com.github.ekryd.sortpom:sortpom-maven-plugin:sort - sorts section of pom.xml files, to improve consistency
  • mvn net.revelc.code.formatter:formatter-maven-plugin:format - auto-formats the pom.xml files, to improve consistency
- + diff --git a/dev/db-adapter.html b/dev/db-adapter.html index e7682f335..c8c3dd8b1 100644 --- a/dev/db-adapter.html +++ b/dev/db-adapter.html @@ -6,7 +6,7 @@ Support a new database system | Ontop - + @@ -239,7 +239,7 @@ }); } } -
- + diff --git a/dev/debug-jetty.html b/dev/debug-jetty.html index 55e62ec36..af7b133ab 100644 --- a/dev/debug-jetty.html +++ b/dev/debug-jetty.html @@ -6,7 +6,7 @@ Debug Jetty | Ontop - + @@ -43,7 +43,7 @@ GitHub (opens new window)

# Debug Jetty

This page describe debug Jetty with RDF4J workbench plugin in IntelliJ Idea

# Start the Jetty in Debug mode

$ java -Xdebug -agentlib:jdwp=transport=dt_socket,address=9999,server=y,suspend=n -jar start.jar
-

# Linking with IntelliJ

Next we need to link the IntelliJ project with the deployed webapp.

  1. Within IntelliJ, open the project containing the webapp deployed into jetty that you want to debug. SelectRun -> Edit Configurations. Add a new configuration by clicking the "+" icon. Choose Remote. Make sure the port you choose is the same as the one you added in Enable remote debugging.

  2. Next in your webapp you can set a breakpoint within a servlet which when it is tripped will halt the remote jvm's processing thread to await for debugging commands from your IntelliJ instance. To set a breakpoint, simply open the servlet or any other class you want to debug and click left to the line you want to set the breakpoint at (where the red dot is on the next screenshot). The red dot and red background on the line mark the breakpoint.

  3. Accessing that servlet within your browser, pointed at your remote debug configurated jetty-distribution, should transition your IntelliJ instance to the standard debugger view.

# References

  1. http://www.eclipse.org/jetty/documentation/current/enable-remote-debugging.html (opens new window)
  2. http://www.eclipse.org/jetty/documentation/current/debugging-with-intellij.html (opens new window)

# Linking with IntelliJ

Next we need to link the IntelliJ project with the deployed webapp.

  1. Within IntelliJ, open the project containing the webapp deployed into jetty that you want to debug. SelectRun -> Edit Configurations. Add a new configuration by clicking the "+" icon. Choose Remote. Make sure the port you choose is the same as the one you added in Enable remote debugging.

  2. Next in your webapp you can set a breakpoint within a servlet which when it is tripped will halt the remote jvm's processing thread to await for debugging commands from your IntelliJ instance. To set a breakpoint, simply open the servlet or any other class you want to debug and click left to the line you want to set the breakpoint at (where the red dot is on the next screenshot). The red dot and red background on the line mark the breakpoint.

  3. Accessing that servlet within your browser, pointed at your remote debug configurated jetty-distribution, should transition your IntelliJ instance to the standard debugger view.

# References

  1. http://www.eclipse.org/jetty/documentation/current/enable-remote-debugging.html (opens new window)
  2. http://www.eclipse.org/jetty/documentation/current/debugging-with-intellij.html (opens new window)
- + diff --git a/dev/debug-protege.html b/dev/debug-protege.html index e537ce978..8ec3f39eb 100644 --- a/dev/debug-protege.html +++ b/dev/debug-protege.html @@ -6,7 +6,7 @@ Debug Protégé | Ontop - + @@ -49,7 +49,7 @@

Where:

  • clean package forces a full re-build and may be generally omitted (which defaults to running package) unless you encounter build errors, in which case clean helps ruling out they stem from incremental builds;
  • -Dmaven.test.skip disables compiling and executing unit tests;
  • -Passet-plugin activates the generation of the Ontop Protégé plugin (OSGI bundle with all its dependencies), without including other uneeded artifacts (e.g., full ZIP/tar.gz Protégé bundles, source and Javadoc JARs, etc);
  • -pl protege/distribution -am (optional) tells Maven to only build the Ontop Protégé module located in protege/distribution and all the other Ontop modules it depends on, saving another couple of seconds.

Notes:

  • in Ontop versions 4.1 to 5.0.0 excluded, the command above should be replaced by mvn clean package -Dmaven.test.skip -Pprotege -pl client/protege -am;
  • in Ontop version 4.0.3 or earlier, the command above should be replaced by mvn clean install -pl client/protege -am -DskipTests to compile code and install it in local maven repository, followed by mvn bundle:bundle -pl client/protege to package the plugin.

Once the Ontop Protégé plugin is built, it must be copied to the Protégé plugin directory via

$ cp protege/distribution/target/it.unibz.inf.ontop.protege-[ontop-version].jar Protege-[protege-version]/plugins/
 

The command above should replace any previous Ontop Protégé plugin in the plugins directory. In any case, make sure that there is only one Protégé plugin in Protege-[protege-version]/plugins/

# Debug in IntelliJ using the Remote debugger

# IntelliJ configuration

Create a remote configuration:

  • select 'Edit configurations', click '+', then select 'Remote'
  • Host: localhost
  • Port: choose a port number (5005 in what follows)

# Protégé run options

Edit the script Protege-[protege-version]/run.sh (on Windows: run.bat), adding the following JVM option (note that parameter suspend is set to y)

-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005
 

# Run / Debug

Execute Protege-[protege-version]/run.sh (on Windows: run.bat). -Then, from IntelliJ, click on the Debug button (or Shift+F9).

- + diff --git a/dev/git.html b/dev/git.html index b4a4d4ff3..dbaff21c9 100644 --- a/dev/git.html +++ b/dev/git.html @@ -6,7 +6,7 @@ Git workflow | Ontop - + @@ -43,7 +43,7 @@ GitHub (opens new window)

# Git workflow

In the development of Ontop project, we follow the following git-workflow: http://nvie.com/posts/a-successful-git-branching-model/ (opens new window)

A few points:

  • Main development branch: version4. Every commit in this branch is expected to be shipped with the next x.y.0 release.

  • Names of the branches:

    • feature branches: feature/featurename
    • bug fix branches: bugfix/bugname. -
      • If there a corresponding GitHub page, use name bugfix/bugname-issue-number or bugfix/issue-number
    • Maintenance branches for releases: releasing/vx.y (e.g. releasing/v4.0)
  • Use --no-ff option for merging, especially for merging the the feature or bugfix branches to version4

The --no-ff flag causes the merge to always create a new commit object, even if the merge could be performed with a fast-forward. This avoids losing information about the historical existence of a feature branch and groups together all commits that together added the feature.

- + diff --git a/dev/index.html b/dev/index.html index 70d5b5993..46e5e92d8 100644 --- a/dev/index.html +++ b/dev/index.html @@ -6,7 +6,7 @@ Overview | Ontop - + @@ -43,11 +43,11 @@ GitHub (opens new window)

# Overview

The development chapter is targeted to those interested in the development of the Ontop framework.

# How-tos

# Internals

Information about the internals of Ontop

- + diff --git a/dev/internals/guice.html b/dev/internals/guice.html index c9c8d923f..0b1f34eb3 100644 --- a/dev/internals/guice.html +++ b/dev/internals/guice.html @@ -6,7 +6,7 @@ Guice Conventions | Ontop - + @@ -79,7 +79,7 @@ public SimpleRDF() { } ... -

As you see, in the end we reach a constructor without parameters.

In IntelliJ, the name of the properties file binding a specific interface can also be retrieved through the find usages functionality.

As you see, in the end we reach a constructor without parameters.

In IntelliJ, the name of the properties file binding a specific interface can also be retrieved through the find usages functionality.

- + diff --git a/dev/internals/iq.html b/dev/internals/iq.html index ba804aeb8..251568ebc 100644 --- a/dev/internals/iq.html +++ b/dev/internals/iq.html @@ -6,7 +6,7 @@ Intermediate Query (IQ) | Ontop - + @@ -74,7 +74,7 @@ as well as complex mapping assertions (which, in most scenarios, contains SQL queries). -This is also why the rule-based internal representation has been progressively abandoned.

- + diff --git a/dev/new-release.html b/dev/new-release.html index c4e72c668..3f79e5d74 100644 --- a/dev/new-release.html +++ b/dev/new-release.html @@ -6,7 +6,7 @@ Make a new release | Ontop - + @@ -70,7 +70,7 @@ # this step is also for triggering the AutoUpdate of Protege plugin $ git checkout master $ git merge v-number # tag -

# Time for celebration!

  • Send release emails to several mail lists and social media

# Time for celebration!

  • Send release emails to several mail lists and social media
- + diff --git a/dev/outdated/known-issues.html b/dev/outdated/known-issues.html index c636a0f44..83af8d693 100644 --- a/dev/outdated/known-issues.html +++ b/dev/outdated/known-issues.html @@ -6,7 +6,7 @@ Known issues | Ontop - + @@ -69,11 +69,11 @@ a language tag then the language tag will be parsed out of the lexical value. For example, "abc@en"^^rdf:PlainLiteral would be parsed into a lexical value of 'abc' and a language tag of 'en'. "

Thus, if one expects such symbols in an object property the best solutions are:

  1. cast the object to string in the mapping
  2. replace the @ in the query with @.

# Databases and SQL

  • Registered Keywords - when you have a column name that is also a registered DBMS keyword, you should enclose that column name in quotes. Supported common keywords are: cast, do, extract, first, following, last, materialized, nulls, partition, range, row, rows, siblings, value, xml.
  • ORDER BY in H2: in presence of an Union, the last version of H2 (1.4.), it orders both subqueries independently of each other giving wrong results. See SPARQL-compliance test offset-1
  • UNOPTIMIZED SQL OPERATORS/FUNCTIONS: MIN/MAX, CASE, WHEN clause, DATE FUNCTIONS, NESTED SELECTS, MATCHES, RIGHT/FULL/SELF/CARTESIAN JOIN, SUBJOIN, ALL, ANY, UNION, INTERSECT, MINUM and EXCEPT: Unoptimized sql operators will be transformed in view and generate a result.
  • UNSUPPORTED SQL OPERATORS: EXISTS, UNIQUE, TOP
  • REGEX OPERATOR is not supported by MsSQL and DB2, while the other databases handle it differently

# R2RML mappings

WARNING

Are Bnodes supported in the mapping?

  • no support for inverseExpression
  • predicate cannot be uritemplate (column reference or template declaration)
  • object cannot be uritemplate (column reference or template declaration) when predicate is rdf:type
  • no support for bnode in Ontop
  • no support for sqlversion
  • no support for graphMaps (hence context graphs)
  • bnode naming is arbitrary
  • constant type objects are returned as simple literal. Constant-valued term maps are not considered as having a term type, and specifying rr:termType on these term maps has no effect. For example we return "2011-01-04T00:00:00.0" -instead of "2011-01-04T00:00:00.0"^^xsd:dateTime

The current state of the W3C R2RML compliance tests could be seen [[W3C-R2RML-Compliance| here]]

# Ontop Bootstrapper

WARNING

Are Bnodes supported in the mapping?

  • The BNode syntax generated by Ontop bootstrapper cannot be processed by Ontop
  • Foreign keys on multiple columns are not supported
- + diff --git a/dev/stats.html b/dev/stats.html index b8ec9e7d0..efb2375f7 100644 --- a/dev/stats.html +++ b/dev/stats.html @@ -6,7 +6,7 @@ Statistics | Ontop - + @@ -44,7 +44,7 @@ GitHub (opens new window)

# Statistics

# Downloads

# Github releases

For all the versions 4.x:

curl -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/ontop/ontop/releases \
    | jq '[.[] | select((.tag_name | startswith("ontop-4."))) | .assets[] | .download_count ] | add' 
-
- + diff --git a/guide/advanced/caching.html b/guide/advanced/caching.html index 71ce6d866..7cd1616da 100644 --- a/guide/advanced/caching.html +++ b/guide/advanced/caching.html @@ -6,7 +6,7 @@ HTTP caching | Ontop - + @@ -45,7 +45,7 @@ (opens new window)

# HTTP caching

Since 4.1.0.

HTTP caching allows to reduce the load on the SPARQL endpoint and to provide faster responses to clients. It is particularly useful when many clients issue the same queries and data is not updated at a high frequency.

To enable HTTP caching, add the property ontop.http.cacheControl in the properties file. This will cause the insertion of a Cache-Control (opens new window) HTTP header in successful responses, with the specified value.

Example

ontop.http.cacheControl=max-age=60, stale-while-revalidate=20, stale-if-error=300
-

This entry informs the cache that values can be considered as fresh for 60 seconds. After this period, the cache remains allowed to serve cached results for 20 more seconds while revalidating the requests in the background, or for 300 more seconds in case of error with the upstream server.

Ontop does not embed a HTTP cache. We recommend setting up a HTTP cache like Varnish (opens new window) or Nginx (opens new window) above the Ontop endpoint.

# Remarks

  • Most caches (e.g. Nginx but also Web browsers) do not cache POST requests by default. Since most SPARQL queries are sent with the POST method, it is important to turn this option on. This option is safe as Ontop is a read-only system.
  • Consider using the GET method for sending SPARQL queries so as to take advantage from Web browser caches.
  • For an example of configuration for Nginx, see this file (opens new window).

This entry informs the cache that values can be considered as fresh for 60 seconds. After this period, the cache remains allowed to serve cached results for 20 more seconds while revalidating the requests in the background, or for 300 more seconds in case of error with the upstream server.

Ontop does not embed a HTTP cache. We recommend setting up a HTTP cache like Varnish (opens new window) or Nginx (opens new window) above the Ontop endpoint.

# Remarks

  • Most caches (e.g. Nginx but also Web browsers) do not cache POST requests by default. Since most SPARQL queries are sent with the POST method, it is important to turn this option on. This option is safe as Ontop is a read-only system.
  • Consider using the GET method for sending SPARQL queries so as to take advantage from Web browser caches.
  • For an example of configuration for Nginx, see this file (opens new window).
- + diff --git a/guide/advanced/configuration.html b/guide/advanced/configuration.html index 6d019c4bc..4692b184b 100644 --- a/guide/advanced/configuration.html +++ b/guide/advanced/configuration.html @@ -6,7 +6,7 @@ Configuration keys | Ontop - + @@ -42,7 +42,7 @@ Work with us GitHub - (opens new window)

# Configuration keys

Here is a list of the configuration keys which can be set in the properties file.

- + diff --git a/guide/advanced/lenses.html b/guide/advanced/lenses.html index 556654500..b32118c27 100644 --- a/guide/advanced/lenses.html +++ b/guide/advanced/lenses.html @@ -6,7 +6,7 @@ Lenses | Ontop - + @@ -222,7 +222,7 @@
Key Type Description
added Array of Strings List of names of non-nullable columns. One String per column

# IRISafeConstraint

{
     "added": [String]
 }
-
Key Type Description
added Array of Strings List of names of IRI-safe columns. One String per column
Key Type Description
added Array of Strings List of names of IRI-safe columns. One String per column
- + diff --git a/guide/advanced/logging.html b/guide/advanced/logging.html index cf2a87ae8..2a3d54c8e 100644 --- a/guide/advanced/logging.html +++ b/guide/advanced/logging.html @@ -6,7 +6,7 @@ Query logging | Ontop - + @@ -97,7 +97,7 @@ ontop.queryLogging.decomposition=false # Sets that merged messages are only inserted when decomposition is disabled ontop.queryLogging.decompositionAndMergingMutuallyExclusive=true -
- + diff --git a/guide/advanced/predefined.html b/guide/advanced/predefined.html index f82acc6ba..a532067f1 100644 --- a/guide/advanced/predefined.html +++ b/guide/advanced/predefined.html @@ -6,7 +6,7 @@ Predefined query endpoint (beta) | Ontop - + @@ -113,7 +113,7 @@ "@type": "LodgingBusiness", "name": "Alpenblick - Gasthaus" } -

# Entries

# Top-level key

Key Type Description
queries Map of predefined queries Groups predefined queries by id.

# Query keys

Key Type Description
queryType String At the moment, only graph is supported. Corresponds to CONSTRUCT queries.
name String Name of the predefined query.
description String Description of the predefined query.
return404IfEmpty Boolean If true, returns a 404 status code when the result set is empty.
resultStreaming Boolean If true, uses the chunked transfer encoding.
parameters Map of parameters Groups parameters by id.
frame JSON object JSON-LD frame (opens new window)) for shaping the result set when the JSON-LD format is selected.

# Parameter keys

Key Type Description
description String Description of the parameter.
type String Type of the parameter. Can be iri for an IRI, any XSD datatype like xsd:string with the prefix xsd: or the IRI string of an RDF datatype.
safeForRandomGeneration Boolean If true, replacing the parameter value by a random value for generating a "reference" reformulated query can be considered as safe. Replacing afterwards the random value but the real parameter value in the reference reformulated query should produce the expected result. Usually, identifiers are safe while languages are not because the columns to consider differ from a language to another.
required Boolean If true, a value must be given for this parameter in the HTTP request.

# Entries

# Top-level key

Key Type Description
queries Map of predefined queries Groups predefined queries by id.

# Query keys

Key Type Description
queryType String At the moment, only graph is supported. Corresponds to CONSTRUCT queries.
name String Name of the predefined query.
description String Description of the predefined query.
return404IfEmpty Boolean If true, returns a 404 status code when the result set is empty.
resultStreaming Boolean If true, uses the chunked transfer encoding.
parameters Map of parameters Groups parameters by id.
frame JSON object JSON-LD frame (opens new window)) for shaping the result set when the JSON-LD format is selected.

# Parameter keys

Key Type Description
description String Description of the parameter.
type String Type of the parameter. Can be iri for an IRI, any XSD datatype like xsd:string with the prefix xsd: or the IRI string of an RDF datatype.
safeForRandomGeneration Boolean If true, replacing the parameter value by a random value for generating a "reference" reformulated query can be considered as safe. Replacing afterwards the random value but the real parameter value in the reference reformulated query should produce the expected result. Usually, identifiers are safe while languages are not because the columns to consider differ from a language to another.
required Boolean If true, a value must be given for this parameter in the HTTP request.
- + diff --git a/guide/advanced/views.html b/guide/advanced/views.html index 59a9bfa0d..5f78b46a9 100644 --- a/guide/advanced/views.html +++ b/guide/advanced/views.html @@ -6,7 +6,7 @@ Ontop views | Ontop - + @@ -42,7 +42,7 @@ Work with us GitHub - (opens new window)

# Ontop views

Ontop views have been renamed lenses. See the new page.

- + (opens new window)

# Ontop views

Ontop views have been renamed lenses. See the new page.

+ diff --git a/guide/cli.html b/guide/cli.html index 016203d49..92f5ac560 100644 --- a/guide/cli.html +++ b/guide/cli.html @@ -6,7 +6,7 @@ Command Line Interface | Ontop - + @@ -512,7 +512,7 @@ "idFactoryType" : "POSTGRESQL" } } -
- + diff --git a/guide/compliance.html b/guide/compliance.html index 3c5780a9c..532a379d2 100644 --- a/guide/compliance.html +++ b/guide/compliance.html @@ -6,7 +6,7 @@ Standards compliance | Ontop - + @@ -42,7 +42,7 @@ Work with us GitHub - (opens new window)

# Standards compliance

# SPARQL 1.1

Updated for 5.1.0.

In the following table we present a summary of the compliance of the latest version of Ontop with SPARQL 1.1 (opens new window), where rows correspond to sections of the W3C recommendation and unsupported features are crossed out. Most of the features are supported, but some are unsupported or only partially supported.

Section in
SPARQL 1.1
Features Coverage
5. Graph Patterns (opens new window) BGP, FILTER 2/2
6. Including Optional Values (opens new window) OPTIONAL 1/1
7. Matching Alternatives (opens new window) UNION 1/1
8. Negation (opens new window) MINUS, FILTER [NOT] EXISTS 1/2
9. Property Paths (opens new window) PredicatePath, InversePath, ZeroOrMorePath, ... 0
10. Assignment (opens new window) BIND, VALUES 2/2
11. Aggregates (opens new window) COUNT, SUM, MIN, MAX, AVG, GROUP_CONCAT, SAMPLE 6/6
12. Subqueries (opens new window) Subqueries 1/1
13. RDF Dataset (opens new window) GRAPH, FROM [NAMED] 2/2
14. Basic Federated Query (opens new window) SERVICE 0
15. Solution Seqs. & Mods. (opens new window) ORDER BY, SELECT, DISTINCT, REDUCED, OFFSET, LIMIT 6/6
16. Query Forms (opens new window) SELECT, CONSTRUCT, ASK, DESCRIBE 4/4
17.4.1. Functional Forms (opens new window) BOUND, IF, COALESCE, EXISTS, NOT EXISTS, || , &&, =, sameTerm, IN, NOT IN 9/11
17.4.2. Functions on RDF Terms (opens new window) isIRI, isBlank, isLiteral, isNumeric, str, lang, datatype, IRI, BNODE, STRDT, STRLANG, UUID, STRUUID 11/13
17.4.3. Functions on Strings (opens new window) STRLEN, SUBSTR, UCASE, LCASE, STRSTARTS, STRENDS, CONTAINS, STRBEFORE, STRAFTER, ENCODE_FOR_URI, CONCAT, langMatches, REGEX, REPLACE 14/14
17.4.4. Functions on Numerics (opens new window) abs, round, ceil, floor, RAND 5/5
17.4.5. Functions on Dates&Times (opens new window) now, year, month, day, hours, minutes, seconds, timezone, tz 8/9
17.4.6. Hash Functions (opens new window) MD5, SHA1, SHA256, SHA384, SHA512 5/5
17.5 XPath Constructor Functions (opens new window) Casting -
17.6 Extensible Value Testing (opens new window) user defined functions 0

# Limitations

  • The 5 hash functions and functions REPLACE and REGEX for regular expressions have limited support because they heavily depend on the DBMS: not all DBMSs provide all hash functions, and many DBMSs have their own regex dialects. Currently, the SPARQL regular expressions of REPLACE and REGEX are simply sent to the DBMS by default.
  • In the implementation of function langMatches, the second argument has to a be a constant: allowing variables will have a negative impact on the performance in our framework.

# GeoSPARQL 1.0

Starting from 4.1.0.

The following table provides a summary of the compliance of the latest version of Ontop with OGC GeoSPARQL 1.0 (opens new window), the standard for representing and querying geospatial linked data. The summary focuses only on the main geospatial functions and properties and unsupported features are crossed out.

Section in OGC GeoSPARQL 1.0
Features Coverage
7. Topology Vocabulary Extensions - Properties geo:sfEquals, geo:sfDisjoint, geo:sfIntersects, geo:sfTouches, geo:sfCrosses, geo:sfWithin, geo:sfContains, geo:sfOverlaps, geo:ehEquals, geo:ehDisjoint, geo:ehMeet, geo:ehOverlap, geo:ehCovers, geo:ehCoveredBy, geo:ehInside, geo:ehContains, geo:rcc8eq, geo:rcc8dc, geo:rcc8ec, geo:rcc8po, geo:rcc8tppi, geo:rcc8tpp, geo:rcc8ntpp, geo:rcc8ntppi 0
8.4. Standard Properties for Geo:Geometry geo:dimension, geo:coordinateDimension, geo:spatialDimension, geo:isEmpty, geo:isSimple, geo:hasSerialization 0
8.5. WKT Serialization geo:wktLiteral, geo:asWKT 2/2
8.6. GML Serialization geo:gmlLiteral, geo:asGML 0
8.7. Non-Topological Query Functions geof:distance, geof:buffer, geof:convexHull , geof:intersection, geof:union, geof:difference geof:symDifference, geof:envelope, geof:boundary, geof:getSRID, 10/10
9.2. Common Query Functions geof:relate 1/1
9.3. Topological Simple Features Relation Family Query Functions geof:sfEquals, geof:sfDisjoint, geof:sfIntersects, geof:sfTouches, geof:sfCrosses, geof:sfWithin, geof:sfContains, geof:sfOverlaps 8/8
9.4. Topological Egenhofer Relation Family Query Functions geof:ehEquals, geof:ehDisjoint, geof:ehMeet, geof:ehOverlap, geof:ehCovers, geof:ehCoveredBy, geof:ehInside, geof:ehContains 8/8
9.5. Topological RCC8 Relation Family Query Functions geof:rcc8eq, geof:rcc8dc, geof:rcc8ec, geof:rcc8po, geof:rcc8tppi, geof:rcc8tpp, geof:rcc8ntpp, geof:rcc8ntppi 8/8

Several non-topological query functions use a unit of measure URI which OGC defines under a specific namespace e.g. <http://www.opengis.net/def/uom/OGC/1.0/metre>. The latest version of Ontop currently supports the units metre, radian and degree.

# R2RML

Updated for 4.2.0

The latest version of Ontop is almost fully compliant with the R2RML (opens new window) standard.

At the moment, it does NOT support:

For complex SQL queries (e.g. with a GROUP BY) in the mapping, Ontop may not be able to infer the datatype of each column if the option ontop.allowRetrievingBlackBoxViewMetadataFromDB is not enabled (disabled by default). In such a situation, it may not be able to derive the natural RDF datatype (opens new window) of a literal built over a column and may not apply the expected normalization. This can be partially mitigated by expliciting the RDF datatype in the mapping, but normalization would remain unapplied.

# RDF 1.1

Ontop complies with RDF 1.1 (opens new window). It types simple literals (from RDF 1.0) as xsd:string and literals with a language tag as rdf:langString.

# OWL 2 QL

# RDFS

# Time functions

Updated for 5.1.0.

The functions using the prefix ofn (http://www.ontotext.com/sparql/functions/) and their documentation can be found here (opens new window). They accept both xsd:date and xsd:dateTime as arguments. (supported since 4.2.0).

The functions using the prefix obdaf (https://w3id.org/obda/functions#) have been introduced in 5.1.0 (see #705 (opens new window)).

Function
Argument 1 Argument 2
ofn:weeksBetween xsd:date xsd:date
ofn:weeksBetween xsd:dateTime xsd:dateTime
ofn:weeksBetween* xsd:date xsd:dateTime
ofn:weeksBetween* xsd:dateTime xsd:date
ofn:daysBetween xsd:date xsd:date
ofn:daysBetween xsd:dateTime xsd:dateTime
ofn:daysBetween* xsd:date xsd:dateTime
ofn:daysBetween* xsd:dateTime xsd:date
ofn:hoursBetween xsd:dateTime xsd:dateTime
ofn:minutesBetween xsd:dateTime xsd:dateTime
ofn:secondsBetween xsd:dateTime xsd:dateTime
ofn:millisBetween xsd:dateTime xsd:dateTime
obdaf:dateTrunc xsd:dateTime xsd:string
obdaf:milliseconds-from-dateTime xsd:dateTime
obdaf:microseconds-from-dateTime xsd:dateTime
obdaf:week-from-dateTime xsd:dateTime
obdaf:quarter-from-dateTime xsd:dateTime
obdaf:decade-from-dateTime xsd:dateTime
obdaf:century-from-dateTime xsd:dateTime
obdaf:millenium-from-dateTime xsd:dateTime

Combinations of argument datatypes marked with the symbol * are not supported for queries over the following data sources: Oracle and Microsoft SQL Server.

The obdaf:[datePart]-from-dateTime functions are supported for all dialects. They can be used to extract a specific part of the provided dateTime value in a numeric format (xsd:decimal for milliseconds and microseconds, xsd:integer for the remaining functions).

NOTE

The function obdaf:week-from-dateTime returns the ISO week index of the given date, where week 1 is considered the first week with a majority of its days in January.

The obdaf:dateTrunc function can be used to truncate a given xsd:dateTime to a new value with specified granularity. The granularity must be provided as an xsd:string literal. The following granularity values are supported:

  • microsecond
  • millisecond
  • second
  • minute
  • hour
  • day
  • week
  • month
  • quarter
  • year
  • decade
  • century
  • millennium

WARNING

Not all database systems support all granularities equally.

decade, century, and millennium are not supported by:

  • AWS Athena
  • Denodo (century is supported)
  • MySQL (century is supported)
  • MariaDB (century is supported)
  • Oracle
  • Presto
  • SQLServer
  • Snowflake
  • Spark
  • Trino

second is not supported by:

  • Denodo

millisecond and microsecond are not supported by:

  • AWS Athena
  • Denodo
  • MySQL
  • MariaDB
  • Oracle
  • Presto
  • Trino

PostgreSQL requires these granularities to be named milliseconds and microseconds instead.

# Examples

obdaf:year("2023-08-16T09:00:00"^^xsd:dateTime) "2023"^^xsd:integer

obdaf:hour("2023-08-16T09:00:00"^^xsd:dateTime) "9"^^xsd:integer

obdaf:dateTrunc("2023-08-16T09:00:00"^^xsd:dateTime, "month"^^xsd:string) "2023-08-01T00:00:00"^^xsd:dateTime

- + diff --git a/guide/concepts.html b/guide/concepts.html index 986955d4b..9b53ee59b 100644 --- a/guide/concepts.html +++ b/guide/concepts.html @@ -6,7 +6,7 @@ Key concepts | Ontop - + @@ -48,7 +48,7 @@ RDF mainly targets data integration applications while property graphs are used for building graph databases.

In RDF, data is modelled using classes and properties.

Starting from 3.0, Ontop supports RDF 1.1 (opens new window).

# SPARQL query

SPARQL (opens new window) is the standard query language for RDF graphs.

Ontop is capable of answering SPARQL queries expressed over the VKG. Ontop translates these SPARQL queries into SQL queries, which are then executed over the relational data sources.

Ontop supports a large fragment of SPARQL 1.1 (opens new window).

# Mappings

Mappings specify the correspondence between the data models of the relational data sources and the RDF graph. Ontop supports the R2RML standard mapping language (opens new window) and the Ontop mapping language, which is fully interoperable with R2RML.

# Ontology

An ontology specifies the formal relations between the classes and properties used by the RDF graph. It is mainly used for enriching the RDF graph by, for instance, taking account of class hierarchies.

Ontop supports lightweight ontologies expressed in RDFS (opens new window) or in the slightly more expressive OWL 2 QL (opens new window) fragment of OWL.

# VKG specification

VKG specifications are composed of mappings and optionally of ontologies.

# SPARQL endpoint

A SPARQL endpoint (opens new window) is a standardized HTTP-based Web API. -It makes the RDF graph queryable by any HTTP client.

Ontop enables VKG specifications to be deployed as SPARQL endpoints.

- + diff --git a/guide/databases/athena.html b/guide/databases/athena.html index 763e49a3b..446c858e5 100644 --- a/guide/databases/athena.html +++ b/guide/databases/athena.html @@ -6,7 +6,7 @@ AWS Athena | Ontop - + @@ -49,7 +49,7 @@ jdbc.driver = com.simba.athena.jdbc.Driver

# Nested Type Support

Ontop implements explicit compatibility with the Athena array type ARRAY<T>. When used with the flatten lens, it is able to automatically infer the type of the result column.

The flatten lens cannot be used on arrays stored as JSON-encoded columns in the database. For such use cases, the column first has to be converted to an array type.

# Struct Access

Individual MAP objects can be accessed by SQL expressions in the dialect's default way:

SELECT my_struct['my_attribute'] FROM ...
 

ROW objects, can also be accessed using the [key] operator. Please note, that in this case, key must be an integer index instead of the name of the field:

SELECT my_struct[1] FROM ...
-

WARNING

Accessing object fields using the "dot operator" is not supported. Please use the [] operator instead.

WARNING

Accessing object fields using the "dot operator" is not supported. Please use the [] operator instead.

- + diff --git a/guide/databases/bigquery.html b/guide/databases/bigquery.html index 8b3447080..d1691f399 100644 --- a/guide/databases/bigquery.html +++ b/guide/databases/bigquery.html @@ -6,7 +6,7 @@ Google BigQuery | Ontop - + @@ -47,7 +47,7 @@ jdbc.property.OAuthServiceAcctEmail = service.account@dummydomain.com jdbc.property.OAuthPvtKey = paht/to/private/key/file.json jdbc.driver = com.simba.googlebigquery.jdbc.Driver -

NOTE

The Google BigQuery JDBC supports different types of authentication methods. The above .property file corresponds to the OAuthType 0: Service Account method, which involves creating a service account for BigQuery and downloading its private key from the web interface. However, any other authentication method can be used with Ontop as well.

# Nested Type Support

Ontop implements explicit compatibility with the ARRAY<T> type. When used with the flatten lens, it is able to automatically infer the type of the result column.

The flatten lens cannot be used on arrays stored as JSON columns in the database. For such use cases, the column first has to be converted to an array type.

NOTE

The position counter starts counting at 0 instead of 1 for BigQuery.

WARNING

In BigQuery, columns cannot directly be "arrays of arrays". To represent a two-dimensional array, the type ARRAY<STRUCT<ARRAY<T>>> has to be used instead of just ARRAY<ARRAY<T>>

# Struct Access

In BigQuery, individual struct objects can be accessed by SQL expressions using the "dot operator" on the struct column. In Ontop, this feature is not currently supported.

Should any of their elements still be required, then a workaround can be performed by first transforming the struct into a JSON object and then accessing it using JSON functions.

Example:

my_struct.my_attribute JSON_VALUE(TO_JSON(my_struct), '$.my_attribute')

NOTE

The Google BigQuery JDBC supports different types of authentication methods. The above .property file corresponds to the OAuthType 0: Service Account method, which involves creating a service account for BigQuery and downloading its private key from the web interface. However, any other authentication method can be used with Ontop as well.

# Nested Type Support

Ontop implements explicit compatibility with the ARRAY<T> type. When used with the flatten lens, it is able to automatically infer the type of the result column.

The flatten lens cannot be used on arrays stored as JSON columns in the database. For such use cases, the column first has to be converted to an array type.

NOTE

The position counter starts counting at 0 instead of 1 for BigQuery.

WARNING

In BigQuery, columns cannot directly be "arrays of arrays". To represent a two-dimensional array, the type ARRAY<STRUCT<ARRAY<T>>> has to be used instead of just ARRAY<ARRAY<T>>

# Struct Access

In BigQuery, individual struct objects can be accessed by SQL expressions using the "dot operator" on the struct column. In Ontop, this feature is not currently supported.

Should any of their elements still be required, then a workaround can be performed by first transforming the struct into a JSON object and then accessing it using JSON functions.

Example:

my_struct.my_attribute JSON_VALUE(TO_JSON(my_struct), '$.my_attribute')

- + diff --git a/guide/databases/databricks.html b/guide/databases/databricks.html index dbc588ae4..688cc7108 100644 --- a/guide/databases/databricks.html +++ b/guide/databases/databricks.html @@ -6,7 +6,7 @@ Databricks | Ontop - + @@ -51,7 +51,7 @@ jdbc.user = token jdbc.password = private-access-token jdbc.driver=com.simba.spark.jdbc.Driver -

# Nested Type Support

Ontop implements explicit compatibility with the SparkSQL array type Array<T>. When used with the flatten lens, it is able to automatically infer the type of the result column.

Furthermore, the flatten lens can also be used with the JSON-encoded string columns. For these columns, however, Ontop cannot infer the output type of the flattened column.

# Struct Access

In SparkSQL, individual struct objects can be accessed by SQL expressions using the "dot operator" on the struct column. In Ontop, this feature is not currently supported.

Should any of their elements still be required, then a workaround can be performed by first transforming the struct into a JSON object and then accessing it using JSON functions.

Example:

my_struct.my_attribute GET_JSON_OBJECT(TO_JSON(my_struct), '$.my_attribute')

# Nested Type Support

Ontop implements explicit compatibility with the SparkSQL array type Array<T>. When used with the flatten lens, it is able to automatically infer the type of the result column.

Furthermore, the flatten lens can also be used with the JSON-encoded string columns. For these columns, however, Ontop cannot infer the output type of the flattened column.

# Struct Access

In SparkSQL, individual struct objects can be accessed by SQL expressions using the "dot operator" on the struct column. In Ontop, this feature is not currently supported.

Should any of their elements still be required, then a workaround can be performed by first transforming the struct into a JSON object and then accessing it using JSON functions.

Example:

my_struct.my_attribute GET_JSON_OBJECT(TO_JSON(my_struct), '$.my_attribute')

- + diff --git a/guide/databases/db2.html b/guide/databases/db2.html index b60641c7f..c672803e4 100644 --- a/guide/databases/db2.html +++ b/guide/databases/db2.html @@ -6,7 +6,7 @@ DB2 | Ontop - + @@ -46,7 +46,7 @@ jdbc.user = user jdbc.password = password jdbc.driver = com.ibm.db2.jcc.DB2Driver -

# Nested Type Support

Nested data types and the flatten lens are not supported for DB2.

# Nested Type Support

Nested data types and the flatten lens are not supported for DB2.

- + diff --git a/guide/databases/denodo.html b/guide/databases/denodo.html index 54d1c32ab..1b9cdcf5b 100644 --- a/guide/databases/denodo.html +++ b/guide/databases/denodo.html @@ -6,7 +6,7 @@ Denodo | Ontop - + @@ -46,7 +46,7 @@ jdbc.user = admin jdbc.password = ${denodo.password} jdbc.driver = com.denodo.vdp.jdbc.Driver -

# Nested Type Support

Nested data types and the flatten lens are not supported for Denodo.

# Nested Type Support

Nested data types and the flatten lens are not supported for Denodo.

- + diff --git a/guide/databases/dremio.html b/guide/databases/dremio.html index 86dade784..6aa739065 100644 --- a/guide/databases/dremio.html +++ b/guide/databases/dremio.html @@ -6,7 +6,7 @@ Dremio | Ontop - + @@ -53,7 +53,7 @@ jdbc.password = password jdbc.driver = org.apache.arrow.driver.jdbc.ArrowFlightJdbcDriver

# Nested Type Support

Ontop implements explicit compatibility with the Dremio array type LIST which can be used with the flatten lens. However, it cannot infer the type of the flattened result column.

To use a flatten lens on a JSON-encoded array stored in the database, it first has to be converted to a LIST.

WARNING

The position argument for flatten lenses cannot be used with Dremio.

# Struct Access

Individual struct objects can be accessed by SQL expressions in the dialect's default way:

SELECT my_struct['my_attribute'] FROM ...
-
- + diff --git a/guide/databases/duckdb.html b/guide/databases/duckdb.html index 1a209c19d..e31ff5d87 100644 --- a/guide/databases/duckdb.html +++ b/guide/databases/duckdb.html @@ -6,7 +6,7 @@ DuckDB | Ontop - + @@ -45,7 +45,7 @@ (opens new window)

# DuckDB

Supported since 5.0.2.

Through the DuckDB (opens new window) connector, Ontop is able to construct VKGs on DuckDB database files.

# Limitations & Exceptions

  • DuckDB database files prior to version 1.0 are not guaranteed to be compatible with later versions.
  • Setting a default schema is not supported when connecting to DuckDB.
  • Nested data types are only supported starting from version 0.7 of DuckDB.
  • Accessing struct fields using the "dot operator" is not supported.
  • The Ontop option ontop.exposeSystemTables is not supported for DuckDB, as the JBDC does not allow us to access system tables.
  • DuckDB has a very specific concurrency model (opens new window). In particular, it does not support concurrent multi-process read-write queries.

# Database Connection

The following shows the content of a sample .properties file that can be used to connect Ontop to DuckDB:

jdbc.url = jdbc:duckdb:path/to/database.db
 jdbc.driver = org.duckdb.DuckDBDriver
 

# Nested Type Support

Ontop implements explicit compatibility with the DuckDB array type T[]. When used with the flatten lens, it is able to automatically infer the type of the result column.

The flatten lens cannot be used on arrays stored as JSON-encoded columns in the database. For such use cases, the column first has to be converted to an array type.

NOTE

Nested data types are only supported starting from version 0.7 of DuckDB.

# Struct Access

Individual struct objects can be accessed by SQL expressions in the dialect's default way:

SELECT my_struct['my_attribute'] FROM ...
-

WARNING

Accessing struct fields using the "dot operator" is not supported.

WARNING

Accessing struct fields using the "dot operator" is not supported.

- + diff --git a/guide/databases/dynamodb.html b/guide/databases/dynamodb.html index 6f674a339..d0ae0d65e 100644 --- a/guide/databases/dynamodb.html +++ b/guide/databases/dynamodb.html @@ -6,7 +6,7 @@ AWS DynamoDB | Ontop - + @@ -47,7 +47,7 @@ jdbc.property.AWSAccessKey = public-access-key jdbc.property.AWSSecretKey = private-access-key jdbc.driver = cdata.jdbc.amazondynamodb.AmazonDynamoDBDriver -

# Nested Type Support

Nested data types and the flatten lens are not supported for DynamoDB.

# Nested Type Support

Nested data types and the flatten lens are not supported for DynamoDB.

- + diff --git a/guide/databases/generic.html b/guide/databases/generic.html index 6f53492fe..3b5c2d1ce 100644 --- a/guide/databases/generic.html +++ b/guide/databases/generic.html @@ -6,7 +6,7 @@ Generic JDBC (not recommended) | Ontop - + @@ -42,7 +42,7 @@ Work with us GitHub - (opens new window)

# Generic JDBC (not recommended)

WARNING

Don't rely on generic JDBC support. It isn't sufficient for any data source.

Ontop provides a generic implementation, that is used as default for any JDBC. While part of the functionality may work right out of the box with this default implementation, there is no guarantee that Ontop will be able to handle any database setup and SPARQL queries correctly, especially once special limitations and exceptions come into play.

However, Ontop also provides dialect-specific implementations for a variety of different database management systems and SQL dialects. The following documents describe the process of connecting Ontop to each of them, as well as special points and caveats for specific cases.

In this section, we provide general information and important points for each of the supported systems.

NOTE

If your SQL dialect of interest is not included in this list, it is possible to implement a connector for it, following this guide.

NOTE

To use Ontop with any database system, its corresponding JDBC driver is required in the jdbc directory, which is passed to the Ontop instance as described in the setup guide.

- + diff --git a/guide/databases/h2.html b/guide/databases/h2.html index ab385abff..0dd6f8621 100644 --- a/guide/databases/h2.html +++ b/guide/databases/h2.html @@ -6,7 +6,7 @@ H2 | Ontop - + @@ -46,7 +46,7 @@ jdbc.user = user jdbc.password = password jdbc.driver = org.h2.Driver -

# Nested Type Support

Nested data types and the flatten lens are not supported for H2.

# Nested Type Support

Nested data types and the flatten lens are not supported for H2.

- + diff --git a/guide/databases/mariadb.html b/guide/databases/mariadb.html index dabb078d3..2346db86c 100644 --- a/guide/databases/mariadb.html +++ b/guide/databases/mariadb.html @@ -6,7 +6,7 @@ MariaDB | Ontop - + @@ -46,7 +46,7 @@ jdbc.user = user jdbc.password = password jdbc.driver = org.mariadb.jdbc.Driver -

# Nested Type Support

Ontop implements explicit compatibility with the MariaDB type JSON which can be used with the flatten lens. However, it cannot infer the type of the flattened result column.

In case the flattened column is still a nested structure after the flatten operation is performed (e.g. for arrays of objects), MariaDB's JSON functions (opens new window) can be used to further work with them.

# Nested Type Support

Ontop implements explicit compatibility with the MariaDB type JSON which can be used with the flatten lens. However, it cannot infer the type of the flattened result column.

In case the flattened column is still a nested structure after the flatten operation is performed (e.g. for arrays of objects), MariaDB's JSON functions (opens new window) can be used to further work with them.

- + diff --git a/guide/databases/mssql.html b/guide/databases/mssql.html index b47f54717..b444a77fd 100644 --- a/guide/databases/mssql.html +++ b/guide/databases/mssql.html @@ -6,7 +6,7 @@ MS SQL Server | Ontop - + @@ -46,7 +46,7 @@ jdbc.user = user jdbc.password = password jdbc.driver = com.microsoft.sqlserver.jdbc.SQLServerDriver -

# Nested Type Support

Nested data types are not supported by SQLServer. However, Ontop allows the usage of the flatten lens over string columns that contain JSON-encoded arrays. The output type of the flattened result column cannot be inferred.

WARNING

The position argument for flatten lenses cannot be used with SQLServer.

In case the flattened column is still a nested structure after the flatten operation is performed (e.g. for arrays of objects), SQLServer's JSON functions (opens new window) can be used to further work with them.

# Nested Type Support

Nested data types are not supported by SQLServer. However, Ontop allows the usage of the flatten lens over string columns that contain JSON-encoded arrays. The output type of the flattened result column cannot be inferred.

WARNING

The position argument for flatten lenses cannot be used with SQLServer.

In case the flattened column is still a nested structure after the flatten operation is performed (e.g. for arrays of objects), SQLServer's JSON functions (opens new window) can be used to further work with them.

- + diff --git a/guide/databases/mysql.html b/guide/databases/mysql.html index 960fab027..c477e9c6b 100644 --- a/guide/databases/mysql.html +++ b/guide/databases/mysql.html @@ -6,7 +6,7 @@ MySQL | Ontop - + @@ -42,11 +42,11 @@ Work with us GitHub - (opens new window)

# MySQL

Through the MySQL (opens new window) connector, Ontop is able to construct VKGs on MySQL databases.

# Limitations & Exceptions

  • String literals have to be encased in single quotes ('). Double quote string literals (") are not supported.
  • Accessing JSON object fields with the "dot operator" is not supported (see below).

# Database Connection

The following shows the content of a sample .properties file that can be used to connect Ontop to MySQL:

jdbc.url = jdbc:mysql://localhost:3306/defaultdatabase
+     (opens new window)    

# MySQL

Through the MySQL (opens new window) connector, Ontop is able to construct VKGs on MySQL databases.

# Limitations & Exceptions

  • String literals have to be encased in single quotes ('). Double quote string literals (") are not supported.
  • Accessing JSON object fields with the "dot operator" is not supported (see below).
  • MySQL 5.x comes with some limitations (e.g. no anonymous bnode support, no regexp replace, no nested data support). MySQL 5.x reached its end-of-life, so please consider upgrading.

# Database Connection

The following shows the content of a sample .properties file that can be used to connect Ontop to MySQL:

jdbc.url = jdbc:mysql://localhost:3306/defaultdatabase
 jdbc.user = user
 jdbc.password = password
 jdbc.driver = com.mysql.cj.jdbc.Driver
-

# Nested Type Support

Ontop implements explicit compatibility with the MySQL type JSON which can be used with the flatten lens. However, it cannot infer the type of the flattened result column.

In case the flattened column is still a nested structure after the flatten operation is performed (e.g. for arrays of objects), MySQL's JSON functions (opens new window) can be used to further work with them.

WARNING

Accessing object fields using the "arrow operator" is not supported.

# Nested Type Support

Ontop implements explicit compatibility with the MySQL type JSON which can be used with the flatten lens. However, it cannot infer the type of the flattened result column.

In case the flattened column is still a nested structure after the flatten operation is performed (e.g. for arrays of objects), MySQL's JSON functions (opens new window) can be used to further work with them.

WARNING

Accessing object fields using the "arrow operator" is not supported.

WARNING

Nested type only supported for MySQL >= 8.0

- + diff --git a/guide/databases/oracle.html b/guide/databases/oracle.html index 99ddce269..32e88accf 100644 --- a/guide/databases/oracle.html +++ b/guide/databases/oracle.html @@ -6,7 +6,7 @@ Oracle | Ontop - + @@ -47,7 +47,7 @@ jdbc.password = password jdbc.driver = oracle.jdbc.OracleDriver

# Nested Type Support

Ontop does not implement explicit compatibility with nested datatypes in Oracle. -However, Ontop allows the usage of the flatten lens over string columns that contain JSON-encoded arrays. The output type of the flattened result column cannot be inferred.

To use the flatten lens with Oracle array types, they must first be converted to JSON strings.

In case the flattened column is still a nested structure after the flatten operation is performed (e.g. for arrays of objects), Oracle's JSON functions (opens new window) can be used to further work with them.

WARNING

Accessing object fields using the "dot operator" is not supported. Please use SQL JSON functions instead.

- + diff --git a/guide/databases/postgres.html b/guide/databases/postgres.html index db29ec03e..895f8f441 100644 --- a/guide/databases/postgres.html +++ b/guide/databases/postgres.html @@ -6,7 +6,7 @@ PostgreSQL | Ontop - + @@ -46,7 +46,7 @@ jdbc.user = admin jdbc.password = password jdbc.driver = org.postgresql.Driver -

# Nested Type Support

Ontop implements explicit compatibility with the PostgreSQL array type T[]. When used with the flatten lens, it is able to automatically infer the type of the result column.

Furthermore, the flatten lens can also be used with the JSON and JSONB datatypes, which are both recognized by Ontop. For these types, however, Ontop cannot infer the output type of the flattened column.

# Struct Access

In PostgreSQL, individual struct objects can be accessed by SQL expressions using the "dot operator" on the struct column. In Ontop, this feature is not currently supported.

Should any of their elements still be required, then a workaround can be performed by first transforming the struct into a JSON object and then accessing it using JSON functions.

Example:

my_struct.my_attribute JSON_EXTRACT_PATH(TO_JSON(my_struct), '$.my_attribute')

WARNING

The "arrow operators" used to access JSON objects in PostgreSQL are not supported in Ontop. Please use JSON functions instead.

# Nested Type Support

Ontop implements explicit compatibility with the PostgreSQL array type T[]. When used with the flatten lens, it is able to automatically infer the type of the result column.

Furthermore, the flatten lens can also be used with the JSON and JSONB datatypes, which are both recognized by Ontop. For these types, however, Ontop cannot infer the output type of the flattened column.

# Struct Access

In PostgreSQL, individual struct objects can be accessed by SQL expressions using the "dot operator" on the struct column. In Ontop, this feature is not currently supported.

Should any of their elements still be required, then a workaround can be performed by first transforming the struct into a JSON object and then accessing it using JSON functions.

Example:

my_struct.my_attribute JSON_EXTRACT_PATH(TO_JSON(my_struct), '$.my_attribute')

WARNING

The "arrow operators" used to access JSON objects in PostgreSQL are not supported in Ontop. Please use JSON functions instead.

- + diff --git a/guide/databases/presto.html b/guide/databases/presto.html index b181346d8..dd145d0dc 100644 --- a/guide/databases/presto.html +++ b/guide/databases/presto.html @@ -6,7 +6,7 @@ Presto | Ontop - + @@ -48,7 +48,7 @@ jdbc.password = password jdbc.driver = com.facebook.presto.jdbc.PrestoDriver

In case Presto is set up without authentication, the jdbc.user and jdbc.password lines can also be left out.

# Nested Type Support

Ontop implements explicit compatibility with the Presto array type array(t). When used with the flatten lens, it is able to automatically infer the type of the result column.

The flatten lens cannot be used on arrays stored as JSON-encoded columns in the database. For such use cases, the column first has to be converted to an array type.

# Struct Access

In Presto, individual ROW objects can be accessed by SQL expressions using the "dot operator" on the ROW column. In Ontop, this feature is not currently supported.

Should any of their elements still be required, then a workaround can be performed by first transforming the struct into a JSON object and then accessing it using JSON functions.

Example:

my_row.my_attribute JSON_EXTRACT(CAST(my_struct AS JSON), '$.my_attribute')

Elements of MAP objects can be accessed using the [] operator, as in

SELECT my_map['my_attribute'] FROM ...
-
- + diff --git a/guide/databases/redshift.html b/guide/databases/redshift.html index 1aff4dc13..18c72a896 100644 --- a/guide/databases/redshift.html +++ b/guide/databases/redshift.html @@ -6,7 +6,7 @@ AWS Redshift | Ontop - + @@ -47,7 +47,7 @@ jdbc.property.AccessKeyID = public-access-key jdbc.property.SecretAccessKey = private-access-key jdbc.driver = com.amazon.redshift.jdbc42.Driver -

NOTE

The AWS Redshift JDBC supports different types of authentication methods. The above .property file corresponds to authentication with access keys. However, any other authentication method can be used with Ontop as well. In these cases, the corresponding connection properties have to be supplied as jdbc.property.<property-name> instead of the AccessKeyID and SecretAccessKey properties.

# Nested Type Support

Ontop implements explicit compatibility with the Redshift type SUPER.

This type can be used with the flatten lens. However, Ontop is not able to automatically infer the type of the result column.

# Struct Access

In Redshift, individual SUPER struct objects can be accessed by SQL expressions using the "dot operator" on the SUPER column. In Ontop, this feature is not currently supported.

Should any of their elements still be required, then a workaround can be performed by first transforming the struct into a JSON object and then accessing it using JSON functions.

Example:

my_struct.my_attribute JSON_EXTRACT_PATH_TEXT(JSON_SERIALIZE(my_struct), 'my_attribute')

NOTE

The AWS Redshift JDBC supports different types of authentication methods. The above .property file corresponds to authentication with access keys. However, any other authentication method can be used with Ontop as well. In these cases, the corresponding connection properties have to be supplied as jdbc.property.<property-name> instead of the AccessKeyID and SecretAccessKey properties.

# Nested Type Support

Ontop implements explicit compatibility with the Redshift type SUPER.

This type can be used with the flatten lens. However, Ontop is not able to automatically infer the type of the result column.

# Struct Access

In Redshift, individual SUPER struct objects can be accessed by SQL expressions using the "dot operator" on the SUPER column. In Ontop, this feature is not currently supported.

Should any of their elements still be required, then a workaround can be performed by first transforming the struct into a JSON object and then accessing it using JSON functions.

Example:

my_struct.my_attribute JSON_EXTRACT_PATH_TEXT(JSON_SERIALIZE(my_struct), 'my_attribute')

- + diff --git a/guide/databases/snowflake.html b/guide/databases/snowflake.html index 9fc72679a..a06bafdc5 100644 --- a/guide/databases/snowflake.html +++ b/guide/databases/snowflake.html @@ -6,7 +6,7 @@ Snowflake | Ontop - + @@ -48,7 +48,7 @@ jdbc.password = password jdbc.driver = net.snowflake.client.jdbc.SnowflakeDriver

# Nested Type Support

Ontop implements explicit compatibility with the ARRAY type, which can be used with the flatten lens. However, it is not able to automatically infer the type of the resulting column.

WARNING

Due to an issue mentioned above, using special characters inside the output and position fields of the flatten lens for Snowflake will fail. Furthermore, these fields will always be case-insensitive.

# Struct Access

Individual object fields can be accessed by SQL expressions in the dialect's default way:

SELECT my_object['my_field'] FROM ...
-

WARNING

Accessing object fields using the "colon operator" is not supported. Please use the [] operator instead.

WARNING

Accessing object fields using the "colon operator" is not supported. Please use the [] operator instead.

- + diff --git a/guide/databases/spark.html b/guide/databases/spark.html index fc6adb203..c5beafc43 100644 --- a/guide/databases/spark.html +++ b/guide/databases/spark.html @@ -6,7 +6,7 @@ SparkSQL | Ontop - + @@ -47,7 +47,7 @@ jdbc.driver = org.apache.hive.jdbc.HiveDriver jdbc.user = user jdbc.password = password -

# Nested Type Support

Ontop implements explicit compatibility with the SparkSQL array type Array<T>. When used with the flatten lens, it is able to automatically infer the type of the result column.

Furthermore, the flatten lens can also be used with the JSON-encoded string columns. For these columns, however, Ontop cannot infer the output type of the flattened column.

# Struct Access

In SparkSQL, individual struct objects can be accessed by SQL expressions using the "dot operator" on the struct column. In Ontop, this feature is not currently supported.

Should any of their elements still be required, then a workaround can be performed by first transforming the struct into a JSON object and then accessing it using JSON functions.

Example:

my_struct.my_attribute GET_JSON_OBJECT(TO_JSON(my_struct), '$.my_attribute')

# Nested Type Support

Ontop implements explicit compatibility with the SparkSQL array type Array<T>. When used with the flatten lens, it is able to automatically infer the type of the result column.

Furthermore, the flatten lens can also be used with the JSON-encoded string columns. For these columns, however, Ontop cannot infer the output type of the flattened column.

# Struct Access

In SparkSQL, individual struct objects can be accessed by SQL expressions using the "dot operator" on the struct column. In Ontop, this feature is not currently supported.

Should any of their elements still be required, then a workaround can be performed by first transforming the struct into a JSON object and then accessing it using JSON functions.

Example:

my_struct.my_attribute GET_JSON_OBJECT(TO_JSON(my_struct), '$.my_attribute')

- + diff --git a/guide/databases/trino.html b/guide/databases/trino.html index 247c280ca..6c687c539 100644 --- a/guide/databases/trino.html +++ b/guide/databases/trino.html @@ -6,7 +6,7 @@ Trino | Ontop - + @@ -49,7 +49,7 @@ jdbc.driver = io.trino.jdbc.TrinoDriver

In case Trino is set up without authentication, the jdbc.user and jdbc.password lines can also be left out.

# Nested Type Support

Ontop implements explicit compatibility with the Trino array type array(t). When used with the flatten lens, it is able to automatically infer the type of the result column.

The flatten lens cannot be used on arrays stored as JSON-encoded columns in the database. For such use cases, the column first has to be converted to an array type.

# Struct Access

Individual MAP (opens new window) structures can be accessed by SQL expressions in the dialect's default way:

SELECT my_struct['my_attribute'] FROM ...
 

ROW (opens new window) structures can be accessed using the [position] operator. position must be an integer index starting from 1:

SELECT my_struct[1] FROM ...
-

WARNING

Accessing object fields using the "dot operator" is not supported. Please use the [] operator instead.

WARNING

Accessing object fields using the "dot operator" is not supported. Please use the [] operator instead.

- + diff --git a/guide/db.html b/guide/db.html index 2013f56a4..9c4340bce 100644 --- a/guide/db.html +++ b/guide/db.html @@ -6,7 +6,7 @@ Data sources | Ontop - + @@ -42,7 +42,7 @@ Work with us GitHub - (opens new window)

# Data sources

# PostgreSQL

DOUBLE-CHECK restrictions

SIMILAR TO (not parsed by JSQLParser)

- + (opens new window)

# Data sources

# PostgreSQL

DOUBLE-CHECK restrictions

SIMILAR TO (not parsed by JSQLParser)

+ diff --git a/guide/getting-started.html b/guide/getting-started.html index 808e5c21d..6851220a5 100644 --- a/guide/getting-started.html +++ b/guide/getting-started.html @@ -6,7 +6,7 @@ Getting started | Ontop - + @@ -42,7 +42,7 @@ Work with us GitHub - (opens new window)

# Getting started

# Tutorial

If you are new to Ontop and Virtual Knowledge Graphs, we encourage you to have a look at the official tutorial.

# Using Ontop

Ontop is distributed under various forms. They can be downloaded on Github (opens new window), Docker Hub (opens new window), Sourceforge (opens new window) and in the Protégé plugin repository.

# Mapping designer

For editing and testing your mappings, you can use our plugin of the Protégé ontology editor (opens new window). You can download the latest stable release directly from Protégé. Alternatively, pre-releases can be found on Github (opens new window) and Sourceforge (opens new window).

Limited support of advanced features

In particular, the Protégé plugin doesn't support lenses. For advanced usage, we recommend using text editors or considering commercial offerings.

# Deployment

Once your mappings and your ontology are ready, you can deploy your VKG as a SPARQL endpoint. The Ontop endpoint is available both as a CLI command (ontop endpoint) and as a Docker image (opens new window).

You can also use the Ontop endpoint during development as it embeds a nice YASGUI client (opens new window) and an optional portal (since 4.0-beta-1) containing pre-defined queries.

# Command Line Interface

Want to materialize your VKG, convert your mappings into R2RML, bootstrap your mappings or start a SPARQL endpoint? You can use the CLI for that. It can be found on on Github (opens new window) and Sourceforge (opens new window).

# Former solutions

Historically, Ontop has been made available under other means that we don't recommend anymore.

It remains possible to use Ontop as a Java API through RDF4J (opens new window) although we recommend the HTTP SPARQL endpoint as a first option (think of a microservice). Why? Because such a Java API would add many dependencies to your project and constraint you to use certain versions of Java.

Ontop-rdf4j is available on Maven Central (opens new window).

- + diff --git a/guide/glossary.html b/guide/glossary.html index 1a9fad136..3ad86851d 100644 --- a/guide/glossary.html +++ b/guide/glossary.html @@ -6,7 +6,7 @@ Glossary | Ontop - + @@ -42,7 +42,7 @@ Work with us GitHub - (opens new window)

# Glossary

# VKG

Virtual Knowledge Graph

# Mapping

# OBDA

Ontology-Based Data Access

# Ontology

# RDF

# RDFS

# SPARQL

# SPARQL Query

# SPARQL Endpoint

# OWL

# R2RML

- + diff --git a/guide/index.html b/guide/index.html index fdaa093d7..603e88db1 100644 --- a/guide/index.html +++ b/guide/index.html @@ -6,7 +6,7 @@ Introduction | Ontop - + @@ -45,11 +45,11 @@ (opens new window)

# Introduction

Ontop is a Virtual Knowledge Graph system. It exposes the content of arbitrary relational databases as knowledge graphs. These graphs are virtual, which means that data remains in the data sources instead of being moved to another database.

Ontop translates SPARQL queries (opens new window) expressed over the knowledge graphs into SQL queries executed by the relational data sources. It relies on R2RML mappings (opens new window) and can take advantage of lightweight ontologies.

# Versions

This documentation is for Ontop 3.0 and more recent versions.

For earlier versions, please refer to our previous Wiki (opens new window).

Most recent version:

  • Stable: Ontop 5.1.1, released on November 22, 2023.

See release notes for more details.

# Main features

# Organizations

Ontop is backed by the Free University of Bozen-Bolzano (opens new window) and Ontopic s.r.l. (opens new window). It also receives regular important contributions from University of Bergen (opens new window) and Birkbeck, University of London (opens new window). See the community section for more details.

# Licenses

Ontop is available under the Apache 2.0 (opens new window) license.

All the documentation is licensed under the Creative Commons (Attribution) (opens new window) -license.

# Social

You can find us on the following social platforms:

# Citations

- + diff --git a/guide/materialization.html b/guide/materialization.html index 38f1dd77e..564d732db 100644 --- a/guide/materialization.html +++ b/guide/materialization.html @@ -6,7 +6,7 @@ Materialization | Ontop - + @@ -42,7 +42,7 @@ Work with us GitHub - (opens new window)

# Materialization

- + (opens new window)

# Materialization

+ diff --git a/guide/releases.html b/guide/releases.html index 2ba0d5870..48a90d030 100644 --- a/guide/releases.html +++ b/guide/releases.html @@ -6,7 +6,7 @@ Release notes | Ontop - + @@ -278,11 +278,11 @@ (Issues: #58).
  • Fix the exceptions that appeared when loading/saving/reloading ontologies (Issues: #59, #60, #61, #75).
  • Fix problems with several progress dialogs in the GUI (Issues: #50, #87).
  • Fix problems in the 'tuple count' functionality (Issues: #82, -#84).
  • - + diff --git a/guide/troubleshooting/faq.html b/guide/troubleshooting/faq.html index a099c6879..f321ebc60 100644 --- a/guide/troubleshooting/faq.html +++ b/guide/troubleshooting/faq.html @@ -6,7 +6,7 @@ FAQ | Ontop - + @@ -49,7 +49,7 @@ and JDBC Information (opens new window).

    # No "JDBC drivers" tab in the preferences

    You probably can see the following message in the Protégé console:

    org.osgi.framework.BundleException: Activator start error in bundle org.protege.osgi.jdbc.prefs [20].)
     org.protege.osgi.jdbc.RegistryException: java.lang.ClassNotFoundException: org.h2.Driver
     

    Please go to the Preferences and click on "Reset preferences".

    # Protégé does not show the Ontop tabs

    To see the tabs go to Windows -> tabs -> Ontop Mappings and Ontop SPARQL.

    # RDF4J workbench (not supported anymore)

    # Why RDF4J Workbench refuses to delete some repositories?

    For deleting metadata about a repository, the RDF4J Workbench should be able to create an instance of this repository. However, if the repository configuration is invalid (due to, for instance to bad mapping and ontology files), such an instance cannot be created. -To avoid this situation, the configuration is validated in depth when a new repository is added to the Workbench. However, if the mapping and ontology files are changed afterwards, we offer no protection. One workaround is to create a valid repository with the same name and then to delete it. Another workaround is to delete it from the RDF4J console.

    - + diff --git a/index.html b/index.html index 845504d9d..4d3a76de8 100644 --- a/index.html +++ b/index.html @@ -6,7 +6,7 @@ Ontop - + @@ -51,6 +51,6 @@

    - + diff --git a/jobs/index.html b/jobs/index.html index e0ef8a6b4..84c43221d 100644 --- a/jobs/index.html +++ b/jobs/index.html @@ -6,7 +6,7 @@ Work with us | Ontop - + @@ -43,7 +43,7 @@ GitHub (opens new window)

    # Work with us

    if you are enthusiastic in the Ontop system and the Virtual Knowledge Graph technology, -there are many opportunities, which range from a small course project, to a complete PhD study, or a full time developer position.

    # Free University of Bozen-Bolzano

    At the In2Data research group (opens new window) at the KBDB group of Free University of Bozen-Bolzano, we are offering:

    If you are interested, please get in touch with Prof. Diego Calvanese (opens new window) or Dr. Guohui Xiao (opens new window).

    # Ontopic

    At the company Ontopic s.r.l. (opens new window), we are offering:

    • Student internship
    • Bachelor/Master thesis
    • Part time or full time developer positions.

    If you are interested, please get in touch with inquiry@ontopic.ai.

    - +there are many opportunities, which range from a small course project, to a complete PhD study, or a full time developer position.

    # Free University of Bozen-Bolzano

    At the In2Data research group (opens new window) at the KBDB group of Free University of Bozen-Bolzano, we are offering:

    If you are interested, please get in touch with Prof. Diego Calvanese (opens new window) or Dr. Guohui Xiao (opens new window).

    # Ontopic

    At the company Ontopic s.r.l. (opens new window), we are offering:

    • Student internship
    • Bachelor/Master thesis
    • Part time or full time developer positions.

    If you are interested, please get in touch with inquiry@ontopic.ai.

    + diff --git a/obda-pages/index.html b/obda-pages/index.html index 0f58997ac..cbfb0bda8 100644 --- a/obda-pages/index.html +++ b/obda-pages/index.html @@ -6,7 +6,7 @@ Vocabularies for Ontology-Based Data Access | Ontop - + @@ -42,7 +42,7 @@ Work with us GitHub - (opens new window)

    # Vocabularies for Ontology-Based Data Access

    Coming soon!

    - + (opens new window)

    # Vocabularies for Ontology-Based Data Access

    Coming soon!

    + diff --git a/research/index.html b/research/index.html index d8d14576a..f3df51b09 100644 --- a/research/index.html +++ b/research/index.html @@ -6,7 +6,7 @@ Research team | Ontop - + @@ -43,11 +43,11 @@ GitHub (opens new window)

    # Research team

    Ontop is a project initiated by Diego Calvanese and Mariano Rodriguez-Muro in 2009 in the KRDB research centre for Knowledge and Data (opens new window) at the Free University of Bolzano (opens new window).

    A decade after, Ontop remains very active, both from a research and a software development point of view.

    # Researchers

    Here we list the people who has been involved in the research side of the Ontop project. -For the development side, see the community page.

    # At the Free University of Bozen-Bolzano (Unibz)

    # International collaborations

    # Alumni researchers from Unibz

    # Projects

    The development and the research around Ontop over the years have been mainly funded by research projects.

    # Past projects

    • Thinking ONtologiES (TONES), EU FET project
    • Optique (opens new window) (Scalable End-User Access to Big Data) FP7 project
    • Ontology-based Data Access to NoSQL Database (OBDAM), Unibz project
    • Ontology-based analysis of temporal and streaming data (OBATS), Unibz project

    # Current projects

    • INODE (opens new window) (data management infrastructures), H2020 EU project
    • High quality Open data Publishing and Enrichment (HOPE), Italian national PRIN (Research Projects of National Relevance)
    • PACMEL (VKG for process mining), CHIST-ERA EU Project
    • IDEE (data integration in the energy sector), FESR Project
    • GeoVKG (geo-spatial VKG), Unibz project
    • High Quality Data Integration with Ontologies (QUADRO), Unibz project
    - + diff --git a/research/iq-formal.html b/research/iq-formal.html index cc7396110..75fbcc663 100644 --- a/research/iq-formal.html +++ b/research/iq-formal.html @@ -6,7 +6,7 @@ Formal characterization of IQs | Ontop - + @@ -177,7 +177,7 @@ in that the projection with all selected attributes (and no non-trivial additional operation) is the identity operator, and so is renaming with empty substituion. So in practice, -a construction node may encode one of these operations.

    - + diff --git a/research/notation.html b/research/notation.html index 856b11f93..92f0666d1 100644 --- a/research/notation.html +++ b/research/notation.html @@ -6,7 +6,7 @@ Notation | Ontop - + @@ -62,7 +62,7 @@ the projected attributes must be a subset of the attributes of the argument relation. Similarly, the arguments of a union operator must have identical set of attributes (this is not natively the case of the UNION SPARQL operator, -but can be enforced with a straightforward normalization).

    - + diff --git a/research/optimization.html b/research/optimization.html index 56b0d35bd..f94c3aaf8 100644 --- a/research/optimization.html +++ b/research/optimization.html @@ -6,7 +6,7 @@ Intermediate query optimization | Ontop - + @@ -139,11 +139,11 @@ such that ||l1|| = { {y ↦ 2} } and ||r1|| = { {x ↦ 1} }.

    Then ||j1|| = { {x ↦ 1, y ↦ 2} }, and ||n1|| = { {} }.

    But ||l2|| = { {y ↦ 2} } and ||r2|| = { {} } must also hold, therefore ||j2|| = { {y ↦ 2} } and ||n2|| = { {y ↦ 2} }, -such that ||n1|| ≠ ||n2||.

    - + diff --git a/research/publications.html b/research/publications.html index 388b8c563..d9f791fe7 100644 --- a/research/publications.html +++ b/research/publications.html @@ -6,7 +6,7 @@ Publications | Ontop - + @@ -142,7 +142,7 @@ Course. (opens new window) (Roman Kontchakov, Mariano Rodriguez-Muro, Michael Zakharyaschev. Reasoning Web 2013)
  • Ontop: A Tutorial (opens new window) -(Mariano Rodriguez-Muro, Vienna'13)
  • # Master theses

    - + diff --git a/research/tutorials/cikm-2018.html b/research/tutorials/cikm-2018.html index 1f267af27..2baf3c557 100644 --- a/research/tutorials/cikm-2018.html +++ b/research/tutorials/cikm-2018.html @@ -6,7 +6,7 @@ Ontop - + @@ -60,7 +60,7 @@ tutorial. Similarly, background in Semantic Web standards, such as RDF and SPARQL can be of help, although these notions are an integral part of the tutorial, and are introduced and discussed in -the first part.

    - +the first part.

    + diff --git a/tutorial/api/index.html b/tutorial/api/index.html index 3a177fb9b..85b172e36 100644 --- a/tutorial/api/index.html +++ b/tutorial/api/index.html @@ -6,7 +6,7 @@ Ontop API | Ontop - + @@ -42,7 +42,7 @@ Work with us GitHub - (opens new window)

    # Ontop API

    Ontop API examples are available at its own repository:

    https://github.com/ontop/ontop-api-examples (opens new window)

    You can import it directly into a Java IDE. IntelliJ is recommended.

    - + (opens new window)

    # Ontop API

    Ontop API examples are available at its own repository:

    https://github.com/ontop/ontop-api-examples (opens new window)

    You can import it directly into a Java IDE. IntelliJ is recommended.

    + diff --git a/tutorial/basic/setup.html b/tutorial/basic/setup.html index 84f5e659c..3f02f804d 100644 --- a/tutorial/basic/setup.html +++ b/tutorial/basic/setup.html @@ -6,7 +6,7 @@ Database and Ontop Setup | Ontop - + @@ -49,7 +49,7 @@ FROM "uni1"."academic" WHERE "position" = 1

    # Ontop-Protégé setup

    Protégé is an open source ontology editor and knowledge management system. Ontop-Protégé is a plugin for designing and testing a VKG specification.

    1. Download the latest Ontop-Protégé bundle for your Operating System (opens new window) and unzip the archive and go into its folder
    2. Run it (run.bat on Windows, run.sh on Mac/Linux)
    3. Register the H2 JDBC driver: go to Preferences -> JDBC Drivers and add an entry with the following information -
      • Description: h2
      • Class Name: org.h2.Driver
      • Driver file (jar): /path/to/h2/bin/h2-1.4.196.jar

    # Programme

    1. Mapping the first data source
    2. Mapping the second data source
    - + diff --git a/tutorial/basic/university-1.html b/tutorial/basic/university-1.html index 16ff9bcaa..3788b33c5 100644 --- a/tutorial/basic/university-1.html +++ b/tutorial/basic/university-1.html @@ -6,7 +6,7 @@ First data source: university 1 | Ontop - + @@ -91,7 +91,7 @@ ?teacher a :Teacher . }

    These inference capabilities can be, for a large part, understood as the ability to infer new mappings -from the original mappings and the ontological axioms (e.g. Professor is a sub-class of Teacher). We will discuss it later in this tutorial.

    - + diff --git a/tutorial/basic/university-2.html b/tutorial/basic/university-2.html index b00de2757..19349badb 100644 --- a/tutorial/basic/university-2.html +++ b/tutorial/basic/university-2.html @@ -6,7 +6,7 @@ Second data source: university 2 | Ontop - + @@ -70,7 +70,7 @@ FROM "uni2"."person" WHERE "status" = 1

    And so on for the graduate students, postdocs, full professors, associate professors and assistant professors.

    # SPARQL

    We can now run the previous SPARQL queries and observe that the results combine -entries from the two datasets.

    - + diff --git a/tutorial/endpoint/endpoint-cli.html b/tutorial/endpoint/endpoint-cli.html index 15cbe6b8e..d0c0c8fd9 100644 --- a/tutorial/endpoint/endpoint-cli.html +++ b/tutorial/endpoint/endpoint-cli.html @@ -6,7 +6,7 @@ Setting up an Ontop SPARQL endpoint with Ontop CLI | Ontop - + @@ -54,7 +54,7 @@ --properties=input/university-complete.properties ^ --cors-allowed-origins=http://yasgui.org
    1. Open the web interface of the SPARQL endpoint to try some queries: -http://localhost:8080/ (opens new window)
    - + diff --git a/tutorial/endpoint/endpoint-docker.html b/tutorial/endpoint/endpoint-docker.html index bfea58d21..e8e4bb163 100644 --- a/tutorial/endpoint/endpoint-docker.html +++ b/tutorial/endpoint/endpoint-docker.html @@ -6,7 +6,7 @@ Setting up an Ontop SPARQL endpoint with Docker | Ontop - + @@ -101,7 +101,7 @@ ports: - "8080:8080"

    Now we can simply start it:

    $ docker-compose up
    -

    It exposes the following two ports for the browser:

    It exposes the following two ports for the browser:

    - + diff --git a/tutorial/endpoint/endpoint-tomcat.html b/tutorial/endpoint/endpoint-tomcat.html index 9227f3a70..364f8fb26 100644 --- a/tutorial/endpoint/endpoint-tomcat.html +++ b/tutorial/endpoint/endpoint-tomcat.html @@ -6,7 +6,7 @@ SPARQL endpoint deployment using Ontop Tomcat/RDF4J bundle | Ontop - + @@ -57,7 +57,7 @@ ?prof a :FullProfessor ; foaf:lastName ?lastName . } ' -
    - +
    + diff --git a/tutorial/endpoint/index.html b/tutorial/endpoint/index.html index 34407b018..de9b6f952 100644 --- a/tutorial/endpoint/index.html +++ b/tutorial/endpoint/index.html @@ -6,7 +6,7 @@ Deploying a SPARQL endpoint | Ontop - + @@ -42,7 +42,7 @@ Work with us GitHub - (opens new window)

    # Deploying a SPARQL endpoint

    To deploy a SPARQL endpoint, we recommend to use the Ontop endpoint from the

    - + diff --git a/tutorial/external-tutorials.html b/tutorial/external-tutorials.html index 92d67442d..71ba5495e 100644 --- a/tutorial/external-tutorials.html +++ b/tutorial/external-tutorials.html @@ -6,7 +6,7 @@ External tutorials | Ontop - + @@ -43,11 +43,11 @@ GitHub (opens new window)

    # External tutorials

    - + diff --git a/tutorial/federation/denodo/index.html b/tutorial/federation/denodo/index.html index e712ab27d..b0b221ff0 100644 --- a/tutorial/federation/denodo/index.html +++ b/tutorial/federation/denodo/index.html @@ -6,7 +6,7 @@ Ontop with Denodo | Ontop - + @@ -73,7 +73,7 @@ ?o sosa:resultTime ?t . } LIMIT 100 -
    - + diff --git a/tutorial/federation/dremio/index.html b/tutorial/federation/dremio/index.html index 1c36df7bf..559906c74 100644 --- a/tutorial/federation/dremio/index.html +++ b/tutorial/federation/dremio/index.html @@ -6,7 +6,7 @@ Ontop with Dremio | Ontop - + @@ -95,7 +95,7 @@ ?student foaf:firstName ?firstName . ?student foaf:lastName ?lastName . } -
    - + diff --git a/tutorial/federation/index.html b/tutorial/federation/index.html index 0eb1da7ba..a30e434df 100644 --- a/tutorial/federation/index.html +++ b/tutorial/federation/index.html @@ -6,7 +6,7 @@ Federating multiple databases | Ontop - + @@ -42,7 +42,7 @@ Work with us GitHub - (opens new window)
    - + diff --git a/tutorial/federation/teiid/index.html b/tutorial/federation/teiid/index.html index c28a29b91..c0c6748fc 100644 --- a/tutorial/federation/teiid/index.html +++ b/tutorial/federation/teiid/index.html @@ -6,7 +6,7 @@ Ontop with Teiid | Ontop - + @@ -128,7 +128,7 @@

    you can obtain the following certain answers which are generated by extracting and merging the data obatined from uni1 and uni2:

    [x z y e]
     [x/<http://example.org/voc#uni1/course/1602>,z/<http://example.org/voc#uni2/course/1>,y/"Information security",e/<http://example.org/voc#uni2/person/1>]
     [x/<http://example.org/voc#uni1/course/1601>,z/<http://example.org/voc#uni2/course/6>,y/"Intelligent Systems",e/<http://example.org/voc#uni2/person/7>]
    -
    - + diff --git a/tutorial/index.html b/tutorial/index.html index 6c581fd1d..a3b8a43b5 100644 --- a/tutorial/index.html +++ b/tutorial/index.html @@ -6,7 +6,7 @@ Presentation | Ontop - + @@ -44,11 +44,11 @@ GitHub (opens new window)

    # Presentation

    In this tutorial, we will see how to design a Virtual Knowledge Graph (VKG) specification, how to deploy it as a SPARQL endpoint, how to consume it and further more advanced topics.

    # Requirements

    # Clone this repository

    Before start, please clone this repository in order to download all the files

    git clone https://github.com/ontop/ontop-tutorial.git
     cd ontop-tutorial
    -

    # Program

    1. Basics of VKG Modeling
    2. Deploying an Ontop SPARQL endpoint
    3. Interacting with an Ontop SPARQL endpoint
    4. Mapping Engineering
    5. Materialization using Ontop
    6. Federating multiple databases
    7. Lenses
    8. External tutorials

    # Program

    1. Basics of VKG Modeling
    2. Deploying an Ontop SPARQL endpoint
    3. Interacting with an Ontop SPARQL endpoint
    4. Mapping Engineering
    5. Materialization using Ontop
    6. Federating multiple databases
    7. Lenses
    8. External tutorials
    - + diff --git a/tutorial/interact/cli.html b/tutorial/interact/cli.html index fd85e2793..422964218 100644 --- a/tutorial/interact/cli.html +++ b/tutorial/interact/cli.html @@ -6,7 +6,7 @@ Interact with an Ontop SPARQL Endpoint | Ontop - + @@ -55,7 +55,7 @@ --header 'accept: application/json' \ --header 'content-type: application/sparql-query' \ --data 'PREFIX : <http://example.org/voc#> SELECT DISTINCT ?teacher {?teacher a :Teacher .}' -

    # Using a SPARQL client library

    Alternatively, you may use one of the many SPARQL clients (opens new window) available for many programming and data analysis environments, as we demonstrate next using the SPARQLWrapper library within a Python Jupyter Notebook.

    # Using a SPARQL client library

    Alternatively, you may use one of the many SPARQL clients (opens new window) available for many programming and data analysis environments, as we demonstrate next using the SPARQLWrapper library within a Python Jupyter Notebook.

    - + diff --git a/tutorial/interact/jupyter.html b/tutorial/interact/jupyter.html index 703cfb77b..bc7a471ac 100644 --- a/tutorial/interact/jupyter.html +++ b/tutorial/interact/jupyter.html @@ -6,7 +6,7 @@ Use Jupyter Notebook with an Ontop SPARQL endpoint | Ontop - + @@ -157,7 +157,7 @@ </code></pre> <!--beforeend--></div><!--afterend-->
    lname course_title
    count 17 17
    unique 8 11
    top Smith Linear Algebra
    freq 3 3
    df['course_title'].value_counts().plot(kind='bar')
     
    <matplotlib.axes._subplots.AxesSubplot at 0x11475ebd0>
    -
    - + diff --git a/tutorial/lenses/basic-lens.html b/tutorial/lenses/basic-lens.html index 23c8823ff..f0c61fd63 100644 --- a/tutorial/lenses/basic-lens.html +++ b/tutorial/lenses/basic-lens.html @@ -6,7 +6,7 @@ Basic Lens | Ontop - + @@ -173,7 +173,7 @@ } ] } -

    Lenses can reference each other! As a further exercise, you can try using this newly created lens as the baseRelation of the managers filter from before. Once that is done, you can query it again - the results should be the same as before.

    NOTE

    We could also have added all of these constraints to the same managers_filter lens from the previous section to achieve the same results. This has the advantage of reducing the work required for the lens setup and reducing the total number of relations accessible by Ontop, but it is less flexible, as we would have to copy all the constraints to the guides_filter and guard_filter lenses as well, resulting in a lot of duplication.

    Generally, the optimal solution depends on the specific scenario.

    Lenses can reference each other! As a further exercise, you can try using this newly created lens as the baseRelation of the managers filter from before. Once that is done, you can query it again - the results should be the same as before.

    NOTE

    We could also have added all of these constraints to the same managers_filter lens from the previous section to achieve the same results. This has the advantage of reducing the work required for the lens setup and reducing the total number of relations accessible by Ontop, but it is less flexible, as we would have to copy all the constraints to the guides_filter and guard_filter lenses as well, resulting in a lot of duplication.

    Generally, the optimal solution depends on the specific scenario.

    - + diff --git a/tutorial/lenses/flatten-lens.html b/tutorial/lenses/flatten-lens.html index d70974aee..e652e2c01 100644 --- a/tutorial/lenses/flatten-lens.html +++ b/tutorial/lenses/flatten-lens.html @@ -6,7 +6,7 @@ Flatten Lens | Ontop - + @@ -88,7 +88,7 @@ ?worker :hasTitle ?title . ?worker :preferredTitle ?prefTitle } -

    This should result in a list of all employees, together with their titles and their preferred title.

    # Flattening other types of arrays

    The flatten lens works on all types of arrays, and, depending on the capabilities of the dialect, can infer the output type of the flattened column. As a further exercise, try looking at the table museums.

    column type
    museum_id integer
    name string
    address string
    yearly_income integer
    yearly_spendings integer
    ratings array of floats

    The field ratings is an array of floating point numbers between 1 and 10. Try creating a flatten lens that can unnest this array to populate the datatype property :hasRating! Ontop will be able to automatically detect that the flattened column has the type FLOAT. Keep in mind that we do not necessarily need a "position" column for this use case.

    WARNING

    When arrays in a given dialect are defined as ARRAY<T>, T[], or similarly, Ontop is able to infer the data type of the output column after flattening. However, when this is not the case (either the array was provided as JSON or the array data type of the dialect is simply called ARRAY or similarly), Ontop cannot perform this inference. In those cases, it is suggested to put a basic lens over the flatten lens that explicitly performs a CAST on the output, to allow Ontop to know the column type once again.

    WARNING

    The level of support for the flatten lens depends strongly on the dialect. Please consult the flatten lens documentation page for more info on each supported dialect.

    This should result in a list of all employees, together with their titles and their preferred title.

    # Flattening other types of arrays

    The flatten lens works on all types of arrays, and, depending on the capabilities of the dialect, can infer the output type of the flattened column. As a further exercise, try looking at the table museums.

    column type
    museum_id integer
    name string
    address string
    yearly_income integer
    yearly_spendings integer
    ratings array of floats

    The field ratings is an array of floating point numbers between 1 and 10. Try creating a flatten lens that can unnest this array to populate the datatype property :hasRating! Ontop will be able to automatically detect that the flattened column has the type FLOAT. Keep in mind that we do not necessarily need a "position" column for this use case.

    WARNING

    When arrays in a given dialect are defined as ARRAY<T>, T[], or similarly, Ontop is able to infer the data type of the output column after flattening. However, when this is not the case (either the array was provided as JSON or the array data type of the dialect is simply called ARRAY or similarly), Ontop cannot perform this inference. In those cases, it is suggested to put a basic lens over the flatten lens that explicitly performs a CAST on the output, to allow Ontop to know the column type once again.

    WARNING

    The level of support for the flatten lens depends strongly on the dialect. Please consult the flatten lens documentation page for more info on each supported dialect.

    - + diff --git a/tutorial/lenses/index.html b/tutorial/lenses/index.html index 24a53ce70..f4fd8af32 100644 --- a/tutorial/lenses/index.html +++ b/tutorial/lenses/index.html @@ -6,7 +6,7 @@ Using lenses | Ontop - + @@ -47,7 +47,7 @@ "relations": [Lens] }

    where each Lens object corresponds to one particular lens, holding a name through which it can be referenced in the mapping and a type which indicates the specific type of the lens. -We can include any number of lenses in this file, and they can reference database relations as well as each other.

    Some more common features of lenses will be discussed in the Basic Lens section.

    In each of these sections, we will construct one mapping file and one lenses file that can be passed to Ontop. To simplify testing, a common template for all mapping files is already included in the tutorial files. You can continue the preparation of the individual mappings from this template.

    - + diff --git a/tutorial/lenses/join-lens.html b/tutorial/lenses/join-lens.html index f65bb1356..50a3a60e6 100644 --- a/tutorial/lenses/join-lens.html +++ b/tutorial/lenses/join-lens.html @@ -6,7 +6,7 @@ Join Lens | Ontop - + @@ -122,7 +122,7 @@ ?worker :name ?name . ?worker :workAddress ?address . } -

    If everything was prepared correctly, this should result in a list of employee names, together with the address of the museum they work at.

    If everything was prepared correctly, this should result in a list of employee names, together with the address of the museum they work at.

    - + diff --git a/tutorial/lenses/setup.html b/tutorial/lenses/setup.html index 45fc4a7b4..026515ac3 100644 --- a/tutorial/lenses/setup.html +++ b/tutorial/lenses/setup.html @@ -6,7 +6,7 @@ Database and Ontop Setup | Ontop - + @@ -57,7 +57,7 @@ --properties=input/duckdb.properties ^ --cors-allowed-origins=http://yasgui.org
    1. Open the web interface of the SPARQL endpoint to try some queries: -http://localhost:8080/ (opens new window)
    - + diff --git a/tutorial/lenses/sql-lens.html b/tutorial/lenses/sql-lens.html index 1472c2bc9..1ad77ba5c 100644 --- a/tutorial/lenses/sql-lens.html +++ b/tutorial/lenses/sql-lens.html @@ -6,7 +6,7 @@ SQL Lens | Ontop - + @@ -81,7 +81,7 @@ } ] } -

    While this will not change the output of the sample query, it may help Ontop optimize its queries in specific instances (see primary key).

    WARNING

    It is advised to be cautious when using SQL lenses. Generally, they should not refer to other lenses if the SQL expression is complex, and they may not be able to infer integrity constraints. For more information, please visit the documentation page of lenses.

    While this will not change the output of the sample query, it may help Ontop optimize its queries in specific instances (see primary key).

    WARNING

    It is advised to be cautious when using SQL lenses. Generally, they should not refer to other lenses if the SQL expression is complex, and they may not be able to infer integrity constraints. For more information, please visit the documentation page of lenses.

    - + diff --git a/tutorial/lenses/union-lens.html b/tutorial/lenses/union-lens.html index 9c6580a0f..863dfdb41 100644 --- a/tutorial/lenses/union-lens.html +++ b/tutorial/lenses/union-lens.html @@ -6,7 +6,7 @@ Union Lens | Ontop - + @@ -156,7 +156,7 @@ ?exhibit :exhibitType ?type . ?exhibit :artistName ?artist } -

    we will once again get all earlier results, in addition to all exhibits contained in the art_exhibit table. While the earlier results will have the value None as their artist name, the art_exhibits entries will include the name of their artists.


    As a further exercise, notice how the values of :exhibitType are rather ugly: "art_exhibits", "lenses.historical_exhibits_extended", and "lenses.nature_exhibits_extended". Try adding a new basic lens over the union lens that transforms these into the values "art", "historical", and "nature" instead.

    Hint: Look at the SQL function REPLACE. Could it be used in the expression field of an added column to get rid of the _exhibits, _extended, and lenses. part?

    Notice how the union lens allowed you to perform this operation on all three of its base relations by just defining it once. Without the union lens, you would have required three such basic lenses, one for each table, with the exact same contents.

    we will once again get all earlier results, in addition to all exhibits contained in the art_exhibit table. While the earlier results will have the value None as their artist name, the art_exhibits entries will include the name of their artists.


    As a further exercise, notice how the values of :exhibitType are rather ugly: "art_exhibits", "lenses.historical_exhibits_extended", and "lenses.nature_exhibits_extended". Try adding a new basic lens over the union lens that transforms these into the values "art", "historical", and "nature" instead.

    Hint: Look at the SQL function REPLACE. Could it be used in the expression field of an added column to get rid of the _exhibits, _extended, and lenses. part?

    Notice how the union lens allowed you to perform this operation on all three of its base relations by just defining it once. Without the union lens, you would have required three such basic lenses, one for each table, with the exact same contents.

    - + diff --git a/tutorial/mapping/existential.html b/tutorial/mapping/existential.html index c10e0b760..b18650c13 100644 --- a/tutorial/mapping/existential.html +++ b/tutorial/mapping/existential.html @@ -6,7 +6,7 @@ Bonus: existential reasoning | Ontop - + @@ -52,7 +52,7 @@ SELECT ?x { ?x a :GraduateStudent . } -
    - + diff --git a/tutorial/mapping/foreign-keys.html b/tutorial/mapping/foreign-keys.html index 25d78b4c8..a39c7b875 100644 --- a/tutorial/mapping/foreign-keys.html +++ b/tutorial/mapping/foreign-keys.html @@ -6,7 +6,7 @@ Role of foreign keys | Ontop - + @@ -116,7 +116,7 @@ ?p foaf:firstName ?firstName ; foaf:lastName ?lastName . } -
    - + diff --git a/tutorial/mapping/index.html b/tutorial/mapping/index.html index ccb9bcde8..8c78b676c 100644 --- a/tutorial/mapping/index.html +++ b/tutorial/mapping/index.html @@ -6,7 +6,7 @@ Second session: Mapping Engineering | Ontop - + @@ -43,7 +43,7 @@ GitHub (opens new window)

    # Second session: Mapping Engineering

    We discuss here some advanced topics related to mappings engineering and the exploitation of -available database constraints, which affect the performance of generated SQL queries:

    1. Role of primary keys
    2. Role of foreign keys
    3. Choice of the IRI templates
    4. Existential reasoning
    - + diff --git a/tutorial/mapping/primary-keys.html b/tutorial/mapping/primary-keys.html index 2744e890b..f2793d246 100644 --- a/tutorial/mapping/primary-keys.html +++ b/tutorial/mapping/primary-keys.html @@ -6,7 +6,7 @@ Role of primary keys (unique constraints) | Ontop - + @@ -111,7 +111,7 @@ WHERE QVIEW1."s_id" IS NOT NULL AND QVIEW1."first_name" IS NOT NULL AND QVIEW1."last_name" IS NOT NULL -

    As you can see, the self-joins are removed when primary keys are provided and used as joining conditions.

    As you can see, the self-joins are removed when primary keys are provided and used as joining conditions.

    - + diff --git a/tutorial/mapping/uri-templates.html b/tutorial/mapping/uri-templates.html index 49b602e76..ccd68aa1e 100644 --- a/tutorial/mapping/uri-templates.html +++ b/tutorial/mapping/uri-templates.html @@ -6,7 +6,7 @@ Choice of the IRI templates | Ontop - + @@ -114,7 +114,7 @@

    # Mapping uni2.person-canonical

    • Target:
    :person/{ssn} obda:isCanonicalIRIOf :uni2/person/{pid} . 
     
    • Source:
    SELECT * FROM "uni2"."person"
     

    With these three mapping assertions and the ones of the first session, Ontop produces the same saturated mapping assertions as in the manual approach. -Query evaluation performance is thus the same (and similarly affected to the additional joins needed to build person IRIs), but the use of canonical IRI templates makes simpler for users to define and adapt mappings.

    - + diff --git a/tutorial/materialization/materialization.html b/tutorial/materialization/materialization.html index 32721728e..d9f3bf09f 100644 --- a/tutorial/materialization/materialization.html +++ b/tutorial/materialization/materialization.html @@ -6,7 +6,7 @@ How to materialize data into a graph database | Ontop - + @@ -58,7 +58,7 @@ ?s ?p ?o } } -

    This query materializes the same triples as with the first approach.

    # Choosing the Right Approach for Your Use Case

    1. Small Dataset, Easy Communication: If your dataset isn't large and you can easily set up communication between the Ontop SPARQL endpoint and the graph database, go with solution #2. It avoids dealing with files and intermediate storage.

    2. Large Dataset, Efficient Loading: For very large datasets, choose the most efficient loading solution supported by the triplestore, even if it requires more effort to set up.

    3. Materializing Fragments of the KG: Solution #2 allows easy materialization of specific fragments of the Knowledge Graph by adapting the SPARQL query. You can have hybrid KGs with some parts stored in the graph database and the rest kept virtual.

    4. Advantage of Keeping Data Virtual: Keeping data virtual is great for large volumes of sensor data that constantly update. It's better to keep this part virtual while storing rich contextual information in the graph database.

    # Ontology Usage

    If you're familiar with Ontop, you might have noticed that we didn't use an ontology in this example. Providing an ontology to Ontop can result in a significantly larger KG due to the reasoning capabilities embedded in Ontop. However, GraphDB also has reasoning capabilities, allowing reasoning to be done later in GraphDB, making materialization simpler and faster. If your graph database doesn't support reasoning, Ontop can handle it.

    This query materializes the same triples as with the first approach.

    # Choosing the Right Approach for Your Use Case

    1. Small Dataset, Easy Communication: If your dataset isn't large and you can easily set up communication between the Ontop SPARQL endpoint and the graph database, go with solution #2. It avoids dealing with files and intermediate storage.

    2. Large Dataset, Efficient Loading: For very large datasets, choose the most efficient loading solution supported by the triplestore, even if it requires more effort to set up.

    3. Materializing Fragments of the KG: Solution #2 allows easy materialization of specific fragments of the Knowledge Graph by adapting the SPARQL query. You can have hybrid KGs with some parts stored in the graph database and the rest kept virtual.

    4. Advantage of Keeping Data Virtual: Keeping data virtual is great for large volumes of sensor data that constantly update. It's better to keep this part virtual while storing rich contextual information in the graph database.

    # Ontology Usage

    If you're familiar with Ontop, you might have noticed that we didn't use an ontology in this example. Providing an ontology to Ontop can result in a significantly larger KG due to the reasoning capabilities embedded in Ontop. However, GraphDB also has reasoning capabilities, allowing reasoning to be done later in GraphDB, making materialization simpler and faster. If your graph database doesn't support reasoning, Ontop can handle it.

    - +