DQL Server Powered By JTP
Download
1 / 16

DQL Server Powered By JTP - PowerPoint PPT Presentation


  • 137 Views
  • Uploaded on

DQL Server Powered By JTP. Demonstration Slide Show Knowledge Systems Laboratory Stanford University. DQL Server Powered by JTP Overview.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' DQL Server Powered By JTP' - darrius-echo


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

DQL Server Powered By JTP

Demonstration Slide Show

Knowledge Systems Laboratory

Stanford University


DQL Server Powered by JTP Overview

The DQL Server is a server which answers queries written in the DAML+OIL Query Language (DQL). DQL has been written as an abstract specification, and at Stanford's Knowledge Systems Laboratory we have taken the abstract specification and produced an XML syntax for DQL.

The DQL Server is powered by the Java Theorem Prover package, which is a framework of reasoners that operate on DAML+OIL. DQL Server itself runs as a Java Servlet, compatible with application servers such as the Tomcat Java server.

In this demonstration, there are two servers. There is a server which this Web browser is talking to, called the Front End. This interaction uses the usual Web formats of HTTP and HTML. There is a Back End server, which the Front End talks to using the DQL syntax for SOAP/XML with HTTP. SOAP is an XML-based messaging protocol commonly used in Web Services.


Example: Type Inheritance to Superclass

Let's begin by taking a look at an example. In this example, we have had the DQL server load the KSL's Wines Knowledge Base, which contains knowledge about wines and the foods that go with them. The JTP reasoner has been run over the KB and it is ready to answer queries.

In the first query, we will be looking at type inheritance to superclasses.

In this case, we have the following given information:

rdfs:subClassOf tkb:NON-OYSTER-SHELLFISH tkb:SHELLFISH

daml:disjointWith tkb:NON-OYSTER-SHELLFISH tkb:OYSTER-SHELLFISH

rdf:type tkb:CRAB tkb:NON-OYSTER-SHELLFISH

For this query, we will not require a premise.

We know that: CRAB is a NON-OYSTER-SHELLFISH.

We know that NON-OYSTER-SHELLFISH are SHELLFISH.

So we expect this query to succeed.

Query:

Query (cont.):

Query (cont.):

Query (cont.):

rdf:type tkb:CRAB tkb:SHELLFISH


