2using System.Collections.Generic;
3using System.Runtime.ExceptionServices;
5using System.Threading.Tasks;
37 if (!Source.IsAbsoluteUri ||
40 return Grade.NotAtAll;
58 string XmlString =
null;
65 new KeyValuePair<string, string>(
"Accept",
"text/turtle, application/x-turtle, application/rdf+xml;q=0.9, application/ld+json;q=0.8, text/xml;q=0.2, " +
PlainTextCodec.
DefaultContentType +
";q=0.1"));
73 if (Result is XmlDocument Xml)
76 if (Result is
string s)
80 Xml =
new XmlDocument()
82 PreserveWhitespace =
true
85 Xml.LoadXml(XmlString = s);
94 catch (XmlException ex)
106 ExceptionDispatchInfo.Capture(ex).Throw();
113 StringBuilder sb =
new StringBuilder();
115 sb.Append(
"Graph not a semantic cube or semantic model: ");
116 sb.Append(Source.ToString());
117 sb.Append(
" Type of content returned: ");
118 sb.Append(Result?.GetType().FullName);
Static class managing encoding and decoding of internet content.
static Task< object > GetAsync(Uri Uri, params KeyValuePair< string, string >[] Headers)
Gets a resource, given its URI.
static bool CanGet(Uri Uri, out Grade Grade, out IContentGetter Getter)
If a resource can be gotten, given its URI.
static async Task< InMemorySemanticCube > Create(ISemanticModel Model)
Creates an in-memory semantic cube from a semantic model.
Contains semantic information stored in an RDF document.
Contains semantic information stored in a turtle document. https://www.w3.org/TR/rdf12-turtle/ https:...
Plain text encoder/decoder.
const string DefaultContentType
text/plain
Helps with common XML-related tasks.
static XmlException AnnotateException(XmlException ex)
Creates a new XML Exception object, with reference to the source XML file, for information.
static bool IsValidXml(string Xml)
Checks if a string is valid XML
Script runtime exception.
Base class for all nodes in a parsed script tree.
Graph source on the Internet.
async Task< ISemanticCube > LoadGraph(Uri Source, ScriptNode Node, bool NullIfNotFound, RequestOrigin Caller)
Loads the graph
Grade Supports(Uri Source)
How well a source with a given URI can be loaded by the class.
InternetContentSource()
Graph source on the Internet.
Tokens available in request.
Interface for semantic cubes.
Interface for semantic models.
Interface for graph sources.