Introduction
I am programming a semantic web application in haskell.
With hsparql http://hackage.haskell.org/package/hsparql I can access my Tripple store. I am currently using http://4store.org/ (mainly because it was easy to install). I use snap http://snapframework.com/ to do the servlet programming (Yesod is also very cool !!).
I am currently using SKOS to represent bookmark categories in RDF.
Links to SKOS:
Basically, the Skos concept is a category. It has a URL (as an identifier) and a shortcut. Further Skos concepts may have sub-sciences defined with “wider” and “narrower”.
For example, in my posts there is the SKOS "all bookmarks" concept, with the additional concept of "haskell bookmarks". And both concepts have a URL (e.g. ID) and a label. In addition, "haskell bookmarks" refers to the broader concept of "all bookmarks."
My problem
I need a data structure in haskell for SKOS.
My current:
-- Type Aliases. type Url = String type Label = String -- Date Structure. data SkosConcept = SkosConcept { url :: Url , label :: Label , subConcepts :: [SkosConcept] } deriving (Show)
I think this is not very good, but I do not know the best.
In addition, in the future, the data structure should be expanded to several labels, and means to store related concepts, ...
In addition, some concepts may not have any additional concepts.
Any pointers on how to improve the data structure or "do it right"
===== EDIT: ======
The problem is that the skos concept may have several broader skin concepts. Thus, my haskell bookmarks can have two broader skin concepts (for example, categories) called programming bookmarks and my important bookmarks.
The only solutions I can think of now are to use:
- oriented graph for a "broader" relationship of skos concepts
- the binary relation is "wider" (but I don't know if there is good haskell support).
- no intermediate data structures and all my functions request the RDF store tripper.