{{Short description|Aspect of information processing}}{{Semantics}}
'''Semantic queries''' allow for queries and analytics of associative and contextual nature. Semantic queries enable the retrieval of both explicitly and implicitly derived information based on syntactic, semantic and structural information contained in data. They are designed to deliver precise results (possibly the distinctive selection of one single piece of information) or to answer more fuzzy and wide open questions through pattern matching and digital reasoning.
Semantic queries work on named graphs, linked data or triples. This enables the query to process the actual relationships between information and ''infer'' the answers from the ''network of data''. This is in contrast to semantic search, which uses semantics (meaning of language constructs) in unstructured text to produce a better search result. (See natural language processing.)
From a technical point of view, semantic queries are precise relational-type operations much like a database query. They work on structured data and therefore have the possibility to utilize comprehensive features like operators (e.g. >, < and =), namespaces, pattern matching, subclassing, transitive relations, semantic rules and contextual full text search. The semantic web technology stack of the W3C is offering SPARQL<ref name="XML.com">{{cite web|url=http://www.xml.com/pub/a/2005/11/16/introducing-sparql-querying-semantic-web-tutorial.html |title=Introducing SPARQL: Querying the Semantic Web |publisher=XML.com|date=2005}}</ref><ref name="W3C">{{cite web|url=http://www.w3.org/TR/rdf-sparql-query |title=SPARQL Query Language for RDF |publisher=W3C|date=2008}}</ref> to formulate semantic queries in a syntax similar to SQL. Semantic queries are used in triplestores, graph databases, semantic wikis, natural language and artificial intelligence systems.
== Background ==
Relational databases represent all relationships between data in an ''implicit'' manner only.<ref name="ACM-DL">{{cite book|url=http://portal.acm.org/citation.cfm?id=1646157 |title=Semantic queries in databases: problems and challenges |series=Cikm '09 |publisher=ACM Digital Library|date=2009|pages=1505–1508 |doi=10.1145/1645953.1646157 |isbn=9781605585123 |s2cid=1578867 }}</ref><ref name="ESWC">{{cite web|url=http://2012.eswc-conferences.org/sites/default/files/eswc2012_submission_357.pdf |title=Karma: A System for Mapping Structured Sources into the Semantic Web |publisher=eswc-conferences.org|date=2012}}</ref> For example, the relationships between customers and products (stored in two content-tables and connected with an additional link-table) only come into existence in a query statement (SQL in the case of relational databases) written by a developer. Writing the query demands exact knowledge of the database schema.<ref name="IEEE">{{cite web |url=http://www-scf.usc.edu/~taheriya/papers/taheriyan14-icsc-paper.pdf |title=A Scalable Approach to Learn Semantic Models of Structured Sources |publisher=8th IEEE International Conference on Semantic Computing |date=2014 |access-date=2014-12-07 |archive-date=2017-09-22 |archive-url=https://web.archive.org/web/20170922005510/http://www-scf.usc.edu/%7Etaheriya/papers/taheriyan14-icsc-paper.pdf |url-status=dead }}</ref><ref name="AAAI">{{cite web|url=http://www.isi.edu/integration/papers/knoblock13-sbd.pdf |title=Semantics for Big Data Integration and Analysis |publisher=AAAI Fall Symposium on Semantics for Big Data|date=2013}}</ref>
Linked-Data represent all relationships between data in an ''explicit'' manner. In the above example, no query code needs to be written. The correct product for each customer can be fetched automatically. Whereas this simple example is trivial, the real power of linked-data comes into play when a ''network of information'' is created (customers with their geo-spatial information like city, state and country; products with their categories within sub- and super-categories). Now the system can automatically answer more complex queries and analytics that look for the connection of a particular location with a product category. The development effort for this query is omitted. Executing a semantic query is conducted by ''walking'' the network of information and finding matches (also called Data Graph Traversal).<ref name="GraphQLang">{{cite web | title = Introduction to Graph Query Languages. From SPARQL to Gremlin | url = https://graph.build/resources/graph-query-languages | publisher = Graph.build | access-date = 11 August 2025 }}</ref>
Another important aspect of semantic queries is that the type of the relationship can be used to incorporate intelligence into the system. The relationship between a customer and a product has a fundamentally different nature than the relationship between a neighbourhood and its city. The latter enables the semantic query engine to ''infer'' that a customer ''living in Manhattan is also living in New York City'' whereas other relationships might have more complicated patterns and "contextual analytics". This process is called inference or reasoning and is the ability of the software to derive new information based on given facts.
== Articles ==
* {{Cite web | last = Velez | first = Golda | year = 2008 | url = http://www.wallstreetandtech.com/data-management/semantics-help-wall-street-cope-with-data-overload/d/d-id/1259662.html | title = Semantics Help Wall Street Cope With Data Overload | work = Wall Street & Technology | publisher = wallstreetandtech.com }} * {{Cite conference | last = Zhifeng | first = Xiao | editor2-first = Xinming | editor2-last = Tang | editor1-first = Yaolin | editor1-last = Liu |book-title=International Symposium on Spatial Analysis, Spatial-Temporal Data Modeling, and Data Mining |date=2009 | bibcode = 2009SPIE.7492E..60X |title=Spatial information semantic query based on SPARQL | volume = 7492 | pages = 74921P | publisher=SPIE | doi = 10.1117/12.838556 | s2cid = 62191842 }} * {{Cite web | last = Aquin | first = Mathieu | year = 2010 | url = http://www.semantic-web-journal.net/sites/default/files/swj96_1.pdf | title = Watson, more than a Semantic Web search engine | publisher = Semantic Web Journal }} * {{Cite web | last = Dworetzky | first = Tom | year = 2011 | url = http://www.ibtimes.com/how-siri-works-iphones-brain-comes-natural-language-processing-stanford-professors-teach-free-online | title = How Siri Works: iPhone's 'Brain' Comes from Natural Language Processing | work = International Business Times }} * {{Cite web | last = Horwitt | first = Elisabeth | year = 2011 | url = http://www.computerworld.com/s/article/9209118/The_semantic_Web_gets_down_to_businessarticleID=208700210&pgno=2 | title = The semantic Web gets down to business | publisher = computerworld.com }} * {{Cite news | last = Rodriguez | first = Marko | year = 2011 | url = http://markorodriguez.com/2011/06/15/graph-pattern-matching-with-gremlin-1-1/ | title = Graph Pattern Matching with Gremlin | newspaper = Marko A. Rodriguez | publisher = markorodriguez.com on Graph Computing }} * {{Cite web | last = Sequeda | first = Juan | year = 2011 | url = http://www.cambridgesemantics.com/semantic-university/sparql-nuts-and-bolts | title = SPARQL Nuts & Bolts | publisher = Cambridge Semantics }} * {{Cite web | last = Freitas | first = Andre | year = 2012 | url = https://www.deri.ie/sites/default/files/publications/freitas_ic_12.pdf | title = Querying Heterogeneous Datasets on the Linked Data Web | publisher = IEEE Internet Computing }} * {{Cite web | last = Kauppinen | first = Tomi | year = 2012 | url = http://linkedscience.org/tools/sparql-package-for-r/tutorial-on-sparql-package-for-r/ | title = Using the SPARQL Package in R to handle Spatial Linked Data | publisher = linkedscience.org }} * {{Cite web | last = Lorentz | first = Alissa | year = 2013 | url = https://www.wired.com/2013/04/with-big-data-context-is-a-big-issue/ | title = With Big Data, Context is a Big Issue | publisher = Wired }}
== See also ==
* Attention * Dataspaces * Knowledge Representation * Linked Data * Ontology alignment * Philosophy * Semantic Integration * Semantic publishing * Semantics of Business Vocabulary and Business Rules * SPARQL
== References == {{reflist}} ==Further reading== {{refbegin|30em}} * {{cite journal |last1=Calvanese |first1=Diego |last2=De Giacomo |first2=Giuseppe |last3=Lembo |first3=Domenico |last4=Lenzerini |first4=Maurizio |last5=Rosati |first5=Riccardo |title=Tractable reasoning and efficient query answering in description logics: The DL-Lite family |journal=Journal of Automated Reasoning |volume=39 |issue=3 |pages=385–429 |year=2007 |doi=10.1007/s10817-007-9078-x}}
* {{cite book |editor1-last=Fensel |editor1-first=Dieter |editor2-last=Hendler |editor2-first=James |editor3-last=Lieberman |editor3-first=Henry |editor4-last=Wahlster |editor4-first=Wolfgang |title=Spinning the Semantic Web: Bringing the World Wide Web to Its Full Potential |publisher=MIT Press |year=2003 |isbn=9780262062329}}
* {{cite conference |last1=López |first1=Vanessa |last2=Sabou |first2=Marta |last3=Motta |first3=Enrico |title=PowerAqua: Open Question Answering on the Semantic Web |work=Proceedings of the European Semantic Web Conference (ESWC) |pages=424–439 |year=2006 |doi=10.1007/11762256_32}}
* {{cite journal |last1=Shekarpour |first1=Saeedeh |last2=Marx |first2=Edgard |last3=Auer |first3=Sören |title=Question answering on interlinked data |journal=Journal of Web Semantics |volume=41 |pages=100–117 |year=2017 |doi=10.1016/j.websem.2016.10.001 |url=http://urn.kb.se/resolve?urn=urn:nbn:se:liu:diva-133742 }}
* {{cite arXiv |last1=Zhang |first1=Shuai |last2=Wang |first2=Ke |last3=Zhang |first3=Yue |title=Enriching query semantics for code search with reinforcement learning |eprint=2105.09630 |date=2021 |class=cs.SE }}
* {{cite journal |last1=Tiwari |first1=Vivek |last2=Singh |first2=Anjali |title=Semantic approaches for query expansion: A comprehensive review |journal=PeerJ Computer Science |volume=2025 |pages=2664 |year=2025 |doi=10.7717/peerj-cs.2664 |pmid=40134880 |pmc=11935759 |doi-access=free }}
* {{cite conference |last1=Haase |first1=Peter |last2=Motik |first2=Boris |title=A mapping system for query answering over ontologies |work=Proceedings of the International Semantic Web Conference (ISWC) |pages=446–461 |year=2005 |doi=10.1007/11574620_32}} {{refend}}
==External links== *{{cite web|url= http://www.w3.org/standards/semanticweb/query|title =W3C Semantic Web Standards - Query|publisher=W3C|access-date=11 August 2025}} * {{cite web | title = SPARQL 1.1 Query Language | url = https://www.w3.org/TR/sparql11-query/ | publisher = W3C | date = 21 March 2013 | access-date = 11 August 2025 }}
Category:Data management Category:Query languages Category:Semantic Web