3using System.Runtime.ExceptionServices;
4using System.Security.Cryptography.X509Certificates;
6using System.Threading.Tasks;
38 if (!Source.IsAbsoluteUri ||
42 return Grade.NotAtAll;
60 string XmlString =
null;
70 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"));
72 if (NullIfNotFound && Content.
HasError)
84 if (Result is XmlDocument Xml)
87 if (Result is
string s)
99 catch (XmlException ex)
111 ExceptionDispatchInfo.Capture(ex).Throw();
118 StringBuilder sb =
new StringBuilder();
120 sb.Append(
"Graph not a semantic cube or semantic model: ");
121 sb.Append(Source.ToString());
122 sb.Append(
" Type of content returned: ");
123 sb.Append(Result?.GetType().FullName);
Contains information about a response to a content request.
bool HasError
If an error occurred.
object Decoded
Decoded object.
void AssertOk()
Asserts response is OK.
Static class managing encoding and decoding of internet content.
static bool CanGet(Uri Uri, out Grade Grade, out IContentGetter Getter)
If a resource can be gotten, given its URI.
static Task< ContentResponse > GetAsync(Uri Uri, params KeyValuePair< string, string >[] Headers)
Gets a resource, 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 XmlDocument ParseXml(string Xml)
Parses an XML Document from its string representation.
static bool IsValidXml(string Xml)
Checks if a string is valid XML
Static class that dynamically manages types and interfaces available in the runtime environment.
static bool TryGetModuleParameter(string Name, out object Value)
Tries to get a module parameter value.
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.
Graph source on the local machine.
static bool IsLocal(Uri Source)
Checks if an URI corresponds to a local file name resource.
Tokens available in request.
Interface for semantic cubes.
Interface for semantic models.
Interface for graph sources.