in

The ORM Foundation

Get the facts!

Question on BBB exercise 3.3

Last post 10-19-2013 19:04 by Anonymous. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 10-13-2013 15:33

    Question on BBB exercise 3.3

    I'm working through the exercises in the Big Brown Book.

      Exercise 3.3 question 1 asks:
      Assuming suitable entity types and reference modes are understood, which of the following sentences fit our standard pattern for expressing exactly one elementary fact?
    

    The key says the correct answer is: A, F, and J, but I don't understand why J is correct:

      J) Brisbane and Sydney are in the same country
    

    That seems non-elementary since it's a conjunction. No?

  • 10-13-2013 17:53 In reply to

    Re: Question on BBB exercise 3.3

    If the fact type is "City(1) is in the same country as City(2)" then you can see that's elementary. Item (j) in the exercise has the same fact type expressed using a reading which contains the word "and". That may be poor form, but it's a valid way of expressing this elementary fact.
  • 10-13-2013 21:13 In reply to

    Re: Question on BBB exercise 3.3

    J is not a conjunction of facts (unlike "Brisbane and Sydney are in some Country" which may be rephrased as a conjunction of "Brisbane is in some Country" and "Sydney is in some Country". It simply means "Brisbane is in the same country as Sydney" -- you can't split this into two facts without loss of information. Cheers Terry
  • 10-16-2013 2:58 In reply to

    Re: Question on BBB exercise 3.3

    I think I understand now.

    I was thinking the fact would be stored as "City is in Country" and that the role "are in the same country" would be derived. But I see now that I was jumping the gun and should have restricted myself to the fact as it was expressed.

    Thank you!

  • 10-18-2013 18:00 In reply to

    Re: Question on BBB exercise 3.3

    Although it's valid ORM, it won't work in CQL - "and" is reserved as a clause conjunction. That's probably not a problem for you, but it does come up in other cases too, like "Person is in command and control of Platoon", etc.
  • 10-19-2013 9:20 In reply to

    Re: Question on BBB exercise 3.3

     Thanks Clifford,

    This makes me wonder about the best way to encode the Pig and Whistle problem in ORM & CQL.

    ================

    The new owner of the pub called The Pig and Whistle was dissatisfied with the way the characters the pub's sign were arranged.
    So he hired a painter to make a new sign and gave the following instructions:

    Please paint the new sign so that there is more space between Pig and and and and and Whistle.

     

    Ken

     

  • 10-19-2013 19:04 In reply to

    Re: Question on BBB exercise 3.3

    Very droll, but quite straightforward Ken, since text strings are quoted. See whether this tickles your fancy...

    vocabulary SignWriting;
    
    each Word is written as a String;
    each Spacing is written as an Integer in mm;
    each Position is written as an Integer;
    each Sign is identified by its ID;
    
    each Sign Word is where
        some Sign has text at some Position;
    Sign Word displays one Word;
    Sign Word follows preceding- Sign Word after one Spacing;
    
    Sign Word (in which Sign 1 has text at Position 1) displays Word 'Pig';
    Sign Word (in which Sign 1 has text at Position 2) displays Word 'and'
        and follows preceding- Sign Word (in which Sign 1 has text at Position 1) after Spacing 10;
    Sign Word (in which Sign 1 has text at Position 3) displays Word 'Whistle'
        and follows preceding- Sign Word (in which Sign 2 has text at Position 2) after Spacing 10;
    
    /* New deontic constraint specifies minimum text spacing */
    Sign Word follows preceding- Sign Word after Spacing > 10 mm (otherwise repaint sign);
    
Page 1 of 1 (7 items)
© 2008-2014 The ORM Foundation: A UK not-for-profit organisation -------------- Terms of Service