PSOARuleMLInvitedTutorialExamplesRW2015

From RuleML Wiki
Jump to: navigation, search

This is a collection of interactive examples of PSOA RuleML knowledge bases, queries, and answers based on, and extending, those in the invited RW2015 Tutorial Lectures (Paper 7). By experiencing, hands-on, the query-answer pairs for a given knowledge base, readers can deepen their understanding of various aspects of its meaning as conveyed by PSOA RuleML language features. In particular, the examples show how PSOA RuleML integrates the data and knowledge representation paradigms of relations (each relationship applying a relation to n positional arguments) with those of graphs (each frame describing a typed Object IDentifier node with n slotted arguments leading, as directed labeled arcs, to other nodes). Beyond data facts, knowledge bases contain object-relational rules, which allow deduction, e.g. backward reasoning from queries to subqueries etc. and ultimately facts to provide yes (with bindings for any query variables) or no answers. Notably, object-describing frames need not be stored as facts (statically) but can be derived on demand by rules (dynamically) from relationships and/or other frames.

The examples are transcribed to PSOA Presentation Syntax that 1. is unabridged (adding Document and Group around knowledge bases as well as the "_" prefix for symbolic local constants), 2. uses the right-slot normal form (moving slots to the right of tuples), and 3. keeps queries on (possibly long) single lines. This allows readers to easily copy & paste examples for testing and modification with the PSOATransRun[PSOA2Prolog,XSBProlog] system (version http://psoa.ruleml.org/transrun/1.2/local/). In answers, the Tutorial's success and fail become, respectively, the yes and no from the targeted XSB Prolog. An answer is understood to be yes whenever one or more query-variable bindings are shown (in a single line). For the non-deterministic enumeration of answers, multiple lines are employed. Inline comments are prefixed with a percentage sign ("%").

Knowledge Base:

Document(
  Group(
    _family(_Joe _Sue)                           % 2-ary _family relationship fact
  )
)

Queries and Answers:

_family(_Joe _Sue)       % successful yes-or-no query
yes

_family(_Sue _Joe)       % failing yes-or-no query (argument positionality: order matters)
no

_family(_Joe _Ann)       % failing yes-or-no query (different individual)
no

_family(_Joe)            % failing yes-or-no query (arguments cannot be omitted)
no

_family(_Joe ?Partner)   % successful query with one variable
?Partner=_Sue

_family(_Ben ?Partner)   % failing query with one variable
no

_family(?P1 ?P2)         % successful query with two variables
?P1=_Joe  ?P2=_Sue

_family(?P ?P)           % failing query with two variables (no consistent substitution possible)
no


Knowledge Base:

Document(
  Group(
    _inst1#_family(_husb->_Joe _wife->_Sue)      % 2-slot _family frame fact
  )
)

Queries and Answers:

_inst1#_family(_husb->_Joe _wife->_Sue)       % successful yes-or-no query
yes

_inst1#_family(_wife->_Sue _husb->_Joe)       % successful yes-or-no query (slot commutativity: order does not matter)
yes

_inst1#_family(_husb->_Joe _wife->_Ann)       % failing yes-or-no query (different individual)
no

_inst1#_family(_husb->_Joe)                   % successful yes-or-no query (slots can be omitted)
yes

_inst1#_family(_husb->_Joe _wife->?Partner)   % successful query with one variable
?Partner=_Sue

_inst1#_family(_husb->_Ben _wife->?Partner)   % failing query with one variable
no

_inst1#_family(_husb->?P1 _wife->?P2)         % successful query with two variables
?P1=_Joe  ?P2=_Sue

_inst1#_family(_husb->?P _wife->?P)           % failing query with two variables
no

?Oid#_family(_husb->_Joe _wife->_Sue)         % successful query with an ?Oid variable
?Oid=_inst1

_family(_husb->_Joe _wife->_Sue)              % successful query leaving OID to objectification
yes


Knowledge Base:

Document(
  Group(
    Forall ?Hu ?Wi ?Ch (   % Head-slotted Horn rule deriving oidless families on demand:
      _family(_husb->?Hu _wife->?Wi _child->?Ch) :-   % Head (conclusion) applies _family to 3 slots
        And(_married(?Hu ?Wi) _kid(?Wi ?Ch))          % Body (condition) conjoins two 2-ary relationships
    )
    _married(_Joe _Sue)    % One 2-ary _married relationship fact
    _kid(_Sue _Pete)       % One 2-ary _kid relationship fact
  )
)

Queries and Answers:

_married(_Joe _Sue)
yes

_married(_Joe _Ann)
no

_married(_Joe ?Whom)
?Whom=_Sue

_kid(?Parent ?Child)
?Parent=_Sue  ?Child=_Pete

_family(_husb->_Joe _wife->_Sue _child->_Pete)
yes

_family(_wife->_Sue _husb->_Joe _child->_Pete)
yes   % slots can be commuted, i.e. written in any order, on querying

_family(_husb->_Joe _wife->_Sue)
yes   % slots can be omitted on querying

_family(_wife->_Sue)
yes

_family(_child->_Pete)
yes


Knowledge Base:

Document(
  Group(
    Forall ?Hu ?Wi ?Ch (   % Head-OID-slotted (head-frame) Horn rule deriving oidful families on demand:
      _famid(?Hu ?Wi)#_family(_husb->?Hu _wife->?Wi _child->?Ch) :-   % Head describes _family-typed complex OID _famid(?Hu ?Wi) with 3 slots
        And(_married(?Hu ?Wi) _kid(?Wi ?Ch))
    )
    _married(_Joe _Sue)
    _kid(_Sue _Pete)
  )
)

Queries and Answers:

_family(_husb->_Joe _wife->_Sue _child->_Pete)
yes

_famid(_Joe _Sue)#_family(_husb->_Joe _wife->_Sue _child->_Pete)
yes

_famid(_Joe _Sue)#_family(_wife->_Sue _husb->_Joe _child->_Pete)
yes   % slots can be commuted, i.e. written in any order, on querying

_famid(_Joe _Sue)#_family(_husb->_Joe _wife->_Sue)
yes   % slots can be omitted on querying

_famid(_Joe _Sue)#_family(_wife->_Sue)
yes

_famid(_Joe _Sue)#_family(_child->_Pete)
yes

_famid(_Joe _Sue)#_family()
yes   % without any slots, pure membership can be queried

_famid(_Ben _Sue)#_family(_wife->_Sue)
no

_famid(_Ben _Ann)#_family()
no

_famid(_Joe _Sue)#_family(_husband->_Joe _wife->_Sue _child->_Pete)
no   % slot names _husband and _husb are different

_famid(_Joe _Sue)#_family(_husb->_Joe _wife->_Sue _child->?C)
?C=_Pete

_famid(_Joe _Sue)#_family(_husb->?H _wife->?W _child->?C)
?H=_Joe  ?W=_Sue  ?C=_Pete

_famid(_Joe _Sue)#_family(?J->_Joe ?S->_Sue ?P->_Pete)
?J=_husb  ?S=_wife  ?P=_child   % slot names can be also be queried

_famid(_Sue _Joe)#_family(_husb->_Joe _wife->_Sue _child->_Pete)
no

_famid(_Joe _Ann)#_family(_husb->_Joe _wife->_Sue _child->_Pete)
no

_famid(_Joe ?W)#_family(_husb->_Joe _wife->_Sue _child->_Pete)
?W=_Sue

_famid(?H ?W)#_family(_husb->_Joe _wife->_Sue _child->_Pete)
?H=_Joe  ?W=_Sue

_familyid(?H ?W)#_family(_husb->_Joe _wife->_Sue _child->_Pete)
no

?Oid#_family(_husb->_Joe _wife->_Sue _child->_Pete)
?Oid=_famid(_Joe _Sue)

And(?Oid#_family(_husb->_Joe _wife->_Sue) ?Oid#_family(_child->_Pete))
?Oid=_famid(_Joe _Sue)    % partial class-reproducing slotribution of query

And(?Oid#_family(_husb->_Joe) ?Oid#_family(_wife->_Sue _child->_Pete))
?Oid=_famid(_Joe _Sue)    % partial class-reproducing slotribution of query

And(?Oid#_family(_husb->_Joe) ?Oid#_family(_wife->_Sue) ?Oid#_family(_child->_Pete))
?Oid=_famid(_Joe _Sue)    % total class-reproducing slotribution of query


Knowledge Base:

Document(
  Group(
    Forall ?Hu ?Wi ?Ch (
      _famid(?Hu ?Wi)#_family(_husb->?Hu _wife->?Wi _child->?Ch) :-
        And(_married(?Hu ?Wi) _kid(?Wi ?Ch))
    )
    _married(_Joe _Sue)   % Two 2-ary _married relationship facts
    _married(_Ben _Ann)
    _kid(_Sue _Pete)      % Three 2-ary _kid relationship facts
    _kid(_Sue _Kate)
    _kid(_Ann _Ron)
  )
)

Queries and Answers:

_famid(?H ?W)#_family(_husb->?H _wife->?W _child->?C)
?H=_Joe  ?W=_Sue  ?C=_Pete    % initial family with identifier   _famid(_Joe _Sue)
?H=_Joe  ?W=_Sue  ?C=_Kate    % identical family with identifier _famid(_Joe _Sue)
?H=_Ben  ?W=_Ann  ?C=_Ron     % different family with identifier _famid(_Ben _Ann)

?Oid#_family(_husb->?H _wife->?W _child->?C)
?Oid=_famid(_Joe _Sue)  ?H=_Joe  ?W=_Sue  ?C=_Pete    % initial family
?Oid=_famid(_Joe _Sue)  ?H=_Joe  ?W=_Sue  ?C=_Kate    % identical family
?Oid=_famid(_Ben _Ann)  ?H=_Ben  ?W=_Ann  ?C=_Ron     % different family


Knowledge Base:

Document(
  Group(
    Forall ?Vn ?Va ?Co (   % Head-frame Horn rule deriving oidful string trios on demand:
      _trioid(?Vn ?Va ?Co)#_stringTrio(_violin->?Vn _viola->?Va _cello->?Co) :-   % _trioid is explicit function 
        And(_violinPlayer(?Vn) _violaPlayer(?Va) _celloPlayer(?Co) _rehearse(?Vn ?Va ?Co))
    )
    _violinPlayer(_Nina)            % One 1-ary _violinPlayer relationship fact
    _violaPlayer(_Nora)             % One 1-ary _violaPlayer relationship fact
    _celloPlayer(_Neil)             % Two 1-ary _celloPlayer relationship facts
    _celloPlayer(_Nick)
    _rehearse(_Nina _Nora _Neil)    % Two 3-ary _rehearse relationship facts
    _rehearse(_Nina _Nora _Nick)
  )
)

Queries and Answers:

_stringTrio(_violin->?N _viola->?A _cello->?O)
?N=_Nina  ?A=_Nora  ?O=_Neil    % initial stringTrio without identifier
?N=_Nina  ?A=_Nora  ?O=_Nick    % different stringTrio without identifier

_trioid(?N ?A ?O)#_stringTrio(_violin->?N _viola->?A _cello->?O)
?N=_Nina  ?A=_Nora  ?O=_Neil    % initial stringTrio with identifier   _trioid(_Nina _Nora _Neil)
?N=_Nina  ?A=_Nora  ?O=_Nick    % different stringTrio with identifier _trioid(_Nina _Nora _Nick)

?Oid#_stringTrio(_violin->?N _viola->?A _cello->?O)
?Oid=_trioid(_Nina _Nora _Neil)  ?N=_Nina  ?A=_Nora  ?O=_Neil    % initial stringTrio   
?Oid=_trioid(_Nina _Nora _Nick)  ?N=_Nina  ?A=_Nora  ?O=_Nick    % different stringTrio


Knowledge Base:

Document(
  Group(
    Forall ?Vn ?Va ?Co (   % Head-frame existential rule deriving oidful string trios on demand:
      Exists ?Obj (?Obj#_stringTrio(_violin->?Vn _viola->?Va _cello->?Co)) :-   % Existential ?Obj translates to skolem function
        And(_violinPlayer(?Vn) _violaPlayer(?Va) _celloPlayer(?Co) _rehearse(?Vn ?Va ?Co))
    )
    _violinPlayer(_Nina)
    _violaPlayer(_Nora)
    _celloPlayer(_Neil)
    _celloPlayer(_Nick)
    _rehearse(_Nina _Nora _Neil)
    _rehearse(_Nina _Nora _Nick)
  )
)

Queries and Answers:

_stringTrio(_violin->?N _viola->?A _cello->?O)
?N=_Nina  ?A=_Nora  ?O=_Neil    % initial stringTrio without identifier
?N=_Nina  ?A=_Nora  ?O=_Nick    % different stringTrio without identifier

?Oid#_stringTrio(_violin->?N _viola->?A _cello->?O)
?Oid=_skolem1(_Nina _Nora _Neil)  ?N=_Nina  ?A=_Nora  ?O=_Neil    % initial stringTrio with identifier 
?Oid=_skolem1(_Nina _Nora _Nick)  ?N=_Nina  ?A=_Nora  ?O=_Nick    % different stringTrio with identifier


Knowledge Base:

Document(
  Group(
    _a2#_betweenObjRel(_canada _usa _mexico _dim->2 _orient->_northSouth)
  )
)

Queries and Answers:


_a2#_betweenObjRel([_canada _usa _mexico] _dim->2 _orient->_northSouth)
yes    % Desugared positional arguments with square brackets for tuple

_a2#_betweenObjRel(_canada _usa _mexico _dim->2 _orient->_northSouth)
yes    % Syntactic-sugar version is identical to fact

_a2#_betweenObjRel(_alaska _usa _mexico _dim->2 _orient->_northSouth)
no    % Different constant in same position of tuple

_a2#_betweenObjRel(_canada _usa _mexico _orient->_northSouth _dim->2)
yes    % Commuted two slots

_a2#_betweenObjRel(_dim->2 _canada _usa _mexico _orient->_northSouth)
undefined   % unlike in the Tutorial, non-right-slot-normal-form query not parsable 

_a2#_betweenObjRel(_canada _usa _mexico _orient->_northSouth)
yes    % Omitted one slot

_a2#_betweenObjRel(_canada _usa _mexico)
yes    % Omitted both slots

_a2#_betweenObjRel(_dim->2 _orient->_northSouth)
yes    % Omitted entire tuple

_a2#_betweenObjRel(_orient->_northSouth)
yes    % Omitted entire tuple and one slot

_a2#_betweenObjRel()
yes    % Omitted entire tuple and both slots

_a2#_betweenObjRel(_usa _canada _mexico _dim->2 _orient->_northSouth)
no    % Commuted positional arguments of tuple

_a2#_betweenObjRel(_alaska _canada _usa _mexico _dim->2 _orient->_northSouth)
no    % Added element to tuple

_a2#_betweenObjRel(_canada _usa _mexico _dim->3 _orient->_northSouth)
no    % Different filler for one slot

_a2#_betweenObjRel(_canada _usa _mexico _dim->2 _orient->_northSouth _start->1867)
no    % Inserted slot

_a2#_betweenObjRel([_canada _usa _mexico] [_estonia _latvia _lithuania] _dim->2 _orient->_northSouth)
no    % Inserted tuple

_a2#_betweenObjRel(_usa _mexico _dim->2 _orient->_northSouth)
no    % Deleted positional argument of tuple

_a2#_betweenObjRel(_usa _mexico)
no    % Deleted positional argument of tuple

_a1#_betweenObjRel(_canada _usa _mexico _dim->2 _orient->_northSouth)
no    % Different OID

_betweenObjRel(_canada _usa _mexico _dim->2 _orient->_northSouth)
yes    % Omitted OID

_a2#_betweenObjRel(?X _usa _mexico _dim->2 _orient->_northSouth)
?X=_canada

_a2#_betweenObjRel(?X _usa ?Z _dim->2 _orient->_northSouth)
?X=_canada  ?Z=_mexico

_a2#_betweenObjRel(?X _usa ?X _dim->2 _orient->_northSouth)
no    % No consistent positional-argument substitution possible

_a2#_betweenObjRel(_canada _usa _mexico _dim->2 _orient->?V)
?V=_northSouth

_a2#_betweenObjRel(_canada _usa _mexico _dim->?U _orient->?V)
?U=2  ?V=_northSouth

_a2#_betweenObjRel(_canada _usa _mexico _dim->?U _orient->?U)
no    % No consistent slot-filler substitution possible

_a2#_betweenObjRel(_canada _usa _mexico _orient->?V)
?V=_northSouth

_a2#_betweenObjRel(_canada _usa _mexico ?S->2 _orient->_northSouth)
?S=_dim    % Slot-name variable bound to slot name

_a2#_betweenObjRel(_canada _usa _mexico ?S->2 ?T->_northSouth)
?S=_dim  ?T=_orient

_a2#_betweenObjRel(_canada _usa _mexico ?S->2 ?S->_northSouth)
no    % No consistent slot-name substitution possible

?I#_betweenObjRel(_canada _usa _mexico _dim->2 _orient->_northSouth)
?I=_a2    % OID variable bound to OID

?I#_betweenObjRel(_canada _usa _mexico)
?I=_a2


Knowledge Base:

Document(
  Group(
    Forall ?M (
      Exists ?O ( ?O#_betweenObjRel(_northPole ?M _southPole _dim->2 _orient->_northSouth)   )
    )
  )
)

Queries and Answers:

_a2#_betweenObjRel(_northPole _usa _southPole _dim->2 _orient->_northSouth)
no   % existential fact does not assert specific OID

_a1#_betweenObjRel(_northPole _usa _southPole _dim->2 _orient->_northSouth)
no   % existential fact does not assert specific OID

?#_betweenObjRel(_northPole _usa _southPole _dim->2 _orient->_northSouth)
yes  % existential fact asserts unspecific OID

?#_betweenObjRel(_northPole _eu _southPole _dim->2 _orient->_northSouth)
yes

?#_betweenObjRel(_northPole _usa _eu _southPole _dim->2 _orient->_northSouth)
no   % too many elements in query tuple

_betweenObjRel(_northPole _usa _southPole _dim->2 _orient->_northSouth)
yes

?#_betweenObjRel(?X _usa _southPole _dim->2 _orient->_northSouth)   % corrected from Springer Tutorial
?X=_northPole

?#_betweenObjRel(?X _usa ?Z _dim->2 _orient->_northSouth)           % corrected from Springer Tutorial
?X=_northPole  ?Z=_southPole  

?#_betweenObjRel(?X _usa ?X _dim->2 _orient->_northSouth)           % corrected from Springer Tutorial
no

?I#_betweenObjRel(_northPole _usa _southPole _dim->2 _orient->_northSouth)
?I=_skolem1(_usa)

?I#_betweenObjRel(_northPole _usa _southPole)
?I=_skolem1(_usa)


Knowledge Base:

Document(
  Group(
    Forall ?Out1 ?In ?Out2 ?O (
      _symm(?O)#_betweenObjRel(?Out2 ?In ?Out1 _orient->_southNorth) :- ?O#_betweenObjRel(?Out1 ?In ?Out2 _orient->_northSouth)
    )
    _a2#_betweenObjRel(_canada _usa _mexico _dim->2 _orient->_northSouth)
  )
)

Queries and Answers:

_symm(_a2)#_betweenObjRel(_mexico _usa _canada _dim->2 _orient->_southNorth)
no    % Query is not part of grounded rule conclusion

_symm(_a2)#_betweenObjRel(_mexico _usa _canada _orient->_southNorth)
yes    % Query is identical to grounded rule conclusion

_symm(_a2)#_betweenObjRel( _mexico _usa ?X _orient->_southNorth)
?X=_canada

?I#_betweenObjRel(_mexico _usa ?X _orient->_southNorth)
?I=_symm(_a2)  ?X=_canada

?I#_betweenObjRel(?Z _usa ?X _orient->_southNorth)
?I=_symm(_a2)  ?Z=_mexico  ?X=_canada

?I#_betweenObjRel(?X _usa ?X _orient->_southNorth)
no    % No consistent positional-argument substitution possible

_symm(?J)#_betweenObjRel(_mexico _usa _canada _orient->?V)
?J=_a2  ?V=_southNorth


Knowledge Base:

Document(
  Group(
    Forall ?Out1 ?In ?Out2 ?O (
      ?In#_GeoUnit(_neighborNorth->?Out1 _neighborSouth->?Out2) :- ?O#_betweenObjRel(?Out1 ?In ?Out2 _orient->_northSouth)
    )
    _a2#_betweenObjRel(_canada _usa _mexico _dim->2 _orient->_northSouth)
  )
)

Queries and Answers:

_usa#_GeoUnit(_neighborNorth->_canada _neighborSouth->_mexico)
yes    % Query is identical to grounded rule conclusion

_usa#_GeoUnit(_neighborSouth->_mexico _neighborNorth->_canada)
yes    % Query is equal to grounded rule conclusion

_usa#_GeoUnit(_neighborNorth->_canada _neighborSouth->?OutX)
?OutX=_mexico

_usa#_GeoUnit(_neighborNorth->_canada)
yes    % Query is proper part of grounded rule conclusion

_mexico#_GeoUnit(_neighborNorth->_canada)
no    % OID cannot be proved to be in inner position

?I#_GeoUnit(_neighborNorth->_canada)
?I=_usa

?O#_betweenObjRel(_canada ?I ?Out2 _orient->_northSouth)
?O=_a2  ?I=_usa  ?Out2=_mexico


Knowledge Base:

Document(
  Group(
    Forall ?Out1 ?Out2 ?Out3 ?Out4 ?In ?O1 ?O2 (
      Exists ?O (
        ?O#_compassRose(?In _west->?Out3 _north->?Out1 _east->?Out4 _south->?Out2)
      )                                                       :-
        And(?O1#_betweenObjRel(?Out1 ?In ?Out2 _orient->_northSouth)
            ?O2#_betweenObjRel(?Out3 ?In ?Out4 _orient->_westEast))
    )
    Forall ?M (
      Exists ?O ( ?O#_betweenObjRel(_northPole ?M _southPole _dim->2 _orient->_northSouth)   )
    )
    _a2#_betweenObjRel(_canada _usa _mexico _dim->2 _orient->_northSouth)
    _a3#_betweenObjRel(_pacific _usa _atlantic _dim->2 _orient->_westEast)
  )
)

Queries and Answers:

_a4#_compassRose( _usa _west->_pacific _north->_canada _east->_atlantic _south->_mexico)
no    % Existential rule does not assert specific OID

?#_compassRose(_usa _west->_pacific _north->_canada _east->_atlantic _south->_mexico)
yes    % Right-slot normal query is equal to grounded rule conclusion

?#_compassRose(_south->_mexico _west->_pacific)
yes    % Query is proper part of grounded rule conclusion

?I#_compassRose(_usa _west->_pacific _north->_canada _east->_atlantic _south->_mexico)
?I=_skolem1(_canada _mexico _pacific _atlantic _usa _a2 _a3)

?I#_compassRose(?C _west->?W _north->?N _east->?E _south->?S)
?I=_skolem1(_northPole _southPole _pacific _atlantic _usa _skolem2(_usa) _a3)  ?W=_pacific  ?N=_northPole  ?E=_atlantic  ?S=_southPole  ?C=_usa
?I=_skolem1(_canada _mexico _pacific _atlantic _usa _a2 _a3) ?W=_pacific  ?N=_canada  ?E=_atlantic  ?S=_mexico  ?C=_usa


Knowledge Base:

Document(
  Group(
    Forall ?Name ?Street ?Town (
      Exists ?O1 ?O2 (?O1#_addressObj(_name->?Name _place->?O2#_placeObj(_street->?Street _town->?Town)) )  :- _addressRel(?Name ?Street ?Town)
    )
    _addressRel("Seminaris" "Takustr. 39" "14195 Berlin")
  )
)

Queries and Answers:

_addressRel("Seminaris" "Takustr. 39" "14195 Berlin")
yes

_addressRel("Seminaris" ?S "14195 Berlin")
?S="Takustr. 39"

?#_addressObj(_name->"Seminaris" _place->?#_placeObj(_street->"Takustr. 39" _town->"14195 Berlin"))
yes

?#_addressObj(_name->"Seminaris" _place->?#_placeObj(_street->?S _town->"14195 Berlin"))
?S="Takustr. 39"

?O1#_addressObj(_name->"Seminaris" _place->?O2#_placeObj(_street->?S _town->"14195 Berlin"))
?O2=_skolem2("Seminaris" "Takustr. 39" "14195 Berlin" _1)  ?S="Takustr. 39"  ?O1=_skolem1("Seminaris" "Takustr. 39" "14195 Berlin" _1)


Knowledge Base:

Document(
  Group(
    Forall ?Name ?Street ?Town ?O1 ?O2 (
      _addressRel(?Name ?Street ?Town) :- ?O1#_addressObj(_name->?Name _place->?O2#_placeObj(_street->?Street _town->?Town))
    )
    _r1#_addressObj(_name->"Seminaris" _place->_r2#_placeObj(_street->"Takustr. 39" _town->"14195 Berlin"))
  )
)

Queries and Answers:

_r1#_addressObj(_name->"Seminaris" _place->_r2#_placeObj(_street->"Takustr. 39" _town->"14195 Berlin"))
yes

?#_addressObj(_name->"Seminaris" _place->?#_placeObj(_street->?S  _town->"14195 Berlin"))
?S="Takustr. 39"

?O1#_addressObj(_name->"Seminaris" _place->?O2#_placeObj(_street->?S _town->"14195 Berlin"))
?O2=_r2  ?S="Takustr. 39"  ?O1=_r1

_addressRel("Seminaris" "Takustr. 39" "14195 Berlin")
yes

_addressRel("Seminaris" ?S "14195 Berlin")
?S="Takustr. 39"