Story #12067

As Robin I want to use existing ontologies (like dbpedia, GoodRelations)

Added by Jochen Rau over 2 years ago. Updated over 2 years ago.

Status:Accepted Start date:2011-01-10
Priority:Should have Due date:
Assignee:- % Done:

0%

Category:-
Target version:-
Sprint: Tags:
Branch:
Story points-
Velocity based estimate-
Remaining hours
Votes: 0

History

Updated by Jochen Rau over 2 years ago

  • Status changed from New to Accepted

Updated by Thomas Maroschik over 2 years ago

For this story we have to implement at least a basic triple store. Maybe this hasn't necessarily to be stored in database. We should try if parsing the ontology at runtime is sufficient in terms of performance. I would discourage from using simplexml for this, because the DOM implementation is much better suited for large XML files and supports also xquery and namespaces very well. Against simplexml DOM does not load the complete file into memory.

Updated by Thomas Maroschik over 2 years ago

I'm sorry. In the last post I meant the PHP XML SAX implementation instead of DOM. Any DOM implementation is loaded in memory by design ;)

I thought about possible use cases of this story and 2 instantly crossed my mind:

  • Establishing of a permanent mapping between the ontology and well structured content (e.g. a calendar implementation)
  • Tagging of loosely structured content (e.g. tagging the headline of tt_content with some kind of foaf:person, etc.)

So these 2 approaches have not many in common, except dealing with ontologies.
What would be here the best approach?

  • Defining some default mappings, that are choose able in the content element/record
  • Overriding the default mappings with some sort of tags

Tell me your ideas :)

Updated by Jochen Rau over 2 years ago

I must admit that "use existing ontologies" is not a very precise description. But that's because Robin is always a little bit fuzzy ;-).

It could mean that
  • we "execute" an ontology (generate objects on runtime based on an ontology),
  • we generate PHP classes by parsing an ontology (an ontology serialized as PHP class files, Kickstarter),
  • we connect classes and attributes with subclasses of rdfs:Class resp. rdf:Property,
  • we couple Instances like a content element with elements of an Ontology (eg. for tagging purposes).

My primary intention was to connect classes and attributes with subclasses of rdfs:Class resp. rdf:Property. At the T3DD10 I presented a possible solution by adding annotations:

/**
 * @prefix foaf: <http://xmlns.com/foaf/0.1/>
 * @prefix owl: <http://www.w3.org/2002/07/owl#>
 * @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
 * @prefix core: <http://www.typo3.org/ontology/core/>
 * @prefix gen: <http://www.typo3.org/ontology/generic/domain/model/>
 * @semantic rdfs:subClassOf gen:Party
 * @semantic owl:disjointWith gen:Organization
 * @semantic core:isMemberOf gen:Organization
 */
class Tx_Generic_Domain_Model_Person extends Tx_Generic_Domain_Model_Party {

    /**
     * Party Names
     * @var Tx_Extbase_Persistence_ObjectStorage<Tx_Generic_Domain_Model_PersonName>
     * @semantic a foaf:name
     */
    protected $partyNames;

But this is too inflexible. Robert suggested to inject an Interface (via AOP in FLOW3) to be able to dynamically change the implementation. I have not discussed this in more detail with him, yet.

Another solution would be to keep this metadata in a separate place (TypoScript, YAML). I had some problems with formulation rdf mappings in TypoScript. Maybe RDF/JSON could give us some hints.

The last thing came in mind was: Why not specify this in RDF Triples (assuming that we can access a triple store), like:

@prefix : <http://example/classes/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
:Tx_Generic_Domain_Model_Person a foaf:Person ;
        rdfs:subClassOf :Tx_Generic_Domain_Model_Party;
        owl:disjointWith :Tx_Generic_Domain_Model_Organization.
[...]

We can basically describe everything in the system with RDF. But this might be out of scope of this Story ;-).

Also available in: Atom PDF