ObjectLogic Reference Guide. Transitivity of subclass relationship. Query Options. Geographic Coordinates

Страницы работы

Фрагмент текста работы

ObjectLogic Reference Guide

ontoprise GmbH

An der Raumfabrik 33a

76227 Karlsruhe Germany http://www.ontoprise.com

Table of Content

Taxonomy................................................................................................................................................5

Query................................................................................................................................................6

Transitivity of subclass relationship................................................................................................................................................7

Query Options................................................................................................................................................8

Property................................................................................................................................................11

Attribute................................................................................................................................................12

Data types................................................................................................................................................13

Custom datatypes..........................................................................................................................................................................................13

Geographic Coordinates..........................................................................................................................................................................................14

Relations................................................................................................................................................15

Individuals................................................................................................................................................16

Property values................................................................................................................................................17

Rules................................................................................................................................................18

Predicates................................................................................................................................................19

Namespaces................................................................................................................................................20

Paths................................................................................................................................................21

Modules................................................................................................................................................22

Expressions................................................................................................................................................23

Constraints................................................................................................................................................25

Annotations................................................................................................................................................26

Annotations for ObjectLogic Module..........................................................................................................................................................................................26

Terms................................................................................................................................................27

Constants..........................................................................................................................................................................................27

String .......................................................................................................................................................................27

IRI .......................................................................................................................................................................28

Double .......................................................................................................................................................................29

Int .......................................................................................................................................................................29

Long .......................................................................................................................................................................30

Integer .......................................................................................................................................................................30

Decimal .......................................................................................................................................................................30

Date .......................................................................................................................................................................31

Time .......................................................................................................................................................................32

DateTime .......................................................................................................................................................................33

Duration .......................................................................................................................................................................34

Boolean .......................................................................................................................................................................35

Plain Literal .......................................................................................................................................................................35

XMLLiteral .......................................................................................................................................................................36

Variables..........................................................................................................................................................................................36

Functions..........................................................................................................................................................................................36 Lists..........................................................................................................................................................................................37 map data type..........................................................................................................................................................................................37 Null value..........................................................................................................................................................................................42

Blank nodes..........................................................................................................................................................................................42

Current module..........................................................................................................................................................................................42

About this document

There is an Online Help and a user manual available. The Online Help can be accessed via the Help / Help Contents menu. The user manual is available as a PDF on the Web page http://www.otc.ontoprise.com/download and can be downloaded free of charge.

The documentation describes the software on a Windows operating system with the browser Mozilla Firefox. You can access the information using the table of contents, the index and the full text search. If you cannot find the answer to your question in the helpsystem, visit free training center at http://otc.ontoprise.com, area "support", to get in touch with the support team.

Taxonomy

1  Taxonomy

Syntax

<concept A> :: <concept B>.

Semantic

<concept A> is a subconcept of <concept B>

Sample

person[]. man::person. woman::person.

Query

2  Query

?- ?X[].

delivers only a result for explicitly defined concepts (e.g. person[].).

?- _concepts(?X).

delivers all concepts known in the ontologie.

Transitivity of subclass relationship

3  Transitivity of subclass relationship

?- ?X::?Y.

delivers all subconcepts ?Y of concept ?X – not only the asserted ones, but also the subconcepts of the subconcepts and so on

This means that if

C1::C2 and C2::C3 then also C1::C3 holds.


4  Query Options

Definition:

Query options control the execution and output of a query.

Syntactically query options are provided as annotations to the query. Annotations are written in front of the query with the syntax @{<queryName>,options[<option1>,<option2>]}. Query without id and options:  ?- ?X::?Y.

Query with id "subconcepts":  @{subconcepts} ?- ?X::?Y.

Query with options "inferOff" and "profile":  @{options[inferOff,profile]} ?- ?X::?Y.

Query Option

Description

Example

sort

Sorts of the result of a query.

@{q1, options[sort(asc(?X),desc(?Y)]} ?- ?X::? Y.

This example will sort the query results in the ascending order of bindings for ?X and in descending order of bindings for ?Y. It is also possible to write:

@{q1, options[sort(?X,desc(?Y)]} ?- ?X::?Y.

The ?X will be be interpreted as asc(?X), so you can just leave out the asc(..).

outorder

Sequence and restriction of the result variables (output ordering).

Specifies the sequence of the output variables.

With the facts

Man::Person.

Woman::Person.

the output of the query

@{q1, options[outorder(?X,?Y)]} ?- ?X::?Y.

will be

Man,Person

Woman,Person

With

@{q1, options[outorder(?Y,?X)]} ?- ?X::?Y.

the output will be

Person,Man

Person,Woman

The "outorder" option can also be used for skipping some variable bindings in the result: with

@{q1, options[outorder(?X)]} ?- ?X::?Y.

the output will be

Man

Woman

limit

Limits the number of answers.

@{q1, options[limit(1),outorder(?Y,?X)]} ?- ? X::?Y.

In this example, only one answer will be given. Note that limiting the number of answers does not necessarily mean that the performance will improve.

offset

Answer offset. Skips some answers.

@{q1, options[offset(10),limit(5),sort(?Y,?Y), outorder(?Y,?X)]} ?- ?X::?Y.

In this example five answers will be given, starting with answers then. Using offset only makes sense if the answer order is specified. Otherwise it is not assured that the answers are returned in the same order.

skipSendingAnswe

rs

Skip sending answers.

You can execute a query without receiving the results. This can be useful for benchmarking, if the time for sending the answers to the client complicates time measurements.

@{q1, options[skipSendingAnswers]} ?- ?X::?Y.

trace

Tracing. OntoBroker will log trace information about the query execution

@{q1, options[trace]} ?- ?X::?Y.

profile

Profiling. Enables the logging of the performance characteristics.

@{q1, options[profile]} ?- ?X::?Y.

profileAll

Profiling. Enables the logging of the performance

characteristics; executes the query with full profiling (including execution plans etc.).

@{q1, options[profileAll]} ?- ?X::?Y.

inferOff

Turning off inferencing. You may tell OntoBroker not to do inferencing for query answering. This will prohibit the evaluation of all rules and you will only get the given facts matching your query.

@{q1, options[inferOff]} ?- ?X::?Y.

userRulesOff

Turning off user rules.

You may tell the

OntoBroker to disable all user rules, i.e. all rules explicitly defined in any module. Internal axiom rules (like e.g. subclass and property hierarchy) are not influenced by this option.

@{q1, options[userRulesOff]} ?- ?X::?Y.

ignoreImports

Turning off imports. If module A imports module B, all facts of B are included on querying facts from module A.

Using the

"ignoreImports" query option you can query for facts only stored explicitly in module A.

Module A

:- module A.

:- importmodule B.

John:person.

Module B

:- module B.

Ann:person.

@{q1} ?- ?X:person@A.  // returns John and Ann

@{q1,options[ignoreImports]} ?- ?X: person@A.  // returns only John

fillNull

Working with null values.

If a property is not set in ObjectLogic, it is just not there, i.e. querying for the property value returns no result. Under some circumstances, it is useful to get null values in these

Похожие материалы

Информация о работе