- From: Johnson, Matthew C. (LNG-HBE) <Matthew.C.Johnson@lexisnexis.com>
- Date: Wed, 21 May 2008 22:18:29 -0400
- To: "Peter Ansell" <ansell.peter@gmail.com>
- Cc: <semantic-web@w3.org>
Hmm. This is interesting, thanks. As far as generating a lot of triples from a sparsely linking set of publications, I think my actual use-case would probably eliminate that. I suspect that this type of query would normally be done on a publication-by-publication basis. So I would really be checking if any links exist specifically for publication 2 to [specifically] publication 3. This would dramatically reduce the number of triples generated (although it might still take some time). Also, I suspect another alternative would be to let the application itself do some of the rationalization by simply grabbing all of the publications that "pub 2" does link to (a simple query) and then checking to see if "pub 3" is in that list. Ideally, I would like the data or query to say this directly (really, I'd just like a yes or no answer) but if performance becomes an issue, it might be a second choice. Thanks again for the thoughts. Matt -----Original Message----- From: Peter Ansell [mailto:ansell.peter@gmail.com] Sent: Wednesday, May 21, 2008 5:30 PM To: Johnson, Matthew C. (LNG-HBE) Cc: semantic-web@w3.org Subject: Re: stating that something doesn't exist 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 Thursday, 22 May 2008 02:19:21 UTC