Frage

I want to use RDF / triples in my Symfony2 project in order to organize things (in my case it is Tags).

I would see something like this :

ENTITY TAG  <-------------- TAG_TAG --------------> ASSOCIATION_TYPE
         ^                     |
         |---------------------/

Fields :

TAG
  ID
  Tag (text)
  Description (text/html)

TAG_TAG
  ID
  *TAG1
  *TAG2
  *ASSOCIATION_TYPE
  ASSOCIATION_PARAM

Like this, I would be able :

  • To store triple associations
  • To set different association types. For example, PHP is a Programming_language ; stackoverflow.com is a website ; but the Earth turns around the Sun.
  • To set parameters (which permits to give more information inside associations)

We could consider setting a many-to-many relation between TAG_TAG and ASSOCIATION_TYPE. By doing this we could set several parameters.

So I have several questions :

  1. Do you think it's a good way to store triples efficiently ?
  2. Is there any RDF layer to extract existing RDF/triples databases and populate my own ?
  3. Should I consider using some kind of tripleStore like Sesame and use it with Symfony ?
War es hilfreich?

Lösung

To answer your questions:

1) I'm not entirely sure what you're asking. If you're asking if that's a reasonable way to model your data, it's probably ok. But your diagram is not clear and you're a bit light on details. Best thing to do is just do something that works to start with. You can improve the modeling later without much of a hassle.

If you're asking about storage of triples, don't. See my response to #3.

2) There are many RDF libraries available, you have Jena & Sesame in Java, dotNetRdf for the .Net world, RDFLib in python, redland for C, etc.

3) Yes. Don't attempt to re-invent the wheel and build your own triple store. It's not an easy project and you won't do better than even the worst existing triple store on any reasonable time scale.

Andere Tipps

As Michael said - please don't build your own triple store! There are several solutions available in PHP:

  • ARC2 provides a triple store based on MySQL
  • The librdf extension provides a PHP wrapper for the standrad RDF C library
  • The Erfurt Library is an abstraction library for connecting with the open source Virtuoso Server triple store, but also has its own triple store based on Zend DB taht can be used with MySQL.
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top