Naming Properties and Relations

This discussion is closed: you can't post new comments.

This post is about how to name properties and relations in RDF schemas. Or rather, about how different ontology developers use different conventions and how this can sometimes be confusing.

Part of the work that I’ve been doing over the last few months at TSO has been for OPSI, who want to provide information about UK legislation for reuse through an API as well as eventually through a new end-user service. The Single Legislation Service API is now available, in beta, if you want to take a look.

One way in which we’re providing information about legislation is using RDF/XML. An example is the Criminal Justice Act 1993 Section 67, for which RDF is available at http://legislation.data.gov.uk/ukpga/1993/36/section/67/data.rdf. For now, we’ve made the decision to not attempt to create any of our own ontologies for the RDF, but to reuse ones that are already out there.

We’re making an explicit distinction within the service between the idea of an item or section of legislation (such as the Criminal Justice Act 1993 Section 67), versions of that legislation (such as the Criminal Justice Act 1993 Section 67 as it was in force on 1st December 2001) and that version formatted in XML, HTML or some other format (such as the XML version of the Criminal Justice Act 1993 Section 67 as it was in force on 1st December 2001).

These three ways of thinking about legislation correspond to the FRBR Work, Expression and Manifestation. So to talk about them in RDF, we use the FRBR vocabulary created by Ian Davis and Richard Newman, in which these classes are called frbr:Work, frbr:Expression and frbr:Manifestation.

One of the other ontologies that we’re using is the Metalex ontology which is specifically designed for legislation. It also builds on FRBR, and calls the relevant classes metalex:BibliographicWork, metalex:BibliographicExpression and metalex:BibliographicManifestation.

So we have two vocabularies that represent the same concepts with equivalent classes, and obviously they have equivalent properties linking them. And this is what I find interesting. In the FRBR vocabulary, the relationships are:

  • frbr:Work -- frbr:realization --> frbr:Expression
  • frbr:Expression -- frbr:realizationOf --> frbr:Work
  • frbr:Expression -- frbr:embodiment --> frbr:Manifestation
  • frbr:Manifestation -- frbr:embodimentOf --> frbr:Expression

The FRBR vocabulary uses nouns to name the relations. It’s the same pattern that’s often used to name properties (ie predicates that take literals as values):

  • foaf:name
  • dc:title
  • rdfs:label

Using nouns leads you to read statements in the pattern “subject’s predicate is object”:

  • Jeni’s name is “Jeni”
  • the legislation’s title is “Criminal Justice Act 1993”
  • England’s label is “England”
  • the legislation’s realization is the version from 1st December 2001
  • this document’s embodiment is that XML file

The trouble is that this pattern really doesn’t work for the inverse relationships: frbr:realizationOf and frbr:embodimentOf:

  • the version from 1st December 2001’s realization of is the legislation
  • that XML file’s embodiment of is this document

They really want to support a sentence structure like “subject is a predicate object”:

  • the version from 1st December 2001 is a realization of the legislation
  • that XML file is a embodiment of this document

But if you then map that back to the original relation, you run into trouble, because there’s a temptation to add a preposition into the sentence to make it make sense, and inserting that preposition inverts the meaning of the statement:

  • the legislation is a realization [of] the version from 1st December 2001
  • this document is a embodiment [of] that XML file

You don’t run into this problem when you use nouns to name properties because there’s never an inverse relationship from a literal to a resource that you need to name. You also won’t run into it for relations that have easily named inverses, such as parent/child or owner/possession although there is a similar confusion with the use of comparatives for relation names, as in SKOS, where the relation skos:broader could mean:

  • X is broader than Y; or
  • X’s broader term is Y

In the Metalex ontology, on the other hand, the relationships are:

  • metalex:BibliographicWork -- metalex:realizedBy --> metalex:BibliographicExpression
  • metalex:BibliographicExpression -- metalex:realizes --> metalex:BibliographicWork
  • metalex:BibliographicExpression -- metalex:embodiedBy --> metalex:BibliographicManifestation
  • metalex:BibliographicManifestation -- metalex:embodies --> metalex:BibliographicExpression

Here, the relationships are verbs, leading you to read sentences in the form “subject [is] predicate object”:

  • the legislation is realized by the version from 1st December 2001
  • the version from 1st December 2001 realizes the legislation
  • this document is embodied by that XML file
  • that XML file embodies this document

The only weirdness here is having to add “is” before some predicates but not others.

The tradition in AI is to use verbs everywhere. Instead of foaf:name or dc:title, you would have foaf:hasName and dc:hasTitle. Doing this for properties with literal values seems unnecessarily verbose, but for relations I think it’s a good rule of thumb in order to disambiguate the direction of the relation.

Comments

Re: Naming Properties and Relations

Great post, I’m apparently too stupid for lists in markdown, I’ve posted my comment off-site

Re: Naming Properties and Relations

Heh, the property names in our casting of the FRBR are probably my fault — I doubt we changed the from my own early drafts. Ian is blameless :)

Re: Naming Properties and Relations

I really wasn’t blaming anyone! :)

Please use Role Nouns as names of properties and relations.

