当前位置: 首页>>代码示例>>C#>>正文


C# Resource.ToString方法代码示例

本文整理汇总了C#中SemWeb.Resource.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Resource.ToString方法的具体用法?C# Resource.ToString怎么用?C# Resource.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SemWeb.Resource的用法示例。


在下文中一共展示了Resource.ToString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Contains

 /// <summary>
 /// Returns whether the Store contains Statements which contain the given Resource
 /// </summary>
 /// <param name="resource">Resource</param>
 /// <returns></returns>
 public bool Contains(Resource resource)
 {
     //Implemented as a SPARQL ASK
     String query = "ASK WHERE {{" + resource.ToString() + " ?p ?o} UNION {?s " + resource.ToString() + " ?o} UNION {?s ?p " + resource.ToString() + "}}";
     return this.ContainsInternal(query);
 }
开发者ID:almostEric,项目名称:DotNetRDF-4.0,代码行数:11,代码来源:NativeStoreSource.cs

示例2: FromSemWeb

 /// <summary>
 /// Helper method which converts a SemWeb resource into a PatternItem for use in a SPARQL Triple Pattern
 /// </summary>
 /// <param name="r">Resource</param>
 /// <param name="mapping">Mapping of Variables &amp; Blank Nodes to Pattern Items</param>
 /// <param name="g">Graph</param>
 /// <returns></returns>
 private PatternItem FromSemWeb(Resource r, IGraph g, Dictionary<String, PatternItem> mapping)
 {
     if (r is Variable)
     {
         if (mapping.ContainsKey(r.ToString()))
         {
             return mapping[r.ToString()];
         }
         else
         {
             PatternItem temp = new VariablePattern(r.ToString());
             mapping.Add(r.ToString(), temp);
             return temp;
         }
     }
     else if (r is BNode)
     {
         if (mapping.ContainsKey(r.ToString()))
         {
             return mapping[r.ToString()];
         }
         else
         {
             PatternItem temp = new BlankNodePattern(r.ToString().Substring(2));
             mapping.Add(r.ToString(), temp);
             return temp;
         }
     }
     else
     {
         return new NodeMatchPattern(SemWebConverter.FromSemWeb(r, this.GetMapping(g)));
     }
 }
开发者ID:almostEric,项目名称:DotNetRDF-4.0,代码行数:40,代码来源:StoreSource.cs

示例3: S

		string S(Resource r, string v) {
			if (r == null || r is Variable) {
				return v;
			} else if (r is Literal) {
				return r.ToString();
			} else if (r.Uri != null) {
				if (r.Uri.IndexOf('>') != -1)
					throw new ArgumentException("Invalid URI: " + r.Uri);
				return "<" + r.Uri + ">";
			} else {
				throw new NotSupportedException("Blank node in select not supported.");
			}
		}
开发者ID:CTSIatUCSF,项目名称:ProfilesRNS10x-OpenSocial,代码行数:13,代码来源:SparqlClient.cs


注:本文中的SemWeb.Resource.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。