示例#1
0
 public override string ToSparqlString(SparqlConversion.SparqlSettings settings)
 {
     return(string.Format(System.Globalization.CultureInfo.InvariantCulture,
                          "BIND ({0} AS {1}).",
                          expression.ToSparqlString(settings),
                          variable.ToSparqlString(settings)));
 }
示例#2
0
        public virtual object Clone()
        {
            SparqlSettings result = new SparqlSettings();

            result.prefixingService = this.prefixingService;
            result.varPrefix        = this.varPrefix;
            return(result);
        }
示例#3
0
 public override string ToSparqlString(SparqlConversion.SparqlSettings settings)
 {
     return(string.Format(System.Globalization.CultureInfo.InvariantCulture,
                          "{0} {1} {2}.",
                          tripleSubject.ToSparqlString(settings),
                          triplePredicate.ToSparqlString(settings),
                          tripleObject.ToSparqlString(settings)));
 }
示例#4
0
        public override string ToSparqlString(SparqlConversion.SparqlSettings settings)
        {
            if (settings == null)
            {
                throw new ArgumentNullException("settings");
            }

            return(settings.FormatVarReference(settings.VarPrefix + id.ToString()));
        }
示例#5
0
        public override string ToSparqlString(SparqlConversion.SparqlSettings settings)
        {
            if (settings == null)
            {
                throw new ArgumentNullException("settings");
            }

            return(variable.ToSparqlString(settings));
        }
        public override string ToSparqlString(SparqlConversion.SparqlSettings settings)
        {
            if (settings == null)
            {
                throw new ArgumentNullException("settings");
            }

            return("_:" + settings.BlankNodePrefix + id.ToString());
        }
示例#7
0
 public abstract string ToSparqlString(SparqlConversion.SparqlSettings settings);
        public override string ToString()
        {
            var settings = new SparqlConversion.SparqlSettings();

            return(ToSparqlString(settings));
        }
示例#9
0
 public override string ToSparqlString(SparqlConversion.SparqlSettings settings)
 {
     return("[]");
 }
示例#10
0
        public static string ToSparqlString(this IIriPrefixingService prefixingService, SparqlSettings settings)
        {
            if (prefixingService == null)
            {
                throw new ArgumentNullException("prefixingService");
            }
            if (settings == null)
            {
                throw new ArgumentNullException("settings");
            }

            var prefixes          = prefixingService.KnownPrefixes.ToArray();
            int prefixColumnWidth = prefixes.Max(p => p.Prefix.Length) + 1;

            var result = new StringBuilder();

            foreach (var prefix in prefixes)
            {
                result.AppendFormat(System.Globalization.CultureInfo.InvariantCulture,
                                    "PREFIX {0}:{1}<{2}>\n",
                                    prefix.Prefix,
                                    new String(' ', prefixColumnWidth - prefix.Prefix.Length),
                                    prefix.Iri);
            }
            return(result.ToString());
        }