示例#1
0
        private String getPrefix(Uri ns, ISparqlPrinter context)
        {
            String prefix = getSource().Graph.NamespaceMap.GetPrefix(ns);

            if (prefix == null && context.getUseExtraPrefixes())
            {
                INamespaceMapper extras = ExtraPrefixes.getExtraPrefixes();
                foreach (String extraPrefix in extras.Prefixes)
                {
                    Uri extraNs = extras.GetNamespaceUri(extraPrefix);
                    if (RDFUtil.sameTerm(ns, extraNs))
                    {
                        return(extraPrefix);
                    }
                }
            }
            return(prefix);
        }