W3C home > Mailing lists > Public > semantic-web@w3.org > May 2008

Re: stating that something doesn't exist

From: Peter Ansell <ansell.peter@gmail.com>
Date: Thu, 22 May 2008 07:29:46 +1000
Message-ID: <a1be7e0e0805211429o7d9561c2ofd5863d6c846cd82@mail.gmail.com>
To: "Johnson, Matthew C. (LNG-HBE)" <Matthew.C.Johnson@lexisnexis.com>
Cc: semantic-web@w3.org

2008/5/22 Johnson, Matthew C. (LNG-HBE) <Matthew.C.Johnson@lexisnexis.com>:
> Hi,
>
>
>
> I'm slowing soaking in what OWL can and cannot do and after reading the
> "Lessons For Ontology Writers" post [1] by Ian Davis, I thought I'd go ahead
> and ask this capabilities question here.
>
>
>
> In OWL, can you directly define a property that says that something does not
> occur.  My current use-case is in determining hyper-linking relationships
> between various publications.  The following:
>
>
>
> mysch:Pub a rdfs:Class .
>
> mysch:linksTo a rdf:Property .
>
>
>
> mypubs:p1 a mysch:Pub .
>
> mypubs:p2 a mysch:Pub .
>
> mypubs:p3 a mysch:Pub .
>
>
>
> mypubs:p1 mysch:linksTo mypubs:2 .
>
> mypubs:p3 mysch:linksTo mypubs:2 .
>
>
>
> Lets me say that pub 1 links to pub 2 and that pub 3 links to pub 2.
> However, if I understand the open-world assumption, I cannot assume that pub
> 2 does not link to pub 3.  I would need to define something like:
>
>
>
> mysch:notLinksTo a rdf:Property .
>
>
>
> to explicitly state this fact that pub 2 does not link to pub 3.
>
>
>
> My question is whether it is possible in OWL to define a property whose
> range of acceptable instances is the list of instances that do not exist as
> an object in a mysch:linksTo statement (for a given publication)?  While
> statically stating that pub 2 does not link to pub 3 is technically possible
> for me, it seems unfortunate.  This is because when a new pub comes along
> (e.g. mysch:p4), I then have to update all the statements I've already
> made.  This is the part that Ian Davis agreed would cause an explosion of
> triples.  I would really like to only state the things that I can
> programmatically find by parsing the raw syntax of a publication (e.g. I can
> find a <a href…> element which provides the mysch:linksTo assertion) and
>  would rather the system infer that the lack of a <mysch:linksTo>
> relationship really means a <mysch:notLinksTo>.
>
>
>
> Perhaps the answer is really through SPARQL.  I hope I've made my
> question(s) clear.  Please let me know if I haven't.

You can use SPARQL to partially derive information about the open
world by using the following construct:

SELECT DISTINCT ?unlinkedDocument1, ?unlinkedDocument2
{
# pick out two publications
?unlinkedDocument1 a mysch:Pub
?unlinkedDocument2 a mysch:Pub

# make them unique
FILTER(?unlinkedDocument1 != ?unlinkedDocument2)

# Introduce a temporary variable in an optional section to determine
whether the pattern exists for either document
OPTIONAL{ ?temporaryDocument1 mysch:linksTo ?unlinkedDocument2
FILTER(?temporaryDocument1 = ?unlinkedDocument1))

OPTIONAL{ ?temporaryDocument2 mysch:linksTo ?unlinkedDocument1
FILTER(?temporaryDocument2 = ?unlinkedDocument2))

# Check off that both of the temporary variables from the OPTIONAL
parts didn't bind, meaning there was no link, and hence including
these two documents in the results as a row where the two fields were
not linked
FILTER(!bound(?temporaryDocument1) && !bound(?temporaryDocument2})
}

That should do what you want. And I know, it looks like magic but it
seems to work. It would create a rather large set of results on any
sufficiently large and sparsely linked set of publications, so running
it may take some time and generate a lot of results!

Hope that helps,

Peter
Received on Wednesday, 21 May 2008 21:30:26 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 21:45:22 GMT