Example: Type Inheritance to Superclass (cont.)

  • As can be seen by the HTML response below, this query has succeeded. The server performed its reasoning, and determined that CRABs are a type of SHELLFISH.

    • Query Successful

    • Bindings

      • rdf:typetkb:CRABtkb:SHELLFISH

  • Let's now look at the DQL messages which were sent between the Front End and the Back End.


  • Example: Type Inheritance to Superclass (cont.)

    Below is the query message sent with this request. The KB URL has been abbreviated to "wines.daml" for clarity in presentation.

    Notice that it has the required sections that are defined by the DQL abstract specification:

    The queryPattern section defines the query as a set of reified RDF Statements.

    The other section is the answerKBPattern section specifying the URL of a DAML+OIL document to use when answering the query.

    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"

    SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">

    <SOAP-ENV:Body>

    <dql:query xmlns:dql="http://www.daml.org/2002/10/dql-syntax#"

    xmlns:var="http://www.daml.org/2002/10/dql-variables#"

    xmlns:tkb="wines.daml#“

    xmlns:rdf=“http://www.w3.org/1999/02/22-rdf-syntax-ns#”

    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"

    xmlns:daml="http://www.daml.org/2001/03/daml+oil#">

    <dql:queryPattern>

    <rdf:Statement>

    <rdf:predicate rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#type"/>

    <rdf:subject rdf:resource="wines.daml#CRAB"/>

    <rdf:object rdf:resource="wines.daml#SHELLFISH"/>

    </rdf:Statement>

    </dql:queryPattern>

    <dql:answerKBPattern>

    <dql:kbRef rdf:resource="wines.daml"/>

    </dql:answerKBPattern>

    </dql:query>

    </SOAP-ENV:Body>

    </SOAP-ENV:Envelope>


    Example: Type Inheritance to Superclass (cont.)

    Below is the server's response message. The KB URL has been abbreviated to "wines.daml“. Notice that it also has the required sections that are defined by the DQL abstract specification. The server repeats the client's queryPattern, and returns a set of answer tags.

    Had the query failed, there would be no answers. The last answer is actually a continuation with a token of none, meaning there are no more answers.

    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"

    SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">

    <SOAP-ENV:Body>

    <dql:answerBundle xmlns:dql=“http://www.daml.org/2002/10/dql-syntax#”

    xmlns:var=“http://www.daml.org/2002/10/dql-variables#”

    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">

    <dql:queryPattern xmlns:dql="http://www.daml.org/2002/10/dql-syntax#">

    <rdf:Statement xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">

    <rdf:predicate rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#type" />

    <rdf:subject rdf:resource="wines.daml#CRAB" />

    <rdf:object rdf:resource="wines.daml#SHELLFISH" />

    </rdf:Statement>

    </dql:queryPattern>

    <dql:answer>

    <dql:binding-set>

    </dql:binding-set>

    </dql:answer>

    <dql:continuation>

    <dql:termination-token>

    <dql:none/>

    </dql:termination-token>

    </dql:continuation>

    </dql:answerBundle>

    </SOAP-ENV:Body>

    </SOAP-ENV:Envelope>


    Example: Inferences using toClass and hasValue

    Let's take a look at another example using JTP and the Wines KB.

    In this query, we will be looking at inferences using toClass and hasValue. We have the following given information in the wines KB:

    rdfs:subClassOf tkb:SEAFOOD-COURSE tkb:MEAL-COURSE

    rdfs:subClassOf tkb:SEAFOOD-COURSE tkb:DRINK-HAS-WHITE-COLOR-RESTRICTION

    Our premise is that we want to discuss a food course, and what drink will best accompany it.

    In this case, our new course is a SEAFOOD-COURSE, which as can be seen above, means that its DRINK must be COLOR WHITE.

    Let's fill in the premise below:

    We'd like to know what color its DRINK, W1, is, so we use a must-bind variable x:

    Now let's submit it and see what happens.

    rdf:type tkb:NEW-COURSE tkb:SEAFOOD-COURSE

    tkb:DRINK tkb:NEW-COURSE tkb:W1

    tkb:COLOR tkb:W1 ?x


    Example: Inferences using toClass and hasValue (cont.)

    • As can be seen by the response below, this query has produced a binding that W1 has COLOR WHITE. The server performed its reasoning, and determined that because SEAFOOD-COURSE requires a DRINK with COLOR WHITE, W1 must have COLOR WHITE.

      • Query Successful

      • Premise

        • rdf:type tkb:NEW-COURSE tkb:SEAFOOD-COURSE

        • tkb:DRINK tkb:NEW-COURSE tkb:W1

      • Bindings

        • tkb:COLORtkb:W1tkb:WHITE

  • The next two slides will show the DQL protocol messages that were used.


  • Example: Inferences using toClass and hasValue (cont.)

    This is the request message that was sent for this query. Notice that it contains two new sections: the premise, which is a set of DAML+OIL statements, and the mustBindVars section. The mustBindVars section defines variables whose values must be bound as per the DQL abstract specification. Once again the KB URL has been abbreviated to "wines.daml".

    <SOAP-ENV:Envelope <SOAP-ENV:Body>

    <dql:query>

    <dql:premise>

    <rdf:RDF>

    <rdf:Description rdf:about="wines.daml#NEW-COURSE">

    <rdf:type rdf:resource="wines.daml#SEAFOOD-COURSE"/> </rdf:Description>

    <rdf:Description rdf:about="wines.daml#NEW-COURSE">

    <tkb:DRINK rdf:resource="wines.daml#W1"/>

    </rdf:Description>

    </rdf:RDF>

    </dql:premise>

    <dql:mustBindVars>

    <var:x/>

    </dql:mustBindVars>

    <dql:queryPattern>

    <rdf:Statement>

    <rdf:predicate rdf:resource="wines.daml#COLOR"/>

    <rdf:subject rdf:resource="wines.daml#W1"/>

    <rdf:object rdf:resource="http://www.daml.org/2002/10/dql-variables#x"/>

    </rdf:Statement>

    </dql:queryPattern>

    <dql:answerKBPattern>

    <dql:kbRef rdf:resource="wines.daml"/>

    </dql:answerKBPattern>

    </dql:query>

    </SOAP-ENV:Body> </SOAP-ENV:Envelope>


    Example: Inferences using toClass and hasValue (cont.)

    This is the response message that was sent for this query. Notice that the answer sections have a new section for binding of must-bind or may-bind variables.

    <SOAP-ENV:Envelope>

    <SOAP-ENV:Body>

    <dql:answerBundle>

    <dql:queryPattern>

    <rdf:Statement xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">

    <rdf:predicate rdf:resource="wines.daml#COLOR" />

    <rdf:subject rdf:resource="wines.daml#W1" />

    <rdf:object rdf:resource="http://www.daml.org/2002/10/dql-variables#x" />

    </rdf:Statement>

    </dql:queryPattern>

    <dql:answer>

    <dql:binding-set>

    <var:x rdf:resource="wines.daml#WHITE"/>

    </dql:binding-set>

    </dql:answer>

    <dql:continuation>

    <dql:termination-token>

    <dql:none/>

    </dql:termination-token>

    </dql:continuation>

    </dql:answerBundle>

    </SOAP-ENV:Body>

    </SOAP-ENV:Envelope>


    Example: Inferences using toClass

    In this query, we will be looking at inferences using toClass. In this case, we have the following given information:

    rdfs:subClassOf tkb:BLAND-FISH-COURSE tkb:MEAL-COURSE

    Every food of tkb:BLAND-FISH-COURSE must be tkb:BLAND-FISH

    Let's fill in a premise that we have a BLAND-FISH-COURSE featuring DOVER-SOLE.

    And let’s ask what DOVER-SOLE is a type of.

    Premise:

    Premise (cont.):

    Premise (cont.):

    Premise (cont.):

    Query:

    Query (cont.):

    Query (cont.):

    Query (cont.):

    rdf:type tkb:NEW-COURSE tkb:BLAND-FISH-COURSE

    tkb:FOOD tkb:NEW-COURSE tkb:DOVER-SOLE

    rdf:type tkb:DOVER-SOLE ?x

    We want to know what kinds of things a DOVER-SOLE must be:

    Now let's submit it and see what happens.


    Example: Inferences using toClass (cont.)

    • As can be seen by the response below, this query has produced a set of bindings about the DOVER-SOLE based on what we said about it and what could be inferred.

      • Query Successful

      • Premise

        • rdf:type tkb:NEW-BF-COURSE tkb:BLAND-FISH-COURSE

        • tkb:FOOD tkb:NEW-BF-COURSE tkb:DOVER-SOLE

      • Bindings

        • rdf:typetkb:DOVER-SOLEtkb:EDIBLE-THING

        • rdf:typetkb:DOVER-SOLErdfs:Resource

        • rdf:typetkb:DOVER-SOLEtkb:CONSUMABLE-THING

        • rdf:typetkb:DOVER-SOLEdaml:Thing

        • rdf:typetkb:DOVER-SOLEtkb:BLAND-FISH

        • rdf:typetkb:DOVER-SOLEtkb:SEAFOOD

        • rdf:typetkb:DOVER-SOLEtkb:FISH

  • The next two slides will show the DQL protocol messages that were used.


  • Example: Inferences using toClass and hasValue (cont.)

    This is the request message that was sent for this query.

    <SOAP-ENV:Envelope>

    <SOAP-ENV:Body>

    <dql:query>

    <dql:premise>

    <rdf:RDF>

    <rdf:Description rdf:about="wines.daml#NEW-BF-COURSE">

    <rdf:type rdf:resource="wines.daml#BLAND-FISH-COURSE"/>

    </rdf:Description>

    <rdf:Description rdf:about="wines.daml#NEW-BF-COURSE">

    <tkb:FOOD rdf:resource="wines.daml#DOVER-SOLE"/>

    </rdf:Description>

    </rdf:RDF>

    </dql:premise>

    <dql:queryPattern>

    <rdf:Statement>

    <rdf:predicate rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#type"/>

    <rdf:subject rdf:resource="wines.daml#DOVER-SOLE"/>

    <rdf:object rdf:resource="http://www.daml.org/2002/10/dql-variables#x"/>

    </rdf:Statement>

    </dql:queryPattern>

    <dql:mustBindVars>

    <var:x/>

    </dql:mustBindVars>

    <dql:answerKBPattern>

    <dql:kbRef rdf:resource="wines.daml"/>

    </dql:answerKBPattern>

    </dql:query>

    </SOAP-ENV:Body>

    </SOAP-ENV:Envelope>


    Example: Inferences using toClass and hasValue (cont.)

    This is the response message that was sent for this query.

    <SOAP-ENV:Envelope>

    <SOAP-ENV:Body>

    <dql:answerBundle>

    <dql:queryPattern>

    <rdf:Statement xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">

    <rdf:predicate rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#type" />

    <rdf:subject rdf:resource="wines.daml#DOVER-SOLE" />

    <rdf:object rdf:resource="http://www.daml.org/2002/10/dql-variables#x" />

    </rdf:Statement>

    </dql:queryPattern>

    <dql:answer>

    <dql:binding-set> <var:x rdf:resource="wines.daml#EDIBLE-THING"/> </dql:binding-set>

    </dql:answer>

    <dql:answer>

    <dql:binding-set> <var:x rdf:resource="http://www.w3.org/2000/01/rdf-schema#Resource"/> </dql:binding-set>

    </dql:answer>

    <dql:answer>

    <dql:binding-set> <var:x rdf:resource="wines.daml#CONSUMABLE-THING"/> </dql:binding-set>

    </dql:answer>

    <dql:answer>

    <dql:binding-set> <var:x rdf:resource="http://www.daml.org/2001/03/daml+oil#Thing"/> </dql:binding-set>

    </dql:answer>

    <dql:answer>

    <dql:binding-set> <var:x rdf:resource="wines.daml#BLAND-FISH"/> </dql:binding-set>

    </dql:answer>

    <dql:answer>

    <dql:binding-set> <var:x rdf:resource="wines.daml#SEAFOOD"/> </dql:binding-set>

    </dql:answer>

    <dql:answer>

    <dql:binding-set> <var:x rdf:resource="wines.daml#FISH"/> </dql:binding-set>

    </dql:answer>

    <dql:continuation> <dql:termination-token> <dql:none/> </dql:termination-token> </dql:continuation>

    </dql:answerBundle>

    </SOAP-ENV:Body>

    </SOAP-ENV:Envelope>


    Conclusion

    DQL provides a powerful agent-to-agent communication framework to enable reasoning and inferencing using DAML+OIL documents on the Semantic Web. Its XML based syntax allows agents to communicate using Web Services protocols and enables devices with little computing power to leverage the reasoning capabilities of servers with more computing power.

    JTP provides a powerful reasoning engine with its framework of reasoners, with both a general-purpose first-order logic theorem prover and a suite of special-purpose reasoners. Its ability to reason using DAML+OIL makes it an ideal engine to power a DQL server.


    For More Information

    For more information, or a copy of this slideshow, please see:

    http://ksl.stanford.edu/projects/dql/

    For a live demo, please see:

    http://onto2.stanford.edu:8080/dql/servlet/DQLFrontEnd


    ad