Re: [Tracker] nfo:Image identifier

On Tue, 2010-09-21 at 15:55 +0200, MichaÅ Frynas wrote:
I have following problem. I'm developing a new ontology handling
profile data. One of the attributes the profile contains is its icon.
I'm trying to reuse some parts of existing Nepomuk ontologies, and
that's why I'd like to utilize one of nfo:Icon or nfo:Image classes.
I've written following description:

mpo:hasIcon a rdf:Property ;
    rdfs:label "hasIcon" ;
    rdfs:comment "Reference to the icon assocciated with current
profile" ;
    nrl:maxCardinality 1 ;
    rdfs:domain mpo:Profile ;
    rdfs:range nfo:Image .

After uploading my ontology, I import a ttl file having following

<MyCar> a mpo:Profile ;
        mpo:name "Car" ;
        mpo:hasIcon "urn:uuid:981e3c86-b0be-e38c-f224-cc2dce8810c5" ;
        mpo:xpos 10 ;
        mpo:ypos 12 .

Because the rdfs:range of your mpo:hasIcon is a resource (nfo:Image) you
must use <urn> instead of "urn" like what your TTL snippet has atm.

You can also use [] for anonymous blank node. For example:

<MyCar> a mpo:Profile ;
        mpo:name "Car" ;
        mpo:hasIcon [ a nfo:Image ; nie:title 'Icon for Car'; etc ] ;
        mpo:xpos 10 ;
        mpo:ypos 12 .

But if you want to set <MyCar>'s icon to a resource that exists already
in the RDF store, for example because tracker-miner-fs has made a
resource for it (because it's a file), then you can do something like
this with a SPARQL INSERT query:

INSERT { <MyCar> a mpo:Profile ;
                 mpo:name "Car" ;
                 mpo:hasIcon ?icon ;
                 mpo:xpos 10 ;
                 mpo:ypos 12 . }
         ?icon nie:url 'file:///usr/share/pixmaps/caricon.png'

where mpo:hasIcon is the Image Id i've received using that query:
select ?s { ?s a nfo:Image .}

And now, when I try to get my data using following query, I get
nothing: select ?s ?t { ?s a mpo:Profile; mpo:hasIcon ?t . }
Maybe someone knows what is wrong with it. 

Use <urn> instead of "urn", but you of course need to create the
nfo:Image first unless you use anonymous blank nodes as I explained

Is that ID urn:uuid:981e3c86-b0be-e38c-f224-cc2dce8810c5 a correct ID
of nfo:Image?

We can't know, your sample isn't complete. But it looks like the subject
created for an anonymous blank node. For example a file on the FS.




Philip Van Hoof
freelance software developer
Codeminded BVBA -

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]