RELS-INT is a good way to describe relations about properties (datastreams) of objects. This is discussed by Asger, et al. in a thread from mid-2009: http://www.mail-archive.com/fedora-commons-develop...@lists.sourceforge.net/msg00418.html
Below, I'll try to re-illustrate my intentions from the previous email with an example based on Asger's discussion. Again, take a repository where: A Person has at least one Name and each Name has a Type (which is one of an enumerated list of strings including "Primary Name", "Title", "Pen Name", etc..) and a Value (which is just a string, such as "Jane Doe"). We should be able to find people by the Value of their Primary Name, or by the Value of their Title. Preferably, we'd like to use a SPARQL Query on risearch, which as far as I understand, can't be configured to index datastreams other than DC, RELS-EXT, and RELS-INT. We should not create a separate fedora data object for each Name that a Person has, for two reasons: foremost, a Name is really just an internal property of a Person object, so it would be nice to encapsulate the properties inside the Person object directly; secondly, we have scalability concerns about creating a new object for each nontrivial property of an object. =========== <!-- Content Model Objects--> <!-- Person/ONTOLOGY --> <!-- Each Person should have at least one Name of type demo:Name--> <owl:Class rdf:about="info:fedora/demo:Person"> <rdfs:subClassOf> <owl:Restriction> <owl:onProperty rdf:resource="http://www.demo.org/#hasName"/> <owl:minCardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">1</owl:minCardinality> </owl:Restriction> </rdfs:subClassOf> <rdfs:subClassOf> <owl:Restriction> <owl:onProperty rdf:resource="http://www.demo.org/#hasName"/> <owl:allValuesFrom rdf:resource="info:fedora/demo:Name"/> </owl:Restriction> </rdfs:subClassOf> </owl:Class> <owl:ObjectProperty rdf:about="http://www.demo.org/#hasName"/> <!-- This part is a little shady. What I want to illustrate is that Name "objects" should have their relations described by an ontology, even though they will be datastreams and not actual fedora data objects. Is it valid to ascribe a ContentModel to a datastream? --> <!-- Name/ONTOLOGY --> <!-- Each Name has exactly a nameValue and a nameType relationship --> <owl:Class rdf:about="info:fedora/demo:Name"> <rdfs:subClassOf> <owl:Restriction> <owl:onProperty rdf:resource="http://www.demo.org/#nameValue"/> <owl:cardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">1</owl:cardinality> </owl:Restriction> </rdfs:subClassOf> <rdfs:subClassOf> <owl:Restriction> <owl:onProperty rdf:resource="http://www.demo.org/#nameType"/> <owl:cardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">1</owl:cardinality> </owl:Restriction> </rdfs:subClassOf> </owl:Class> <owl:DatatypeProperty rdf:about="http://www.demo.org/#nameValue"/> <!-- Does a technique currently exist to ascribe a schema to classes of datastreams (datastreams with a common contentModel)? How do I restrict the datatype of all #nameType relations to a specific xsd datatype? I don't think the schema can be specified in the Name/DS-Composite-Model datastream, as described in https://wiki.duraspace.org/display/FCREPO/DSCOMPOSITE-MODEL+and+Schemas because Name "objects" don't have datastreams. Name "objects" can't have datastreams because they are regular datastreams with a hasModel relationship expressed in their containing Data Object's RELS-INT. Is the way I declared the DatatypeProperty below, with a rdf:datatype, sufficient to restrict "http://www.demo.org/#nameType" relations to the "http://www.demo.org/XMLSchema#nameType" datatype? --> <owl:DatatypeProperty rdf:about="http://www.demo.org/#nameType" rdf:datatype="http://www.demo.org/XMLSchema#nameType"/> <!-- http://www.demo.org/XMLSchema#nameType --> <xsd:simpleType name="nameType"> <xsd:restriction base="xsd:string"> <xsd:enumeration value="primaryName"/> <xsd:enumeration value="title"/> <xsd:enumeration value="penName"/> <!-- ... --> </xsd:restriction> </xsd:simpleType> <!-- Data Objects --> <!-- PersonDataObject1/RELS-EXT --> <rdf:Description rdf:about="info:fedora/demo:PersonDataObject1"/> <fedora-system:hasModel rdf:resource="info:fedora/demo:Person"/> <demo-relations:hasName rdf:resource="info:fedora/demo:PersonDataObject1/NAME1"/> <demo-relations:hasName rdf:resource="info:fedora/demo:PersonDataObject1/NAME2"/> </rdf:Description> <!-- N.B.: the PersonDataObject#/NAME# datastreams intentionally have no actual content --> <!-- PersonDataObject1/NAME1 --> <!-- PersonDataObject1/NAME2 --> <!-- PersonDataObject1/RELS-INT --> <rdf:Description rdf:about="info:fedora/demo:PersonDataObject1/NAME1"/> <fedora-system:hasModel rdf:resource="info:fedora/demo:Name"/> <demo-relations:nameValue>John Doe</demo-relations:nameValue> <!-- Is this the correct way of indicating a datatype? --> <demo-relations:nameType rdf:datatype="http://www.demo.org/XMLSchema#nameType">Primary Name</demo-relations:nameType> </rdf:Description> <rdf:Description rdf:about="info:fedora/demo:PersonDataObject1/NAME2"/> <fedora-system:hasModel rdf:resource="info:fedora/demo:Name"/> <demo-relations:nameValue>John Doe</demo-relations:nameValue> <demo-relations:nameType rdf:datatype="http://www.demo.org/XMLSchema#nameType">Title</demo-relations:nameType> </rdf:Description> =========== Just to sum up my questions: Is it actually valid to ascribe a ContentModel to a datastream, through a hasModel relationship in a RELS-INT datastream, effectively creating classes of datastreams? Does a technique currently exist to ascribe a schema to classes of datastreams? Am I using DatatypeProperty correctly? Thanks again, Eugene Wolfson And repeating my question from the previous post (although I'm not sure how much of a point there is to it): Can we use a ComplexType / non-standarad ( http://www.w3.org/TR/xmlschema-0/#complexTfromSimpleT ) as the object of an RDF triple in a RELS-* datastream? Will we run into problems with Mulgara? On Tue, Nov 23, 2010 at 11:46 PM, Eugene Wolfson <evulfson+fed...@gmail.com> wrote: > The ECMs seem like a very powerful tool for expressing ontologies in > fedora, but I am still a bit > confused about how to use them. > How do we specify that a <owl:DatatypeProperty> in the ONTOLOGY > datastream has an XSD user-derived datatype that's > defined in an XSD schema in the manner described at > https://wiki.duraspace.org/display/FCREPO/DSCOMPOSITE-MODEL+and+Schemas > > > Here is an example of what I mean for a Content Model of a Person > <!-- PERSON/ONTOLOGY Datastream --> > <rdf:RDF > xmlns:owl="http://www.w3.org/2002/07/owl#" > xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" > xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"> > <owl:Class rdf:about="info:fedora/demo:Person#class"> > <rdfs:subClassOf> > <!-- At least one name --> > <owl:Restriction> > <owl:onProperty > > rdf:resource="http://demo.org/demo-relations/#name"/> > <owl:minCardinality > rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">1 > </owl:minCardinality> > </owl:Restriction> > ... > </owl:Class> > > <!-- Note the use rdf:datatype attribute. Is this how we actually > specify an xsd user-defined datatype for a datatype property? --> > <owl:DatatypeProperty > rdf:about="http://demo.org/demo-relations/#name" > > rdf:datatype="http://www.demo.org/XMLschema/person#Name"/> > ... > </rdf:RDF> > > <!-- PERSON/DS-COMPOSITE-MODEL --> > > <dsTypeModel ID="ONTOLOGY-SCHEMA"> > <form MIME="text/xml"/> > <extension name="SCHEMA"> > <reference type="datastream" value="ONTOLOGY_SCHEMA"/> > </extension> > </dsTypeModel> > > > > <!-- Person/ONTOLOGY_SCHEMA --> > <xsd:schema xmlns:per="http://www.demo.org/models/person#" > xmlns:c="http://www.demo.org/models/common#" > xmlns:xsd="http://www.w3.org/2001/XMLSchema" > targetNamespace="http://www.demo.org/models/person#" > elementFormDefault="qualified" > attributeFormDefault="unqualified"> > <xsd:import namespace="http://www.demo.org/models/common#" > schemaLocation="(URL of common.xsd > datastream)"/> > ... > <xsd:complexType id="Name" name="Name"> > <xsd:annotation> > <xsd:documentation>A person often has many different names > depending > on religious, > political, clan or social affiations. Cataloging name variants allows > properly defined biographical > entries according to customs.</xsd:documentation> > </xsd:annotation> > <xsd:simpleContent> > <xsd:extension base="xsd:string"> > ... > <xsd:attribute name="type" type="per:nameTypeAttr" > default="primaryName"/> > .... > </xsd:extension> > </xsd:simpleContent> > </xsd:complexType> > <xsd:simpleType name="nameTypeAttr"> > <xsd:restriction base="xsd:string"> > <xsd:enumeration value="primaryName"/> > <xsd:enumeration value="primaryTitle"/> > <xsd:enumeration value="personalName"/> > <xsd:enumeration value="title"/> > <xsd:enumeration value="familyName"/> > <xsd:enumeration value="firstOrdinationName"/> > <xsd:enumeration value="secretInitiatoryName"/> > <xsd:enumeration value="reversal"/> > <xsd:enumeration value="sanskrit"/> > <xsd:enumeration value="grammatical"/> > <xsd:enumeration value="variantOrthography"/> > <xsd:enumeration value="penName"/> > <xsd:enumeration value="gterStonTitle"/> > <xsd:enumeration value="chineseName"/> > <xsd:enumeration value="corporateName"/> > <xsd:enumeration value="bodhisattvaVowName"/> > <xsd:enumeration value="finalOrdinationName"/> > </xsd:restriction> > </xsd:simpleType> > > > There is also another complication: How would we specify the > attributes, such as nameTypeAttr in the > RELS-EXT of a data object? > > <!-- Person_Object_1/RELS-EXT --> > <rdf:Description rdf:about="info:fedora/demo:Person_Object_1"> > <fedora-model:hasModel rdf:resource="info:fedora/demo:Person"/> > <demo-relations:name xsd:type="primaryName">Some > Name</demo-relations:name> > <demo-relations:name xsd:type="title">Some Title</demo-relations:name> > <!-- The following relationship should be invalid --> > <demo-relations:name xsd:type="invalidType">Some > Value</demo-relations:name> > </rdf:Description> > > ===== > > I don't think the example above is correct, but I hope it illustrates > my thinking. > > My gut tells me there should be a straightforward way to use literals > with user-derived datatypes > for relations declared in the ONTOLOGY. Does anyone have any ideas or > suggestions? Looking through > the 3.4.1 source code and online documentation I couldn't find much on > using the ECMs with either > user-derived datatypes, or <owl:DatatypeProperty>. > > Thank you, > Eugene Wolfson > > P.S. > > You might find these starting references to be helpful: > http://www.w3.org/TR/2006/NOTE-swbp-xsch-datatypes-20060314/#sec-userDefined > http://www.w3.org/TR/owl-ref/#rdf-datatype > https://wiki.duraspace.org/display/FCREPO/DSCOMPOSITE-MODEL+and+Schemas > http://sourceforge.net/apps/mediawiki/ecm/index.php?title=Ontology_Language > and > https://wiki.duraspace.org/display/FCREPO/Ontologies > > P.P.S. > > The driving force behind my question is that I want to ask risearch > not only questions like: > > select $parent $person from <#ri> where { $person hasParent $parent . } > > but also questions like: > > select $parent $person from <#ri> where { $parent hasChild $person . > $person <demo-relations:name type="primaryName"> "Tenzin" . } > > or even: > > select $parent $person from <#ri> where { $parent hasChild $person . > $person <demo-relations:name> "Tenzin" . } > ------------------------------------------------------------------------------ Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! Tap into the largest installed PC base & get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev _______________________________________________ Fedora-commons-users mailing list Fedora-commons-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/fedora-commons-users