80 likes | 193 Views
Goals. Create a conceptual query (ConQuer) language that exhibits the following characteristics: Semantic Strength – The user should be able to formulate any query that they can conceive
E N D
Goals • Create a conceptual query (ConQuer) language that exhibits the following characteristics: • Semantic Strength – The user should be able to formulate any query that they can conceive • Semantic Clarity – It should be easy to formulate a query in the language, and a query in the language should be easy to understand • Semantic Relevance – Only information relevant to the query should be needed within the query • Semantic Stability – Query formulations should remain the same for as many model reformulations as possible • Semantic Independence - Conceptual data independence?
Query Language based on ORM • ORM shows a more abstract representation of a model than a database schema • And more abstract than ER representation • ORM does not distinguish between attributes and relationships • ORM is based on English descriptions of relationships and objects • A query language based on ORM inherits all of these qualities!
Example Query 1 Which employees live in the city in which branch 52 is located? Employee +- lives in City +- is location of Branch 52 Versus SQL: select X1.empnr from Employee as X1, Branch as X2 where X1.cityname = X2.cityname and X1.statecode = X2.statecode and X1.country = X2.country and X2.branchnr = 52
Example Query 2 “Who supervises an employee who lives in the same city as the supervisor but was born in a different country from the supervisor?” Employee1 +- lives in City1 +- was born in Country1 +- supervises Employee2 +- lives in City1 +- was born in Country2 <> Country1 What would this look like in SQL?
Conceptual Data Independence • Querying at the conceptual level provides abstraction from relational (in the mathematical sense) constructs • Join cardinalities are irrelevant to query formulation • Inner versus Outer joins are expressed more clearly (maybe keyword) • Knowledge of matching keys is not necessary!
Further Reading • ORM References • Business Rules and ORM: http://www.orm.net/pdf/dppd.pdf • ORM: An Overview: http://www.orm.net/pdf/ORMwhitePaper.pdf • Much much more with respect to ORM and business knowledge representation • http://www.orm.net
Using Semantic Web Technology for Conceptual Queries • OWL (Web Ontology Language) –http://www.w3.org/TR/owl-features/ • Models formal semantics in a way that lends itself to web sharing and cumulative knowledge • SWRL (Semantic Web Rule Language) – http://www.w3.org/Submission/SWRL/ • Models rules that enhance the meaning that can be expressed in OWL; also useful for translating between OWL ontologies
Data Source RDBMS RDBMS Semantic Query Architecture 1 Query: SPARQL Query Result Set 6 Query Decomposition Semantic Query Decomposition (SQD) 2 Backwards Rule Chaining 5 Generation ofSub Queries 3 Semantic Bridge Database Semantic Bridge Web Service Semantic Bridge Database 4 Data Access