I was looking into this again... I see that RDFParserRegistry already
has the required collections langTriples and langQuads.
I think simply adding accessors for them would solve my use case.
Something like this maybe?
public static Set registeredLangTriples()
{
return Collections.unmodifiableSet(langTriples);
}
public static Set registeredLangQuads()
{
return Collections.unmodifiableSet(langQuads);
}
I don't see a similar collection under ResultSetReaderRegistry though?
On Mon, May 23, 2022 at 6:04 PM Andy Seaborne wrote:
>
> PRs welcome.
>
> On 23/05/2022 08:51, Martynas Jusevičius wrote:
> > Could RDFParserRegistry::getRegistered and
> > ResultSetReaderRegistry::getRegistered be added?
>
> Consistent naming would be registered().
>
> Andy
>
> > On Fri, May 20, 2022 at 9:01 PM Andy Seaborne wrote:
> >>
> >>
> >>
> >> On 20/05/2022 14:05, Martynas Jusevičius wrote:
> >>> Andy, is that correct?
> >>
> >> Yes
> >>
> >> Andy
> >>
> >>>
> >>> On Tue, May 17, 2022 at 1:33 PM Martynas Jusevičius
> >>> wrote:
>
> On Tue, May 17, 2022 at 1:19 PM Andy Seaborne wrote:
> >
> > RDFLanguages is a general registry of names (Lang's) in the system.
> >
> > It is not for functionality.
> >
> > RDFParserRegistry
> > RDFWriterRegistry
> > RowSetReaderRegistry, ResultSetReaderRegistry
> > RowSetWriterRegistry, ResultSetWriterRegistry
> > StreamRDFWriter
> >
> > A Lang needs looking up in a registry to see if there is support for it.
>
> Thanks, I didn't know these existed.
>
> But there are no RDFParserRegistry::getRegistered or
> ResultSetReaderRegistry::getRegistered methods?
>
> So do I still need to iterate RDFLanguages::getRegistered and check
> each Lang against
> RDFParserRegistry::isRegistered/ResultSetReaderRegistry::isRegistered?
>
> >
> >Andy
> >
> > On 17/05/2022 09:54, Martynas Jusevičius wrote:
> >> Hi,
> >>
> >> After upgrading from 4.3.2 to 4.5.0, some of our RDF writing code
> >> started failing.
> >>
> >> It seems that this is due to RDFLanguages.isTriples(Lang.SHACLC)
> >> returning true, which messes up our content negotiation as it attempts
> >> to write Models as SHACLC. Can this be rectified?
> >>
> >> The RDFLanguages registry is a bit of an oxymoron in general. Right
> >> now it's a bag of all sorts of syntaxes Jena supports, half of which
> >> are not even "RDF languages". We need to iterate and filter the
> >> languages just to know which ones can be used to read/write Models,
> >> which can be used for ResultSets etc.:
> >> https://github.com/AtomGraph/Core/blob/master/src/main/java/com/atomgraph/core/MediaTypes.java#L86
> >> Wouldn't it make sense to have separate registries depending on the
> >> entity types they apply to?
> >>
> >> Thanks.
> >>
> >> Martynas