The 1041 branch should now use a separate error message for the case of allValuesFrom to an non-exisiting object. Unit tests have verified this. Please try it out.

Regards

On 12/15/2011 10:21 PM, Stephen Bayliss wrote:
Message

Hi Asger

 

I’ve verified this, the 404 error has gone away.

 

It would be useful if there was any way to distinguish between the non-existence of the target object vs the target object not having the specified type – is this at all possible?

 

Thanks

Steve

 


From: Stephen Bayliss [mailto:stephen.bayliss@acuityunlimited.net]
Sent: Tuesday, December 13, 2011 7:30 PM
To: 'Support and info exchange list for Fedora users.'
Subject: Re: [fcrepo-user] Enhanced content models - validating typeof relationship target gives 404 if target does not exist

 

Hi Asger - thanks for this.  Probably I won't get chance until early next week to test it, but I do want to test it in any case.

 

Regards

Steve

-----Original Message-----
From: Asger Askov Blekinge [mailto:abr@statsbiblioteket.dk]
Sent: 13 December 2011 15:52
To: fedora-commons-users@lists.sourceforge.net
Subject: Re: [fcrepo-user] Enhanced content models - validating type of relationship target gives 404 if target does not exist

This branch should fix the problem
https://github.com/fcrepo/fcrepo/tree/fcrepo-1041

Steve, can you test it easily? Otherwise, I will do it.

Regards

On 12/13/2011 04:11 PM, Stephen Bayliss wrote:

https://jira.duraspace.org/browse/FCREPO-1041 raised for this.

 

-----Original Message-----
From: Stephen Bayliss [mailto:stephen.bayliss@acuityunlimited.net]
Sent: 13 December 2011 14:58
To: 'Support and info exchange list for Fedora users.'
Subject: Re: [fcrepo-user] Enhanced content models - validating typeof relationship target gives 404 if target does not exist

Thanks Asger - it returns plain text of the missing object (but this was from a browser, haven't tried requesting content type of text/xml).  I'll raise a JIRA for this.

 

Cheers

Steve

-----Original Message-----
From: Asger Askov Blekinge [mailto:abr@statsbiblioteket.dk]
Sent: 13 December 2011 14:25
To: fedora-commons-users@lists.sourceforge.net
Subject: Re: [fcrepo-user] Enhanced content models - validating type of relationship target gives 404 if target does not exist

That sounds like a bug.

Remember, the 404 message can still contain an xml error. So, does it return an empty page, or the xml? Using the http return codes might not be in error.

Should validate returon 2xx when the validation fails?

Regards


On 12/13/2011 01:51 PM, Stephen Bayliss wrote:

In the ONTOLOGY datastream of a content model object, one can specify

- the cardinality of a relationship

- the type (ie type from hasModel relationship) of the target

 

I am finding that if the target object does not exist, then the validate method is reporting a 404 error.  That's the same error as one would get if one tried to validate an object that didn't exist; so it would instead be useful to give the XML error to distinguish between these two cases.

 

So, if I have the relationship in test:1's RELS-EXT as follows:

 

And then in the CModel CModel-1 I define

 

 

    <rdfs:subClassOf>
      <owl:Restriction>
        <owl:onProperty rdf:resource="info:fedora/fedora-system:def/relations-external#isMemberOf"/>
        <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="info:fedora/fedora-system:def/relations-external#isMemberOf"/>
        <owl:allValuesFrom rdf:resource="info:fedora/test:CModel-collection#class"/>
      </owl:Restriction>
    </rdfs:subClassOf>

 

Then if the object test:collection does not exist, on validating test:1 I get a 404 error because it does not exist.

 

Does this sound like a bug?

 

Steve