Question

Are there libraries or certain "techniques" that you can use to create an ontology of elements?

Or "design patterns"?

I am talking about just a "graph" of things. Suppose I have a bunch of words. Certain words are "under" other words or "related" to other words. I need a good way to group them and know their relationship.

Was it helpful?

OTHER TIPS

You can use rdflib for storing triples. You then have to make your own decisions about the kind of ontology you want to build. Look at the OWL format for that.

I toyed with python and ontologies during my PhD, so perhaps a quick scan through my thesis can give you some ideas. For instance a short OWL summary or a UML model of a plone ontology tool.

RDFLIB is a mature implementation of a triple store, with plenty of documentation.

However, this library worked for me only for smaller projects. For example there is a nice RDF/XML catalog of the Gutenberg Project Library, which i wasn't able to hack around with (on my dual-core, 2GBRAM machine), because it's simply too large (~ 100M) - even Java/Protege had a tendency to stall on this filesizes. It's a pity.

Alternative: http://seth-scripting.sourceforge.net/

Suppose I have a bunch of words. Certain words are "under" other words or "related" to other words. I need a good way to group them and know their relationship.

Take a look at wordnet, which is available in RDF format i.e. according to an RDF Schema ontology. This is exactly what you describe.

http://www.w3.org/2006/03/wn/wn20/


(C. Fellbaum. WordNet: An Electronic Lexical Database. MIT Press, 1998. See also http://wordnet.princeton.edu/ )

(van Assem, Gangemi and Schreiber (eds.). RDF/OWL Representation of WordNet, W3C Working Draft 19 June 2006 W3C Working Draft 19 June 2006; http://www.w3.org/TR/2006/WD-wordnet-rdf-20060619/)

an ontology is a dictionary that defines URIs and agree on a meaning for each of them. A trivial ontology is just a bunch of URIs you pick more or less out of the blue. This method unfortunately does not give you any information about semantic relationships of your ontological entities. To explain these relationships you normally describe them with an OWL file, and you normally use tools for this. I use Protege. it's quite ok.

If it makes sense to represent something as a directed graph, why not just use a graph class? Python-graph offers simple pure-python graph representations. NetworkX has a slightly harder to use C implementation.

Owlready2 is a package for manipulating OWL 2.0 ontologies in Python. It can load, modify, save ontologies, and it supports reasoning via HermiT (included). Owlready allows a transparent access to OWL ontologies.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top