Booleans in RDF question ...

topic posted Mon, November 3, 2003 - 10:18 AM by  phil
Share/Save/Bookmark
Advertisement
I'm trying to learn about RDF by writing a FOAF extension in it.

This a quick question to any experts out there. Suppose I want to represent booleans. Should I use :

1)<myExtension:FlagName>True</myExtension:FlagName>

or should I use

2)
<myExtension:FlagName />

To represent that the boolean is true.

What if I want to represent a number of properties that may or may not occur for this person. Should I do them in style 1 or 2?

I've seen some documentation about bags and sequences as well. Are these used in FOAF-like apps?

cheers

phil
posted by:
phil
Brazil
Advertisement
Advertisement
  • Re: Booleans in RDF question ...

    Mon, November 10, 2003 - 12:03 AM
    A question is how is the property used? Boolean doesn't usually show up often in RDF things. Try to think of things in subject-predicate-object style and see what comes out.

    For example, you've got <foaf:knows> right? Seems boolean. But it wraps around a <foaf:Person>. The RDF would be:

    <foaf:Person rdf:id="foo">
    <foaf:knows>
    <foaf:Person rdf:id="bar">
    <foaf:name>Joe Bar</foaf:name>
    </foaf:Person>
    </foaf:knows>
    </foaf:Person>

    which looks something like this in triples:

    foo www.w3.org/1999/02/22-rdf-syntax-ns#type xmlns.com/foaf/0.1/Person
    foo xmlns.com/foaf/0.1/knows bar
    bar www.w3.org/1999/02/22-rdf-syntax-ns#type xmlns.com/foaf/0.1/Person
    bar xmlns.com/foaf/0.1/name Joe Bar

    RDF really isn't something that lends it self to easy examples, 5 minute tutorials, or 3 day learning sprees, so I haven't really done it justice, but you might get something from this.

    #foaf / #rdfig on irc.freenode.net is the best place to ask around for RDF advice.
    • Re: Booleans in RDF question ...

      Mon, November 10, 2003 - 4:43 AM
      Thanks Eric.

      Let me explain my problem a bit better. I'm interested in alternative money systems, and I'd like to add a "currency" extension to the FOAF person tag so that a person can describe which economic networks they're members of.

      Now in my naive XML I'd write something like this (let's use AM as the namespace of my currency tags)

      <foaf:person rdf:id="foo">
      <AM:currency rdf:id="mydollar">
      <AM:name>MyDollar</AM:name>
      <AM:paynet url="paymentEnabler.com" />
      <AM:mutualCredit />
      <AM:demurrage />
      %lt;/AM:currency>

      etc.

      where the demurrge and mutualCredit tags represent boolean flags. Either the currency has these properties or doesn't.

      But I don't know if this is allowed. I suppose I could also write :

      <AM:demurrage>True</AM:demurrage>

      Which raises the question, if "demurrage" isn't true, do I also need to explicitly represent

      <:AM:demurrage>False</AM:demurrage>

      It seems this might be something which is free for my application to decide, that I can allow the absence of the tag to imply false. Or it might be something where RDF has an implicit interpretation eg. when a tag is missing it means "undefined". So I shouldn't be using it to imply false.

      Any intuitions on this?

      Cheers

      phil

Recent topics in "PeopleAggregator"