本文整理汇总了C#中Resource.getURI方法的典型用法代码示例。如果您正苦于以下问题:C# Resource.getURI方法的具体用法?C# Resource.getURI怎么用?C# Resource.getURI使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Resource
的用法示例。
在下文中一共展示了Resource.getURI方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: encodeResource
static XmlElement encodeResource(XmlDocument doc, Resource resource)
{
XmlElement e = null;
if (resource && resource.getResourceType() != FeatureLayerResource.getStaticResourceType())
{
e = doc.CreateElement("", "resource", "");
e.SetAttribute("type", resource.getResourceType());
e.SetAttribute("name", resource.getName());
string tags;
foreach (string it in resource.getTags())
{
tags += it + " ";
}
if (!string.IsNullOrEmpty(tags))
e.SetAttribute("tags", tags);
e.AppendChild(encodeURI(doc, resource.getURI()));
foreach (Property it in resource.getProperties())
{
e.AppendChild(encodeProperty(doc, it));
}
if (resource.getResourceType() == SRSResource.getStaticResourceType())
{
SRSResource srs = (SRSResource)resource;
e.AppendChild(doc.CreateTextNode(srs.getSRS().getWKT()));
}
}
return e;
}
示例2: FromJenaResource
public static INode FromJenaResource(Resource r, JenaMapping mapping)
{
if (r.isAnon())
{
if (mapping.InputMapping.ContainsKey(r))
{
return mapping.InputMapping[r];
}
else
{
INode bnode = mapping.Graph.CreateBlankNode(r.getId().getLabelString());
mapping.InputMapping.Add(r, bnode);
if (!mapping.OutputMapping.ContainsKey(bnode))
{
mapping.OutputMapping.Add(bnode, r);
}
return bnode;
}
}
else if (r.isURIResource())
{
return mapping.Graph.CreateUriNode(new Uri(r.getURI()));
}
else
{
throw new RdfException("Unable to convert from an unknown Jena Resource type to a dotNetRDF Node");
}
}