Advice sought on adding ontology to my site.

20 views
Skip to first unread message

evilC

unread,
Jan 25, 2010, 5:58:05 PM1/25/10
to Ontology Online
Hi, I am writing a facebook / google maps site called "Placebook"

http://placebook.tv - old Prototype based version - more full featured
- desktop only.
http://placebook.mobi - new jQuery based version - less full featured
currently - desktop or mobile (iPhone / Android).

The idea is for Facebook users to add locations to the database, and
each location gets its own wall etc. Locations could be anything - a
restaurant, a sports field, etc etc.

I want to allow each location to have one or more tags associated with
it. Each tag should represent an activity that takes place there - so
in the example of the sports field, there might be a football tag, a
rugby tag, etc, etc. As I said, bear in mind that each location can
have multiple tags, and each one may be wildly different. A sports
field may be used occaisionaly for a market, so could have a tag for
that.

I would like each tag to be able to be picked from an ontology tree.
The jOWL wine demo is exactly the kind of thing I have in mind.

So far, pretty simple - an RDF/XML file with IDs for each node that
could be added as a tag would probably do the trick.
However, the problem comes when I try to work out how I would add the
next layer of features - ratings and searching.

I would like to allow users to rate each tag on a location. So for
example if it were a "restaurant" tag, ratings would be like "Speed of
service" and "Quality of Food", whereas for a "Downhill Mountain
Biking" tag, the ratings would be more like "Difficulty" and "Speed".
Again, bear in mind that each location may have many tags, each of
which you can rate individually.

Now I suppose I could probably achieve this through key/value pairs in
a database, but I am left thinking that there is probably a more
elegant way.

I would also like to allow searching / filtering of the map based upon
the ontology tree. Now the tree should be like the jOWL wine demo -
not just a plain heirarchy, more a class / set based thing. So for
example football and tennis would both be in "ball sports" but only
tennis would be in "raquet sports". I can see ways to do this (for
example if searching on "ball sports" then first I could retrieve a
list of all nodes (tags) that match on ball sports, then pass that
list into a regular SQL select query, but as I said, the reason for
this post is that I am sure there are probably better ways to go about
this.

At the moment, everything on the back end is MySQL based. I would be
open to the idea of using some form of semantic database system, but
if it bolted on to MySQL, all the better.

Advice please!

David Decraene

unread,
Jan 26, 2010, 3:00:48 AM1/26/10
to Ontology Online
Hi

In my opinion, to have a scalable system, you will need to split up
things:
1. classes (categories (tennis, ball sports), properties (rating,
speedOfService) etc) can be defined and described in your ontology
(owl file), and can be loaded with jOWL & reasoned upon.
2. individuals (instances), (e.g. actual restaurants, tennis courts
and their properties - ratings etc) you will probably need to store in
the MySQL database, because the amount of data will unfortunately
become too big too quick to be handled by jowl & a filebased approach.

You could then let jOWL help you refine searches by letting it give
you the proper context, e.g. a user searches on ball sports, then you
know you need to look for tennis, etc, or even that the property speed
of service is probably not needed (unless in tennis, but thats
something different :)).

You can also use jOWL to help you construct predefined templates that
point out, if you add for example a restaurant, the desired properties
(in this case speed of service, not difficulty)- in the case were you
want your users to submit data themselves.

And you can use jOWL to provide proper context for selected
individuals, such as a description of the used properties etc...

I have not really experimented with semantic databases just yet, but
in terms of speed, you can probably work something out with mySQL. It
will require some smart queries.

Hope this helps

BTW your website looks really nice, seems like you given this a lot of
thought, good luck with your efforts.
David


On Jan 25, 11:58 pm, evilC <ev...@evilc.com> wrote:
> Hi, I am writing a facebook / google maps site called "Placebook"
>

> http://placebook.tv- old Prototype based version - more full featured
> - desktop only.http://placebook.mobi- new jQuery based version - less full featured

evilC

unread,
Jan 26, 2010, 5:53:53 PM1/26/10
to Ontology Online
Thanks David for your reply and kind words,


> In my opinion, to have a scalable system, you will need to split up
> things:
> 1. classes (categories (tennis, ball sports), properties (rating,
> speedOfService) etc) can be defined and described in your ontology
> (owl file), and can be loaded with jOWL & reasoned upon.

Right, that is what I was thinking. Didn't think of putting the
properties in the OWL file though, seems like a smart move.

> 2. individuals (instances), (e.g. actual restaurants, tennis courts
> and their properties - ratings etc) you will probably need to store in
> the MySQL database, because the amount of data will unfortunately
> become too big too quick to be handled by jowl & a filebased approach.

I am thinking just key/value pairs will be OK here.

> You could then let jOWL help you refine searches by letting it give
> you the proper context, e.g. a user searches on ball sports, then you
> know you need to look for tennis, etc

This is what worries me. I take it that you mean if a user searches
for "Sport", then the OWL file is parsed by php or js to find all tags
matching "Sport". This is then parsed to a comma separated list and
passed as an argument to an SQL query IN clause.
The worry I have here is that the text passed to that IN clause could
get *very* long. I would rather have some way to represent the
structure in an SQL-like database so that searches can be done without
passing a potentially long string to an IN clause.
What is ideally needed is some way for the database to be able to use
the structure of the OWL file in queries. I have looked into this and
there appear to be SPARQL addons for MySQL, but a lot of them seem
quite heavyweight. I am thinking that it would probably be simpler to
build a node tree in mySQL that represented the structure of the OWL
file so that subqueries could be used for the IN clause. I am thinking
you would probably need to do the inverse of normal and for each node
store the ids of all nodes that are children.
As I said, I looked at SPARQL solutions such as ARC and SPASQL, but
its all rather new to me so I am not sure what I am doing. I suppose
whatever I went with would have to be embeddable in a regular SQL
query or at least able to emulate normal SQL so the rest if the code
can work, but as I said I am a drooling newb when it comes to semantic
databases so I could be completely wrong.
Whatever, I am thinking that jOWL is a good place to start, as any
future semantic database would probably be able to generate the XML
file for jOWL via a PHP page (Like you do with an AJAX call), which is
then cached and allows for off-loading of browsing the ontology tree
to the client's CPU.

> or even that the property speed
> of service is probably not needed (unless in tennis, but thats
> something different :)).

You raise a valid point though. I should not make the name of a tag
value unique and use it in all places. I should allow two tag values
"Speed of service" with two totally different meanings.

Reply all
Reply to author
Forward
0 new messages