On 1/15/11 1:06 PM, Luka wrote:
Hello everyone,
this is my 3rd or 4th question posted in this list and I would like to
say that all of you
have been very helpful so far and I hope it will stay like that after
reading this one too :)
so...
I am building a web application in PHP that is supposed to explore
how semantic storage can be used as storage in web applications.
My application is a catalogue of products sold by few vendors that holds
info on products (prices, descriptions etc.)
I know that using Semantic storage in my case can seem little bit
awkward instead
of using RDFa but this app serves only as a demonstration of using
triple store as database.
NOTE: mySQL will be used for web app specific data storage. I know
Virtuoso could
serve here as a data storage for all data but since my PHP framework
enables great RAD features when using mySql (or PostgreSQL) I'll stick
to relational db here.
So your PHP oriented RAD is incapable of using PHP-ODBC binding layer?
As I said, I don't want to include Semantic data by adding RDFa tags
into my xHTML code
(which is product of application displaying data from relational
database) but using
Virtuoso RDF store as a database for all data regarding sellers,
products, product description,
product image folder etc. Basically, only products and sellers info
will be stored as triples (ok, quads).
Fine.
So, the idea to build catalogue RDF and import it to Virtuoso when
it's done.
I know it could be done directly through Virtuoso/SPARQL but it
doesn't matter now.
By the way, I will use GoodRelations e-commerce ontology since it
covers well my domain.
So, first I would build my RDF (in real example using turtle syntax):
PRODUCT A gr:hasWeight "100"
PRODUCT A gr:hasPrice "20"
PRODUCT A gr:isSoldBy SELLER1
Later in my PHP/SPARQL queries I would retrieve this data and present
it to the user just
like I would usually do with SQL.
Well, when you execute a SPARQL SELECT your resultset is Tabular
meaning: its identical to a SQL resultset. If you surface the URIs in
your resultset you have the option to exploit the "Super Key" aspect of
URIs i.e. unburdening your results from the requirement of having all
the data associated with a record. For instance, via GoodRelations you
can identify Business Entities via URIs and when these exist in tabular
results, users can simply click on these links to discover additional
information. The cost to you coding wise is Zero.
Question 1:
When I store my graph what do I use as IRIs here? Do I use internal
URLs of the application ?
What I mean is if I wanted to say - PRODUCT_A gr:isSoldBy SELLER1 -
do I do it something like this:
"myDomain.com/products/PRODUCT_A.html" gr:isSoldBy
"myDomain.com/products/SELLER1.html" ?
Re. IRI/URI for entities (that show up as keyed records in tabular
resultsets, for instance) it isn't that straightforward. A URI/IRI is a
Reference Datatype native to Virtuoso. A Reference Datatype implies
ability to De-reference too. This is where the power of HTTP URI/IRIs
come into play since you de-reference Super Keys across an HTTP network
(or even beyond that when using other schemes).
You are better off using Virtuoso RDF Views atop MySQL to make your
GoodRelations based graph. Alternatively, make a CSV dump of your
product catalog and then load into Virtuoso, and then use RDF Views to
map to GoodRelations. This approach ultimately saves you the burden of
having to make functional de-referencable URIs that are able to
disambiguate Names (Name Reference) from Addresses (actual Data Source
Address i.e. URL).
If so, I have to be sure at modelling phase how my route controller
will interpret urls ?
What I mean by this e.g. my application would form the URLs in
following manner:
domain.com/controllerName/action/DATA
<http://domain.com/controllerName/action/DATA> where DATA would be
grabbed from triple store ?
How would you store this data in the triple store?
Storing the data isn't you challenge. As stated above, make URIs
function properly is going to be the issue should you be seeking Linked
Data functionality.
Question 2:
What about data that says, for example, in which folder images of the
product can be found ?
How do I store that info? I know this data has no semantic value but I
need it in order
to make application work. Which vocabulary should I use to say:
- PRODUCT_A vocab:hasFolder "/path/toFolder/" -
foaf:depiction is a property that can take a resource (e.g. image URL)
as it value. Images can be in the filesystem or WebDAV folders which are
associated with virtual directories within a virtual domain.
____
I know my questions can seem little bit strange and maybe I got it all
wrong but I'm coming
from ER background (actually, like everyone else here) so I hope
you'll understand what seems to be confusing me here...
What's confusing is that the connection between Entity Modeling and
Linked Data isn't clear. There are also issues re. MySQL dependency
skewing what's truly possible at low cost. At some point you are going
to have to perform a proper: Cost vs Benefits analysis, then decided if
MySQL has to define your options, and if so how do you exploit RDF Views
etc. re. Virtuoso.
Kingsley
Thank you so much for even reading my question ;)
Best regards,
Luka
--
chao.com.hr <http://chao.com.hr> - majice iz susjedstva :)
------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Virtuoso-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/virtuoso-users
--
Regards,
Kingsley Idehen
President& CEO
OpenLink Software
Web: http://www.openlinksw.com
Weblog: http://www.openlinksw.com/blog/~kidehen
Twitter/Identi.ca: kidehen