I have a simple class and an ObjectProperty as a self-relation in which the domain and range point to the same class. I want to implement a graph representing the hierarchical structure of the Library of Congress Subject Headings or any other similar Controlled Vocabulary concept.
For loading data I have used two simple csv files. One is for a complete list of subject headings, and the other contains the one-to-many relation between each subject and its narrower concepts as its child.
But the result is not as I expected and the graph is messy.
Please someone point me to a similar example.
I have a simple class and an ObjectProperty as a self-relation in which the domain and range point to the same class.
Just FYI, there is nothing special about having the domain and range of an object property being the same class. E.g., consider the object property hasSpouse. The domain and range for that could be Person. That's quite common. Having an object property where one individual always has itself as a value is something less common and is a Reflexive property. E.g., if you had a property such as equivalentTo that means two instances may be different (different IRIs) but are for all intents and purposes the same (but not so similar that you want to use owl:SameAs) that would be a reflexive property since each object would be equivalentTo itself. In my experience though using the Reflexive characteristic for properties in OWL is something I avoid. I've done it a couple of times and it tends to make many reasoners slow and also when you do that in some tools it makes the domain and range default to owl:Thing regardless of what you define. If you made the property reflexive that might account for why the graph looks odd. Can you include a screen shot to show how it looks?
Michael
Thanks.
In this screenshot, The"Photographs" concept has 10 Narrower Than (NT) Concepts and it's Ok. One of them is "Photographic Prints" and it is supposed to have its own NT nodes that exist but there are no relations between them.
I should check and validate the data again.
Sorry, I should have asked this before. If you are still having trouble could you attach the OWL or RDF file? That will help me understand much better what you are trying to do and why it isn't working.
Michael
Yes unfortunately I could't manage to create a hierarchical representation of LCTGM Subjects as a nested graph.
@prefix mdhn: <http://example.com/mdhn/> .
mdhn:LCTGMSubject a rdfs:Class ;
rdfs:comment "Class to associate Theasures Of Graphical Material subjects to the photograph" ;
rdfs:label "LCTGMSubject".
mdhn:Photograph a rdfs:Class ;
rdfs:comment "A single photograph" ;
rdfs:label "Photograph".
mdhn:hasNarrower a rdfs:DatatypeProperty ;
rdfs:comment "The narrower subject based on LCTGM" ;
rdfs:label "hasNarrower" ;
rdfs:domain mdhn:LCTGMSubject ;
rdfs:range mdhn:LCTGMSubject .
mdhn:hasTGMSubject a rdfs:ObjectProperty ;
rdfs:comment "Associate a photograph to LCTGM Controlled Vocabularies" ;
rdfs:domain mdhn:Photograph ;
rdfs:label "hasTGMSubject" ;
rdfs:range mdhn:LCTGMSubject .
###########################################
# RDF Data
PREFIX mdhn: <http://example.com/mdhn/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
mdhn:tgm007721 a mdhn:LCTGMSubject ;
mdhn:hasNarrower mdhn:tgm000033,
mdhn:tgm000107,
mdhn:tgm000284,
mdhn:tgm000464,
mdhn:tgm002852,
mdhn:tgm005795,
mdhn:tgm007718,
mdhn:tgm008083,
mdhn:tgm012488,
mdhn:tgm012489 ;
mdhn:lctgmLabel "Photographs" ;
mdhn:lctgmURI "http://id.loc.gov/vocabulary/graphicMaterials/tgm007721" .
mdhn:tgm007718 a mdhn:LCTGMSubject ;
mdhn:hasNarrower mdhn:tgm001350,
mdhn:tgm001672,
mdhn:tgm003062,
mdhn:tgm003417,
mdhn:tgm004498,
mdhn:tgm004499,
mdhn:tgm007028,
mdhn:tgm007897,
mdhn:tgm009642,
mdhn:tgm010019 ;
mdhn:lctgmLabel "Photographic prints" ;
mdhn:lctgmURI "http://id.loc.gov/vocabulary/graphicMaterials/tgm007718" .
mdhn:tgm000033 a mdhn:LCTGMSubject ;
mdhn:lctgmLabel "Abstract photographs" ;
mdhn:lctgmURI "http://id.loc.gov/vocabulary/graphicMaterials/tgm000033" .
mdhn:tgm000284 a mdhn:LCTGMSubject ;
mdhn:lctgmLabel "Ambrotypes" ;
mdhn:lctgmURI "http://id.loc.gov/vocabulary/graphicMaterials/tgm000284" .
mdhn:tgm000107 a mdhn:LCTGMSubject ;
mdhn:lctgmLabel "Aerial photographs" ;
mdhn:lctgmURI "http://id.loc.gov/vocabulary/graphicMaterials/tgm000107" .
mdhn:tgm001672 a mdhn:LCTGMSubject ;
mdhn:lctgmLabel "Carbon prints" ;
mdhn:lctgmURI "http://id.loc.gov/vocabulary/graphicMaterials/tgm001672" .`Preformatted text`
Thanks. I'll take a look later when I have more time. But want to clarify a few things. I assume there is a good reason you are using RDF and not OWL? Also, when I saw the broader and narrower I assumed you were using the SKOS properties of that name. Perhaps you have imported the SKOS properties into the mdhn namespace? If not I would suggest you use the SKOS properties rather than create your own with the same name. The latter could be confusing and often various tools will look for those SKOS properties and treat them in a special way. Actually, I'm not that familiar with Stardog, haven't used it in a long while but it is just possible that might be the problem. I know at least one other tool similar to Stardog where if you use skos:broader and skos:narrower it will recognize it as a hierarchical relation. Will try and look in more detail later today. In case you need it here is the SKOS web site: SKOS Simple Knowledge Organization System - home page
Michael
Since I mostly work with OWL I'm not the best person to be helping you but I will do my best. So one thing I noticed is that the last triple in your data (the very last line):
mdhn:lctgmURI "http://id.loc.gov/vocabulary/graphicMaterials/tgm001672" .`Preformatted text
May have an error in it. There is a period (end of triple) followed by the literal 'Preformatted Text'.
I think your original question though was that the node labelled "Photographic" should have a narrower link to a node called tgm001350. Is that correct? So there should be a triple like: mdhn:tgm007718 :narrower mdhn:tgm001350
The problem may be that there is no definition for tgm001350. In general a couple of suggestions (btw, I realize it may be that you have local standards that over ride these): 1) I would use the skos properties for broader and narrower. Those will be much more portable. 2) Similarly I would use "rdfs:label" rather than your own custom label for the same reason. Hope that was somewhat helpful. Sorry I couldn't help more but I'm much more familiar with OWL.