Date post: | 24-Dec-2015 |
Category: |
Documents |
Upload: | alfred-nichols |
View: | 214 times |
Download: | 2 times |
www.ontoprise.de
© 2005 ontoprise GmbH Home - 1 - | Menu | Partner | End
Copyright ©2005 ontoprise GmbH, Karlsruhe
F-Logic Forum:Results and Open Issues leftMartin Weindel,28-10-2006
www.ontoprise.de
www.ontoprise.de
© 2005 ontoprise GmbH Home - 2 - | Menu | Partner | End
Agenda
New F-Logic Specification, why? Highlights of New F-Logic Parser for New F-Logic Open Issues
www.ontoprise.de
© 2005 ontoprise GmbH Home - 3 - | Menu | Partner | End
New F-Logic Specification, why?
Original paper on F-logic published 1995 Various systems based on F-logic:
Flora-2, Ontobroker, Florid, ... Problem areas:
New ideas incompatible syntax extensions Differences in Semantics Usability and syntax inconsistencies
=> Forum F-Logic to define new specification
www.ontoprise.de
© 2005 ontoprise GmbH Home - 4 - | Menu | Partner | End
Highlights
Highlights of New F-Logic
www.ontoprise.de
© 2005 ontoprise GmbH Home - 5 - | Menu | Partner | End
Highlights I: Directives
Usage of directives on a per-file basis Namespace Prefixes to simplify dealing
with URIs, following the RDF construct (sQNames):- _prefix
dc="http://purl.org/dc/elements/1.1/". Modules to isolate different parts of KB,
only one module per file:- _module _"http://foo.org/onto#m2".
More directives: _version, _encoding, ...
www.ontoprise.de
© 2005 ontoprise GmbH Home - 6 - | Menu | Partner | End
Directives Example
Without directives_"http://foo.org/onto#Doc3"[
_"http://purl.org/dc/elements/1.1/creator" -> "Billy Smith", _"http://purl.org/dc/elements/1.1/subject" -> "Improved Readability"]@_"http://foo.org/onto#m2".
With directives:- _module _"http://foo.org/onto#m2".
:- _default prefix = "http://foo.org/onto#".:- _prefix dc="http://purl.org/dc/elements/1.1/".
#Doc3[dc#creator -> "Billy Smith",dc#subject -> "Improved Readibility"].
No explicitmodule neededDefault
prefix
www.ontoprise.de
© 2005 ontoprise GmbH Home - 7 - | Menu | Partner | End
Highlights II: Variables
Variables are denoted as ?Var Implicit quantification
?X[grandfather -> ?G] :- ?G = ?X.father.father.
Old: forall X,G X[grandfather -> G] :- G = X.father.father.
Anonymous variables ? or ?_ Explicit quantification (forall, exist) still
supported p(?X) :- q(?X, ?_) and exist ?Y r(?X, ?Y).
www.ontoprise.de
© 2005 ontoprise GmbH Home - 8 - | Menu | Partner | End
Highlights III: If-then-else
Support for if-then-else rules to improve readability of simple rules for laymenif ?X:Person.age >= 18
then ?X:Adultelse if ?X.age >= 12
then ?X:Teenagerelse ?X:Child.
www.ontoprise.de
© 2005 ontoprise GmbH Home - 9 - | Menu | Partner | End
Highlights IV: Syntax changes
Various syntax changes , most important: Set value attributes only, i.e. dropping double
arrows operators ->>, =>>, *->>, *=>>, .., !! Usage of comma , or and instead of semicolon to
separate parts in Flogic-molecules Hi-Log syntax for method arguments (@ dropped)
New SyntaxMan[son(Woman) {0:*} => Man].Adam:Man[son(Alibama) -> {Jaus,Jalomus,Coreus},son(Ada) -> Aliphaz].
Old SyntaxMan[son@(Woman) =>> Man].Adam:Man[son@(Alibama) ->> {Jaus,Jalomus,Coreus}; son@(Ada) ->> Aliphaz].
www.ontoprise.de
© 2005 ontoprise GmbH Home - 10 - | Menu | Partner | End
Highlights V: Aggregate
Syntax for aggregates as proposed inFLORA-2:
?Var = Aggregate {?Var [GroupingVarList] | Query}
?- ?Z = min {?S | john[salary(?Year)->?S]}.
?- ?Z = count{?Year | john.salary(?Year) < max{?S |john[salary(?Y)->?S], ?Y < Year}}.
www.ontoprise.de
© 2005 ontoprise GmbH Home - 11 - | Menu | Partner | End
Parser
A Parser for thenew F-Logic
www.ontoprise.de
© 2005 ontoprise GmbH Home - 12 - | Menu | Partner | End
From Spec To Code
Parser implemented from scratch using1. Specification web pages of Forum Flogic2. Discussions and results in Forum Flogic
mailing list3. Some „gap filling“ with parts from
FLORA-2 Ontobroker
www.ontoprise.de
© 2005 ontoprise GmbH Home - 13 - | Menu | Partner | End
Parser: Technical Details
Implemented in Java using parser generator ANTLR 3.0 (see http://www.antlr.org ) LL(*) parser
=> more powerful => more natural grammar Error recovery Code generation possible for other languages
(needs rewrite of actions and model classes) C++ C# Python
www.ontoprise.de
© 2005 ontoprise GmbH Home - 14 - | Menu | Partner | End
Parser Workflow
Lexer Parser
Path ExpressionExpansion
FlogicText
InternalParse TreewithPath Expr.andF-Molecules
Expanded Parse Treeonly containingF-Atoms
www.ontoprise.de
© 2005 ontoprise GmbH Home - 15 - | Menu | Partner | End
Demo
Parser demonstration at
http://217.110.222.146:12080/demoparser/ForumFlogicParser.html
www.ontoprise.de
© 2005 ontoprise GmbH Home - 16 - | Menu | Partner | End
Unsupported Syntax Features
Reification Introspection Syntax for forcing evaluation of
evaluable functions File loading syntax Meta unification (part of spec?) User defined equality :=: (part of spec?)
www.ontoprise.de
© 2005 ontoprise GmbH Home - 17 - | Menu | Partner | End
Open Issues
Open Issues
www.ontoprise.de
© 2005 ontoprise GmbH Home - 18 - | Menu | Partner | End
Open Issue: Strings, Symbols, and URIs
Unification of Strings, symbols, URIs? Difference between symbol and string not easy for
normal users"BMW Z4" => String (double quote)
'BMW Z4' => Symbol (single quote) _"http://bmw/z4" => URI ( = 'http://bmw/z4' ???)
Inconsistent notation for symbols with prefix:
String + Symbol = URI
:- _prefix a = "http://foo/". a#'bar' == _"http://foo/bar"
www.ontoprise.de
© 2005 ontoprise GmbH Home - 19 - | Menu | Partner | End
Open Issue: Namespaces
RDF sQNames are not sufficient: GUIs will show only local part
=> Heuristics needed to separate namespace Query for all objects of a given namespace
?- "http://foo/"#?X Query for namespaces for given local name
?- ?X#bar Is # an operator?
If yes, then strings should be allowed before #?- 'http://foo/bar'[att -> ?X].?- "http://foo/"#bar[att -> ?X].
www.ontoprise.de
© 2005 ontoprise GmbH Home - 20 - | Menu | Partner | End
Open Issue: Modules in Rule Head
Spec suggests to disallow module specification in rule head to enforce encapsulation
But module specs in rule head are currently used in some cases: Axioms Modelling of processes Predefined rule sets working on modules
with similar structureq(?X)@?M :- p(?X)@?M.
www.ontoprise.de
© 2005 ontoprise GmbH Home - 21 - | Menu | Partner | End
Open Issue: Embedded modules
Need to import concepts and attributes from upper ontology
Need to make instances visible to upper ontology rules
UpperOntology
DomainOntology 1
DomainOntology 2
Inherits concepts & attributes
www.ontoprise.de
© 2005 ontoprise GmbH Home - 22 - | Menu | Partner | End
Other Open Issues
Rule & query syntaxOnly head :- body. Or is <- allowed alternatively?
Old style rules and queries starting with forall? Ontobroker query extensions sortedby, orderedby? Documentation of rules and queries? Unicode escape sequences in strings and symbols? Syntax for rule labels? Allowed encoding specifications Readability of BooleanMethod specifications? ...
=> Discussion in Forum mailing list
www.ontoprise.de
© 2005 ontoprise GmbH Home - 23 - | Menu | Partner | End
Open Source Reference Parser
Next Steps: Refine this parser to become the
reference parser Release as Open Source