Hi Hans:
If you need use literals in your rdf store, you must use specific tags
for this purpose such as rdfs:label. In this way you keep the use of
your installation as a sparql endpoint with easy integration in the web
of data.
For instance you can add :
<rdfs:label> a member of the collection ABC_0123</rdfs:label> inside the
rdf:Description (don“t forget to add the :
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"> to the RELS-EXT
datastream.
The you can query (via sparql):
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
select ?sujeto ?predicado ?objeto ?label from <#ri>
where{
filter regex (?label, 'ABC_0123' , 'i').
?sujeto ?predicado ?objeto.
?sujeto <rdfs:label> ?label
}
Saludos
Luis Zorita
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Many of you will think of a broken record when you hear this, but I never
> tire of saying it. {grin}
>
> If your need is essentially to put a literal property on objects (whether
> that be a title or the name of a collection to which the object belongs)
> you'll likely get better efficiency using a full-text index (e.g. Lucene or
> Zebra or the like). RDF stores really show their strength when supporting
> structural queries (e.g. "do _these_ relationships exist between _these_
> Fedora-objects?").
>
> To your questions:
>
> Presumably by "Does that mean that all Fedora relations must be uris?" you
> mean "Does that mean that [the objects of] all Fedora relations must be
> uris?". The answer is no. Certainly you can use literals as objects. But the
> relationships in the Fedora ontology (from which you drew
> <isMemberOfCollection>) have specified semantics that aren't in your control.
> In the case of <isMemberOfCollection>, the semantics include the expectation
> that the object of this predicate is indeed a Fedora-object, not a literal.
> So you should be using your own predicate because <isMemberOfCollection>
> doesn't have the meaning you want.
>
> - ---
> A. Soroka
> Software & Systems Engineering :: Online Library Environment
> the University of Virginia Library
>
> On Sep 6, 2012, at 8:27 AM, Scholte, Hans wrote:
>
>> Hi Egbert,
>>
>> Thanks for the answer.
>> Does that mean that all Fedora relations must be uris?
>> And if I want a literal then I must make my own predicate?
>>
>> I solved it now with
>>
>> <collection xmlns="info:dpc/relations#">ABC_0123</collection>
>>
>>
>> And that works for me (I don't want my collections to be objects in the
>> repository (at least, not yet) ).
>>
>>
>> Regards, Hans
>>
>>
>>
>>
>> -----Original Message-----
>> From: Egbert Gramsbergen [mailto:[email protected]]
>> Sent: September 06, 2012 12:31
>> To: [email protected]
>> Subject: Re: [fcrepo-user] question sparql/rels-ext
>>
>> Hello Hans,
>>
>> First of all: the object of this relation should not be al literal but an
>> uri resource.
>> So this for collection with PID my:collection:
>>
>> <isMemberOfCollection
>> xmlns="info:fedora/fedora-system:def/relations-external#"
>> rdf:resource="info:fedora/my:collection"/>
>>
>> and your query will be:
>> prefix e: <info:fedora/fedora-system:def/relations-external#>
>> select ?s
>> where { ?s e:isMemberOfCollection <info:fedora/my:collection>}
>>
>> Second: if the object of a relation is a plain literal you should not use
>> rdf:parseType="literal" because that is for xml. Just omit it:
>> <someRelation xmlns="some:namespace/">ABC_0123</someRelation>
>>
>> I hope this helps (and don't forget the info:fedora/ part like I do about 10
>> times a day)
>>
>> Egbert Gramsbergen
>> -----Original Message-----
>> From: hans [mailto:[email protected]]
>> Sent: donderdag 6 september 2012 10:45
>> To: [email protected]
>> Subject: [fcrepo-user] question sparql/rels-ext
>>
>> Hi,
>>
>> I'm trying to add some relations in my rels-ext like so:
>>
>> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
>> <rdf:Description
>> rdf:about="info:fedora/unicum:uba.items.12903be24c35550edd1be17a7b3d9f12">
>> <isMemberOfCollection
>> xmlns="info:fedora/fedora-system:def/relations-external#"
>> rdf:parseType="literal">
>> ABC_0123
>> </isMemberOfCollection>
>> </rdf:Description>
>> </rdf:RDF>
>>
>> When querying the triplestore with
>>
>> prefix e: <info:fedora/fedora-system:def/relations-external#>
>> select ?s
>> where { ?s e:isMemberOfCollection 'ABC_0123'}
>>
>> I have no results
>>
>> Querying with
>>
>> prefix e: <info:fedora/fedora-system:def/relations-external#>
>> select ?s ?o
>> where { ?s e:isMemberOfCollection ?o}
>>
>> gives me:
>>
>> "s","o"
>> info:fedora/unicum:uba.items.12903be24c35550edd1be17a7b3d9f12,ABC_0123
>>
>> Why do i not have a result with the first query?
>>
>> Regards, Hans
>>
>>
>>
>> --
>> View this message in context:
>> http://fedora-commons.1317035.n2.nabble.com/question-sparql-rels-ext-tp7578332.html
>> Sent from the Fedora Commons Users mailing list archive at Nabble.com.
>>
>> ------------------------------------------------------------------------------
>> Live Security Virtual Conference
>> Exclusive live event will cover all the ways today's security and threat
>> landscape has changed and how IT managers can respond. Discussions will
>> include endpoint security, mobile security and the latest in malware
>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>> _______________________________________________
>> Fedora-commons-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/fedora-commons-users
>>
>> ------------------------------------------------------------------------------
>> Live Security Virtual Conference
>> Exclusive live event will cover all the ways today's security and threat
>> landscape has changed and how IT managers can respond. Discussions will
>> include endpoint security, mobile security and the latest in malware
>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>> _______________________________________________
>> Fedora-commons-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/fedora-commons-users
>>
>> ------------------------------------------------------------------------------
>> Live Security Virtual Conference
>> Exclusive live event will cover all the ways today's security and
>> threat landscape has changed and how IT managers can respond. Discussions
>> will include endpoint security, mobile security and the latest in malware
>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>> _______________________________________________
>> Fedora-commons-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/fedora-commons-users
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
> Comment: GPGTools - http://gpgtools.org
>
> iQEcBAEBAgAGBQJQSJmVAAoJEATpPYSyaoIky8MH/0yl+bfZu6gXQmPwxDJqEhA/
> /PssfOa1CxVnrtAJ6ozzvEsvWhXC1Z6C8jTcDR8NrfNWDONhMp8IZjDUUWH+5wLP
> 0zgKEoBn9PWxplsHMxk+PoGHYgSjcgRiitRglO3sSQeV1PyldQkuSqFx6ycqUISC
> 2iO1NlXX3FTMa3kMJ0WJfMM5SM+ospZoAr2MbJVTw5j3ZhRkujs1yR5uatcnI80B
> +I6ZVnx7j93nSmk0P9s0Nllss9yUR+NQIoNJUT6Q6fWibwqbLGceleaQDkIr1DLM
> 23P4Atvwj5GIkN9/an1WWvWzijlFRAlVb6v750VM1a4gepcfs0dBQKpnyK8CwjA=
> =/jdk
> -----END PGP SIGNATURE-----
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Fedora-commons-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/fedora-commons-users
>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Fedora-commons-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fedora-commons-users