While the very “hasChild” is common in the AI world, “child” is my strong preference. As IanD says, the label is what is important, not the URI, so it is not the end of the world for if you use some random URI but have a good label, like “child”. You didn’t mention one common metaphor most users are familiar with, which is forms. In forms, you have “name”, “address”, “father”, not “hasName”, “hasAddress”, “hasFather”!

If you write a bit of N3 of course, the role-noun mode is much better. Things like

:JB name “Joe Bloggs”; is child of :JA

work well as N3 has built in the ability to add the “is” .. “of” syntax to invert the direction:

x:Book a :Class;    :subClassOf x:Work;   is :subClassOf of x:Novel.

is the thing you have to write given the current RDFS “subClassOf” bug. If only RDFs had just used “superclass”:

x:Book a :Class;    :superclass x:Work;   is :superclass of x:Novel.

is so much better.

Switching from developer to user, URIs to labels, and N3 to Tabulator: The tabulator also will construct “is … of” labels in the UI. Both that and also the forms-like interfaces in outline mode, column headings in tables, basically all over the application work better with the role-noun approach is used.

Ideally, use role-nouns in the localID part of URIs. Whether or not you do, make sure you have a schema which has labels and that those labels are role nouns, in lower case.

:author a rdf:Property; rdfs:label “author”@en, “auteur”@fr.

Re: Naming Properties and Relations

Hi Jeni,

Remember that the important bit for humans is the label you give to the property, not the URI itself. You can use Morten’s label schema for plural and inverse labels ( http://www.wasab.dk/morten/2004/03/label )

I tend to follow the RoleNoun convention for labels ( http://esw.w3.org/topic/RoleNoun ) because it makes for an easier user interface. RoleNoun’s have the property that it’s often quite easy to label the reverse relationship by surrounding the standard label with “is” and “of”. So if the property is labelled “father” then you can show the direct relationship as “x has father y” , and backlinks as “z is father of y” without having to look up an inverse property. You lose that convenience with the “has” prefix in the label.

I enforce these conventions in http://open.vocab.org/ and provide hint sentences to help people choose a good label. E.g. for “owner” I might show: “foo is owner of thing” and “thing has owner foo”, and for the plural label I might show: “the owners of thing are foo and bar” or “foo and bar are owners of thing” (see http://open.vocab.org/forms/newprop )

It’s not clear to me what the plural labels should be for the verb naming convention? hasOwners? Seems even tougher to produce good UIs with labels like that.

The FRBR inverse properties break that convention, because they should be manifestation/isManifestationOf. I should fix up the labels now I have 4 more years of learning under my belt. The relationship vocabulary ( ) is even messier. http://purl.org/vocab/relationship/childOf should really have the label “parent” and http://purl.org/vocab/relationship/parentOf the label “child”. That’s so confusing that I haven’t dared change it!

Re: Naming Properties and Relations

Hi Ian,

I’m really glad that you’ve responded with some rationale. It’s great to get to understand the reasons different developers have for the decisions that they make.

Given that user interfaces should, as you say, be using property labels rather than munging URIs, the users that I’m interested in for the naming of properties (as opposed to the labels) are the developers who are writing and reading RDF directly in syntaxes like RDF/XML or Turtle. It’s the sentences that we make in our heads, reading those syntaxes, rather than the sentences that we write in the interfaces that I was writing about.

Which I say because while I find the argument “think of a form!” persuasive, I’m not completely convinced that the same convention necessarily applies in the two contexts. A user interface might use a form-based interface but RDF syntaxes are usually written as sentences.

To answer your question about plurals for verb-based predicate names, it depends what’s being pluralised. In the normal state of affairs for an interface where the subject is singular, you can use the same label as usual:

  • the work is realized by those expressions
  • the expression realizes those works

Where you’re looking at plural subjects, you have to provide a third-person plural form of the verb:

  • the works are realized by the expression
  • the expressions realize the work

I think the thing that rubs me up the wrong way about the RoleName convention seems to explicitly favour one direction of the relationship with an easy name, and use rules for constructing sentences which work in one direction and not the other. The conventions:

  • subject has predicate object” in one direction and
  • object is predicate of subject” for the inverse

work OK for property names like realization:

  • “this work has realization that expression”
  • “that expression is realization of this work”

but really don’t for the inverse property name isRealizationOf:

  • “that expression has is realization of this work”
  • “this work is is realization of of that expression”

How is someone supposed to know which is the (somewhat artificial) primary relation and which the secondary poor relation? Is there an RDFS or OWL or other property that indicates this so that the user interface does something sensible?

Of course, as in the parent/child example it’s sometimes possible to label both the relation and its inverse with terms that can be used with the “has property” and “is property of” patterns. Those don’t bother me. I think it’s the the coupling of *noun* and is*Noun*Of. If you’d called the relations after their range (ie expression and work) then I would probably never have even thought of writing this post.

Perhaps the answer is to avoid the issue by not defining an inverse at all if you can’t think of a noun-based label for it. Maybe a relationship that hasn’t got a good English term isn’t worth indicating explicitly in RDF.

This is all just me trying to piece together why it was that when using these properties several times I had to stop and think “hang on, was frbr:realization linking from the frbr:Work to the frbr:Expression or was it the other way around?”. Perhaps it’s simply a matter of what you’re used to, but I found the verb-based predicates didn’t leave me guessing (or rather, looking it up, I would never guess, of course!).