Yes Steve, you are correct. That is where the problem is. I haven't tried your method, but I just modified the Muradora code to not look for the prefix. Although, I'm sure your method may be the better solution
Either way, I would have to modify Muradora's code and reindex Solr. Thanks! Vincent Vu Nguyen Web Applications Developer Division of Science Quality and Translation Office of the Associate Director for Science Centers for Disease Control and Prevention (CDC) 404-498-6154 v...@cdc.gov Century Bldg 2400 Atlanta, GA 30329 -----Original Message----- From: Steve Bayliss [mailto:stephen.bayl...@acuityunlimited.net] Sent: Thursday, February 03, 2011 2:59 AM To: 'Support and info exchange list for Fedora users.' Subject: Re: [fcrepo-user] addRelationship API affects existing namespace Hi Vincent It looks like it is the processing of the XML that is at fault - semantically the XML (and also the RDF) is the same whatever the namespace prefix. Presumably you are using a variant of the indexing stylesheet at http://www.muradora.org/muradora/attachment/wiki/InstallMuradoraSolr/dem oFox mlToSolr.xslt, which is a variant of the standard GSearch indexing stylesheet? This is mapping relationship predicates to SOLR names based on the namespace prefix, which means the indexing will break if the exact namespace prefix isn't used in the XML. The offending code is: ----- <xsl:for-each select="foxml:datastream[@ID='RELS-EXT']/foxml:datastreamVersion[last()] /fox ml:xmlContent/rdf:RDF/rdf:Description/*"> <field > <xsl:attribute name="name"> <xsl:value-of select="concat('rdf.', translate(name(), ':', '.'))"/> </xsl:attribute> <xsl:value-of select="substring-after(@rdf:resource, 'info:fedora/')"/> <xsl:value-of select="text()"/> </field> </xsl:for-each> ----- Specifically it is the expression: concat('rdf.', translate(name(), ':', '.')) This is building the Solr name from the namespace-prefix:node-name To use specific values in Solr field names for specific namespaces, you could try something like: ----- <xsl:for-each select="foxml:datastream[@ID='RELS-EXT']/foxml:datastreamVersion[last()] /fox ml:xmlContent/rdf:RDF/rdf:Description/*"> <field > <!-- map predicate namespaces to a prefix for the field name --> <xsl:variable name="relNamePrefix"> <xsl:choose> <!-- Fedora relationships namespace -> rels --> <xsl:when test="namespace-uri='info:fedora/fedora-system:def/relations-external#'" > <xsl:text>rels</xsl:text> </xsl:when> <!-- Fedora model namespace -> fedora-model --> <xsl:when test="namespace-uri='info:fedora/fedora-system:def/model#'"> <xsl:text>fedora-model</xsl:text> </xsl:when> <!-- add more tests as needed here ... --> <!-- un-mapped namespaces -> other --> <xsl:otherwise> <xsl:text>other</xsl:text> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:attribute name="name"> <xsl:value-of select="concat('rdf.', $relNamePrefix, local-name())"/> </xsl:attribute> <xsl:value-of select="substring-after(@rdf:resource, 'info:fedora/')"/> <xsl:value-of select="text()"/> </field> </xsl:for-each> ----- NB I haven't actually tested this... so it might need some tweaking; but hopefully you can see the principle - generate Solr field names based on the actual namespace, not the namespace prefix. Regards Steve > -----Original Message----- > From: Nguyen, Vincent (CDC/OD/OADS) (CTR) [mailto:v...@cdc.gov] > Sent: 02 February 2011 19:38 > To: Support and info exchange list for Fedora users. > Subject: Re: [fcrepo-user] addRelationship API affects > existing namespace > > > I suppose so. The front end application we use (Muradora) > uses Gsearch > queries like this to pull back Collections: > "-fgs.state:Inactive AND rdf.rel.isCollection:true" > > Therefore the code no longer works once the namespace prefixes are no > longer there. > > I guess we'll have to either modify our query or modify our index. > > Vincent Vu Nguyen > > -----Original Message----- > From: Benjamin Armintor [mailto:armin...@gmail.com] > Sent: Wednesday, February 02, 2011 2:17 PM > To: Support and info exchange list for Fedora users. > Subject: Re: [fcrepo-user] addRelationship API affects existing > namespace > > It hasn't affected the namespaces, it's just moved their declarations > around, right? I think the addRelationship api presumes that you are > interested in the triples more than their serialization into XML. > > On 2/2/11, Nguyen, Vincent (CDC/OD/OADS) (CTR) <v...@cdc.gov> wrote: > > When I use the addRelationship method, it affects previous > namespaces > in > > my RDF description. > > > > > > > > My RDF description starts out looking like this > > > > <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" > > xmlns:rel="info:fedora/fedora-system:def/relations-external#"> > > > > <rdf:Description rdf:about="info:fedora/demo:123"> > > > > <rel:isCollection>true</rel:isCollection> > > > > </rdf:Description> > > > > </rdf:RDF> > > > > > > > > After I call this method > > > > apim.addRelationship("demo:123", > > "info:fedora/fedora-system:def/model#hasModel", > > "info:fedora/cmodel:allObjects", false, null); > > > > > > > > it becomes this: > > > > <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> > > > > <rdf:Description rdf:about="info:fedora/demo:123"> > > > > <isCollection > > > xmlns="info:fedora/fedora-system:def/relations-external#">true > </isCollec > > tion> > > > > <hasModel rdf:resource="info:fedora/cmodel:allObjects" > > xmlns="info:fedora/fedora-system:def/model#"/> > > > > </rdf:Description> > > > > </rdf:RDF> > > > > > > > > > > > > Any ideas? > > > > > > > > > > > > Vincent Vu Nguyen > > > > > > > > > > > > > > -------------------------------------------------------------- > ---------- > ------ > Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! > Finally, a world-class log management solution at an even better > price-free! > Download using promo code Free_Logger_4_Dev2Dev. Offer expires > February 28th, so secure your free ArcSight Logger TODAY! > http://p.sf.net/sfu/arcsight-sfd2d > _______________________________________________ > Fedora-commons-users mailing list > Fedora-commons-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/fedora-commons-users > > > -------------------------------------------------------------- > ---------------- > Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! > Finally, a world-class log management solution at an even > better price-free! > Download using promo code Free_Logger_4_Dev2Dev. Offer expires > February 28th, so secure your free ArcSight Logger TODAY! > http://p.sf.net/sfu/arcsight-sfd2d > _______________________________________________ > Fedora-commons-users mailing list > Fedora-commons-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/fedora-commons-users > ------------------------------------------------------------------------ ------ Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsight-sfd2d _______________________________________________ Fedora-commons-users mailing list Fedora-commons-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/fedora-commons-users ------------------------------------------------------------------------------ Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsight-sfd2d _______________________________________________ Fedora-commons-users mailing list Fedora-commons-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/fedora-commons-users