示例#1
0
 /// <summary>Extract the value of an RDF data property by walking the predicate</summary>
 /// <typeparam name="T">The type to return the data in</typeparam>
 /// <param name="walker">The walker providing access to the current resource in the graph</param>
 /// <param name="predicate">The name of the predicate/edge to be navigated (as an RDF QName string)</param>
 /// <returns>The value of the target node, extracted and cast to type <see cref="T"/></returns>
 public static T DataProperty <T>(this Walker walker, string predicate)
 => (T)walker.DataProperty(predicate, typeof(T));
示例#2
0
 /// <summary>
 /// Walk a predicate to another resource node.
 /// </summary>
 /// <param name="walker">walker context providing navigation capabilities</param>
 /// <param name="predicate">name of the predicate to navigate (as a QName)</param>
 /// <returns>Another walker centred at the new node</returns>
 public static Walker ObjectProperty(this Walker walker, string predicate)
 => walker.Outgoing(predicate).FirstOrDefault();
示例#3
0
 /// <summary> Extracts the URI for the resource marked by the Walker <see cref="wc"/>. </summary>
 /// <param name="wc">The walker to extract the URI for.</param>
 /// <returns>A fully qualified URI for the resource identified by the Walker <see cref="wc"/>.</returns>
 public static Uri AsUri(this Walker wc)
 => AsUri(wc.CurrentResource);