Of 20 Naive Evaluation q(f(a), a), q(a,c), q(f(c),c), r(a, c), r(c, d), r(e,f) p(X, Y) q(f(X), X)...

download Of 20 Naive Evaluation q(f(a), a), q(a,c), q(f(c),c), r(a, c), r(c, d), r(e,f) p(X, Y) q(f(X), X) r(X, Y) p(X, c) f(X) X f(a) f(c) a c X Y a c c d X Y

of 32

  • date post

    26-Mar-2015
  • Category

    Documents

  • view

    219
  • download

    2

Embed Size (px)

Transcript of Of 20 Naive Evaluation q(f(a), a), q(a,c), q(f(c),c), r(a, c), r(c, d), r(e,f) p(X, Y) q(f(X), X)...

  • Slide 1

of 20 Naive Evaluation q(f(a), a), q(a,c), q(f(c),c), r(a, c), r(c, d), r(e,f) p(X, Y) q(f(X), X) r(X, Y) p(X, c) f(X) X f(a) f(c) a c X Y a c c d X Y ac cd efac Slide 2 of 20 Immediate Consequence Given an interpretation IB P. T is defined by: T (I) = {H | H of 20 Stratification: Example p(a). p(b). q(a). r(X) q(X).Level 1 t(X) p(X) and not r(X).Level 2 I 0 = {p(a), p(b), q(a)} T(I 0 ) = {r(a)} {p(a), p(b), q(a)} = I 1 T(I 1 ) = {t(b), r(a), p(a), p(b), q(a)} = I 2 Slide 7 of 20 F-Logic Thanks to Jrgen Angele Slide 11 ISWeb - Information Systems & Semantic Web Steffen Staab staab@uni-koblenz.de Foundations of Logic Programming 11 of 32 F-Logic (Syntax) Kifer, Lausen, Wu, Journal of the ACM, 42:741843, 1995. Slide 12 ISWeb - Information Systems & Semantic Web Steffen Staab staab@uni-koblenz.de Foundations of Logic Programming 12 of 32 F - Logic Object Oriented (Frame Based) Logic Well-Defined Semantics (Well-Founded Semantics) Efficient Evaluation Strategy Turing-Complete Slide 13 ISWeb - Information Systems & Semantic Web Steffen Staab staab@uni-koblenz.de Foundations of Logic Programming 13 of 32 Concepts and Subconcept Relationship Person::OBJECT. Man:: Person. Woman::Person. Employee::Person. Professor::Employee. Student::Person. PhDStudent::Student. AcademicInstitution::Object. University::AcademicInstitution. Objects are identified using unique Ids http://www.projecthalo.com/ -> downloads -> Halo pilot downloads -> Ontoprise Halo Improved download (Format: EXE/78 MB)Ontoprise Halo Improved download Slide 14 ISWeb - Information Systems & Semantic Web Steffen Staab staab@uni-koblenz.de Foundations of Logic Programming 14 of 32 Conceptual Modeling Person[hasName=>>STRING; hasBirthdate=>DATE; hasWeight=>NUMBER;......]. AcademicInstitution[hasName=>>STRING; hasAddress=>>STRING; ]. Student[studiesAt=>AcademicInstitution; ]. Define Range of Attributes: Slide 15 >UKoLd; hasBirthdate->1985-0707; hasWeight->75.0]. UKoLd:University. UKoLd[hasName->>Universitt Koblenz-Landau"; hasAddress->>Isaac-Fulda-Allee 3, Mainz"; ]. Assign values to Attributes :"> ISWeb - Information Systems & Semantic Web Steffen Staab staab@uni-koblenz.de Foundations of Logic Programming 15 of 32 Instances and Attributes Schmidt:Student. Schmidt[hasName->>Stefan Schmidt"; studiesAt->>UKoLd; hasBirthdate->1985-0707; hasWeight->75.0]. UKoLd:University. UKoLd[hasName->>Universitt Koblenz-Landau"; hasAddress->>Isaac-Fulda-Allee 3, Mainz"; ]. Assign values to Attributes : Slide 16 ISWeb - Information Systems & Semantic Web Steffen Staab staab@uni-koblenz.de Foundations of Logic Programming 16 of 32 Rules & Queries // All students at UKoLd FORALL S >UKoLd]. // Student at Academic Institutions of some state are students educated at the costs of this state Rule PaysFor: FORALL C,S,A,L C[paysEducationCostsOf->>S] >A:AcademicInstitution] AND A[hasAddress->L] AND partOf(L,C) AND C:State. Slide 17 ISWeb - Information Systems & Semantic Web Steffen Staab staab@uni-koblenz.de Foundations of Logic Programming 17 of 32 Quantifier Quantifiers can range over concepts and attributes FORALL X,Y R]. FORALL A,R R]. Slide 18 >UKoLd]. Schmidt[hasBirthdate->1985-07-07]. Schmidt[hasWeight->75.0]. An F-Molecule Schmidt:Student[hasName->>Stefan Schmidt"; studiesAt->>UKoLd; hasBirthdate->1985-07-07; hasWeight->75.0]."> ISWeb - Information Systems & Semantic Web Steffen Staab staab@uni-koblenz.de Foundations of Logic Programming 18 of 32 F-Molecule can be split into multiple F-Atoms: Schmidt:Student. Schmidt[hasName->>Stefan Schmidt"]. Schmidt[studiesAt->>UKoLd]. Schmidt[hasBirthdate->1985-07-07]. Schmidt[hasWeight->75.0]. An F-Molecule Schmidt:Student[hasName->>Stefan Schmidt"; studiesAt->>UKoLd; hasBirthdate->1985-07-07; hasWeight->75.0]. Slide 19 ISWeb - Information Systems & Semantic Web Steffen Staab staab@uni-koblenz.de Foundations of Logic Programming 19 of 32 Parametrised Attributes Schmidt:Student[ studiesAt(UKoLd)->>Computer Science; studiesAt(FernUHagen)->>Philosophy ]. Slide 20 ISWeb - Information Systems & Semantic Web Steffen Staab staab@uni-koblenz.de Foundations of Logic Programming 20 of 32 Predicates Instead of Schmidt:Student[ studies(UKoLd)->>Computer Science; studies(FernUHagen)->>Philosophy ]. We can also write studies(Schmidt,UKoLd,Computer Science). studies(Schmidt,FernUHagen,Philosophy). Slide 21 ISWeb - Information Systems & Semantic Web Steffen Staab staab@uni-koblenz.de Foundations of Logic Programming 21 of 32 Builtins isString( ) concat(,, ) cut(,, ) tokenize(,, ) tokenizen(,,, ) tolower(, ) toupper(, ) regexp(,, ) constant2string(, ) string2number(, ) sin,cos,tan,asin,acos,ceil,floor,exp, rint,sqrt,round,max,min,pow Slide 22 ISWeb - Information Systems & Semantic Web Steffen Staab staab@uni-koblenz.de Foundations of Logic Programming 22 of 32 Builtin Examples tolower: FORALL XPROJECTNAME] >"Lactic Acid"; hasKa1->>1.4E-4]]. FORALL X,Y X[hasName->>Y]. FORALL Y >Y]."> ISWeb - Information Systems & Semantic Web Steffen Staab staab@uni-koblenz.de Foundations of Logic Programming 24 of 32 Nesting and Path Expressions Sodiumlactate[isSaltOf-> Lactic[hasFormula->>"HC3H5O3"; hasName->>"Lactic Acid"; hasKa1->>1.4E-4]]. FORALL X,Y X[hasName->>Y]. FORALL Y >Y]. Slide 25 ISWeb - Information Systems & Semantic Web Steffen Staab staab@uni-koblenz.de Foundations of Logic Programming 25 of 32 Negation FORALL S S:NonTechnicalStudent >UKoLd] AND NOT S[studies(UKoLd)->>Computer Science]. Slide 26cars#Car[cars#driver => cars#Person; cars#passenger =>> cars#Person; cars#seats => NUMBER]. cars#Person[cars#name => STRING]. To distinguish objects in different ontologies:"> ISWeb - Information Systems & Semantic Web Steffen Staab staab@uni-koblenz.de Foundations of Logic Programming 26 of 32 Namespacescars#Car[cars#driver => cars#Person; cars#passenger =>> cars#Person; cars#seats => NUMBER]. cars#Person[cars#name => STRING]. To distinguish objects in different ontologies: Slide 27cars#Car[cars#driver => cars#Person; cars#passenger =>> cars#Person; cars#seats => NUMBER]. cars#Person[cars#name => STRING]. Translated into obj(www.cars-r-us.tv,car)[ obj(www.cars-r-us.tv,driver) => obj(www.cars-r-us.tv,Person), .] To distinguish objects in different ontologies:"> ISWeb - Information Systems & Semantic Web Steffen Staab staab@uni-koblenz.de Foundations of Logic Programming 27 of 32 Namespacescars#Car[cars#driver => cars#Person; cars#passenger =>> cars#Person; cars#seats => NUMBER]. cars#Person[cars#name => STRING]. Translated into obj(www.cars-r-us.tv,car)[ obj(www.cars-r-us.tv,driver) => obj(www.cars-r-us.tv,Person), .] To distinguish objects in different ontologies: Slide 28 ISWeb - Information Systems & Semantic Web Steffen Staab staab@uni-koblenz.de Foundations of Logic Programming 28 of 32 Metamodelling InstitutionType[hasInstantiations->Number]. University:InstitutionType. Fachhochschule:InstitutionType. University[hasInstations->2]. Fachhochschule[hasInstantiations->1] Institution[hasName=>>String]. University::Institution. UKoLd:University[hasName->>Universitaet Koblenz- Landau]. UMainz:University[hasName->>Universitaet Mainz]. FHKoblenz:Fachhochschule[ hasName->>Fachhochschule Koblenz]. Slide 29 ISWeb - Information Systems & Semantic Web Steffen Staab staab@uni-koblenz.de Foundations of Logic Programming 29 of 32 Complex Rules p(1). p(2). p(3). FORALL X maximum(X) lessorequal(Y,X)). Arbitrary First Order Formula Slide 30 ISWeb - Information Systems & Semantic Web Steffen Staab staab@uni-koblenz.de Foundations of Logic Programming 30 of 32 Lloyd-Topor Transformation FORALL X maximum(X) lessorequal(Y,X)). FORALL X,Y maximum(X) ISWeb - Information Systems & Semantic Web Steffen Staab staab@uni-koblenz.de Foundations of Logic Programming 31 of 32 Transformation from F-Logic to Horn-Logic a:C A::B A[B=>C] A[B=>>C] a[B->c] a[B->>c] isa_(a,C) sub_(A,B) atttype_(A,B,C) setatttype_(A,B,C) att_(a,B,c) setatt_(a,B,c) Slide 32 ISWeb - Information Systems & Semantic Web Steffen Staab staab@uni-koblenz.de Foundations of Logic Programming 32 of 32 Transformation from F-Logic to Horn-Logic FORALL X,Y,Z X[ancestor->>Y] Z] AND Z[ancestor->>Y]. FORALL X,Y,Z setatt_(X,ancestor,Y)