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


C# Uri.ToSafeString方法代码示例

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


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

示例1: if

 /// <summary>
 /// Gets a Graph from the Dataset
 /// </summary>
 /// <param name="graphUri">Graph URI</param>
 /// <returns></returns>
 /// <remarks>
 /// If the Graph has been modified during the active Transaction the modified version is returned rather than the original version
 /// </remarks>
 public sealed override IGraph this[Uri graphUri]
 {
     get
     {
         if (graphUri == null || graphUri.ToSafeString().Equals(GraphCollection.DefaultGraphUri))
         {
             if (this.DefaultGraph != null)
             {
                 return this.DefaultGraph;
             }
             else if (this._modifiableGraphs.HasGraph(graphUri))
             {
                 return this._modifiableGraphs.Graph(graphUri);
             }
             else
             {
                 return this.GetGraphInternal(null);
             }
         }
         else if (this._modifiableGraphs.HasGraph(graphUri))
         {
             return this._modifiableGraphs.Graph(graphUri);
         }
         else
         {
             return this.GetGraphInternal(graphUri);
         }
     }
 }
开发者ID:jbunzel,项目名称:MvcRQ_git,代码行数:37,代码来源:BaseDataset.cs

示例2: GraphExists

 /// <summary>
 /// Sends a HEAD Command to the Protocol Server to determine whether a given Graph exists
 /// </summary>
 /// <param name="graphUri">URI of the Graph to check for</param>
 public virtual bool GraphExists(Uri graphUri)
 {
     return this.GraphExists(graphUri.ToSafeString());
 }
开发者ID:almostEric,项目名称:DotNetRDF-4.0,代码行数:8,代码来源:SparqlHttpProtocolConnector.cs

示例3: Load

        /// <summary>
        /// Loads a Graph from the SQL Store into a Graph object
        /// </summary>
        /// <param name="graphUri">Uri of the Graph to load</param>
        /// <returns></returns>
        public IGraph Load(Uri graphUri)
        {
            Graph g = new Graph();
            try
            {
                //Get the Database Connection
                this._manager.Open(true);

                //Retrieve the existing Graph ID if any
                if (!this._manager.Exists(graphUri))
                {
                    throw new RdfStorageException("The Graph '" + graphUri.ToSafeString() + "' does not exist in the underlying Store");
                }
                String graphID = this._manager.GetGraphID(graphUri);

                g.BaseUri = graphUri;

                //Load Namespaces
                this._manager.LoadNamespaces(g, graphID);

                //Load Triples
                this._manager.LoadTriples(g, graphID);

                this._manager.Close(true);
            }
            catch
            {
                this._manager.Close(true, true);
                throw;
            }
            return g;
        }
开发者ID:jbunzel,项目名称:MvcRQ_git,代码行数:37,代码来源:SQLReader.cs

示例4: RemoveGraph

 /// <summary>
 /// Removes a Graph from the Dataset
 /// </summary>
 /// <param name="graphUri">Graph URI</param>
 public override sealed void RemoveGraph(Uri graphUri)
 {
     if (graphUri == null || graphUri.ToSafeString().Equals(GraphCollection.DefaultGraphUri))
     {
         if (this.DefaultGraphUris.Any())
         {
             foreach (Uri u in this.DefaultGraphUris)
             {
                 if (this.IsDefaultGraph(u))
                 {
                     //Default Graph gets cleared
                     GraphPersistenceWrapper wrapper = new GraphPersistenceWrapper(this[u]);
                     wrapper.Clear();
                     this._actions.Add(new GraphPersistenceAction(wrapper, GraphPersistenceActionType.Modified));
                 }
                 else
                 {
                     //Other Graphs get actually deleted
                     this._actions.Add(new GraphPersistenceAction(this[u], GraphPersistenceActionType.Deleted));
                 }
             }
         }
         else if (this.HasGraph(graphUri))
         {
             this._actions.Add(new GraphPersistenceAction(this[graphUri], GraphPersistenceActionType.Deleted));
             this.RemoveGraphInternal(graphUri);
         }
     }
     else if (this.HasGraph(graphUri))
     {
         this._actions.Add(new GraphPersistenceAction(this[graphUri], GraphPersistenceActionType.Deleted));
         this.RemoveGraphInternal(graphUri);
     }
 }
开发者ID:jmahmud,项目名称:RDFer,代码行数:38,代码来源:BaseQuadDataset.cs

示例5: LoadGraph

 /// <summary>
 /// Loads a Graph from the Store
 /// </summary>
 /// <param name="handler">RDF Handler</param>
 /// <param name="graphUri">Uri of the Graph to load</param>
 /// <remarks>If a Null Uri is specified then the default graph (statements with no context in Sesame parlance) will be loaded</remarks>
 public virtual void LoadGraph(IRdfHandler handler, Uri graphUri)
 {
     this.LoadGraph(handler, graphUri.ToSafeString());
 }
开发者ID:jmahmud,项目名称:RDFer,代码行数:10,代码来源:SesameHTTPProtocolConnector.cs

示例6: AffectsGraph

 /// <summary>
 /// Gets whether this Command affects the given Graph
 /// </summary>
 /// <param name="graphUri">Graph URI</param>
 /// <returns></returns>
 public override bool AffectsGraph(Uri graphUri)
 {
     switch (this._mode)
     {
         case ClearMode.All:
             return true;
         case ClearMode.Default:
             return graphUri == null || graphUri.ToSafeString().Equals(GraphCollection.DefaultGraphUri);
         case ClearMode.Named:
             return graphUri != null && !graphUri.ToSafeString().Equals(GraphCollection.DefaultGraphUri);
         case ClearMode.Graph:
             if (this._graphUri == null)
             {
                 return graphUri == null || graphUri.ToSafeString().Equals(GraphCollection.DefaultGraphUri);
             }
             else
             {
                 return this._graphUri.ToString().Equals(graphUri.ToSafeString());
             }
         default:
             //No Other Clear Modes but have to keep the compiler happy
             return true;
     }
 }
开发者ID:jbunzel,项目名称:MvcRQ_git,代码行数:29,代码来源:ClearCommand.cs

示例7: FusekiConnector

 /// <summary>
 /// Creates a new connection to a Fuseki Server
 /// </summary>
 /// <param name="serviceUri">The /data URI of the Fuseki Server</param>
 public FusekiConnector(Uri serviceUri)
     : this(serviceUri.ToSafeString())
 {
 }
开发者ID:jmahmud,项目名称:RDFer,代码行数:8,代码来源:FusekiConnector.cs

示例8: DeleteGraph

 /// <summary>
 /// Deletes a Graph from the Sesame store
 /// </summary>
 /// <param name="graphUri">URI of the Graph to delete</param>
 public virtual void DeleteGraph(Uri graphUri)
 {
     this.DeleteGraph(graphUri.ToSafeString());
 }
开发者ID:jmahmud,项目名称:RDFer,代码行数:8,代码来源:SesameHTTPProtocolConnector.cs

示例9: IsValidPlainLiteral

 /// <summary>
 /// Determines whether a given String is a valid Plain Literal for the given Datatype
 /// </summary>
 /// <param name="value">Value</param>
 /// <param name="dt">Datatype</param>
 /// <param name="syntax">Turtle Syntax</param>
 /// <returns></returns>
 public static bool IsValidPlainLiteral(String value, Uri dt, TurtleSyntax syntax)
 {
     StringComparison comparison = (syntax == TurtleSyntax.Original ? StringComparison.Ordinal : StringComparison.OrdinalIgnoreCase);
     if ((value.Equals("true", comparison) || value.Equals("false", comparison)) && dt.ToSafeString().Equals(XmlSpecsHelper.XmlSchemaDataTypeBoolean))
     {
         return true;
     }
     else if (_validDecimal.IsMatch(value) && dt.ToSafeString().Equals(XmlSpecsHelper.XmlSchemaDataTypeDecimal))
     {
         return true;
     }
     else if (_validInteger.IsMatch(value) && dt.ToSafeString().Equals(XmlSpecsHelper.XmlSchemaDataTypeInteger))
     {
         return true;
     }
     else if (_validDouble.IsMatch(value) && dt.ToSafeString().Equals(XmlSpecsHelper.XmlSchemaDataTypeDouble))
     {
         return true;
     }
     else
     {
         return false;
     }
 }
开发者ID:jmahmud,项目名称:RDFer,代码行数:31,代码来源:TurtleSpecsHelper.cs

示例10: RemoveGraphInternal

 /// <summary>
 /// Removes a Graph from the Dataset
 /// </summary>
 /// <param name="graphUri">Graph URI</param>
 protected override void RemoveGraphInternal(Uri graphUri)
 {
     if (graphUri == null || graphUri.ToSafeString().Equals(GraphCollection.DefaultGraphUri))
     {
         if (this._store.HasGraph(null))
         {
             this._store.Graphs[null].Clear();
         }
     }
     else
     {
         this._store.Remove(graphUri);
     }
 }
开发者ID:jbunzel,项目名称:MvcRQ_git,代码行数:18,代码来源:InMemoryDataset.cs

示例11: Contains

 public override bool Contains(Uri graphUri)
 {
     if (base.Contains(graphUri))
     {
         return true;
     }
     else if (!this._removedGraphs.Contains(graphUri.ToSafeString()))
     {
         //Try and load the Graph and return true if anything is returned
         Graph g = new Graph();
         try
         {
             this._manager.LoadGraph(g, graphUri);
             if (g.Triples.Count > 0)
             {
                 //If we're going to return true we must also store the Graph in the collection
                 //for later use
                 g.BaseUri = graphUri;
                 this.Add(g, true);
                 return true;
             }
             else
             {
                 return false;
             }
         }
         catch
         {
             //If trying to load the Graph errors then it doesn't exist so return false
             return false;
         }
     }
     else
     {
         return false;
     }
 }
开发者ID:jbunzel,项目名称:MvcRQ_git,代码行数:37,代码来源:PersistentTripleStore.cs

示例12: Describe

 /// <summary>
 /// Gets the Graph describing the given resource from the Store
 /// </summary>
 /// <param name="handler">RDF Handler</param>
 /// <param name="resourceUri">URI of Resource to Describe</param>
 public void Describe(IRdfHandler handler, Uri resourceUri)
 {
     if (!resourceUri.Equals(String.Empty))
     {
         this.DescribeInternal(handler, resourceUri.ToSafeString(), "meta");
     }
 }
开发者ID:jmahmud,项目名称:RDFer,代码行数:12,代码来源:TalisPlatformConnector.cs

示例13: SparqlHttpProtocolConnector

 /// <summary>
 /// Creates a new SPARQL Graph Store HTTP Protocol Connector
 /// </summary>
 /// <param name="serviceUri">URI of the Protocol Server</param>
 /// <param name="proxy">Proxy Server</param>
 public SparqlHttpProtocolConnector(Uri serviceUri, WebProxy proxy)
     : this(serviceUri.ToSafeString(), proxy)
 {
 }
开发者ID:jmahmud,项目名称:RDFer,代码行数:9,代码来源:SparqlHttpProtocolConnector.cs

示例14: SparqlHttpProtocolConnector

 /// <summary>
 /// Creates a new SPARQL Graph Store HTTP Protocol Connector
 /// </summary>
 /// <param name="serviceUri">URI of the Protocol Server</param>
 public SparqlHttpProtocolConnector(Uri serviceUri)
     : this(serviceUri.ToSafeString()) { }
开发者ID:almostEric,项目名称:DotNetRDF-4.0,代码行数:6,代码来源:SparqlHttpProtocolConnector.cs

示例15: IsValidPlainLiteral

 /// <summary>
 /// Determines whether a given String is a valid Plain Literal for the given Datatype
 /// </summary>
 /// <param name="value">Value</param>
 /// <param name="dt">Datatype</param>
 /// <returns></returns>
 public static bool IsValidPlainLiteral(String value, Uri dt)
 {
     if ((value.Equals("true") || value.Equals("false")) && dt.ToSafeString().Equals(XmlSpecsHelper.XmlSchemaDataTypeBoolean))
     {
         return true;
     }
     else if (_validDecimal.IsMatch(value) && dt.ToSafeString().Equals(XmlSpecsHelper.XmlSchemaDataTypeDecimal))
     {
         return true;
     }
     else if (_validInteger.IsMatch(value) && dt.ToSafeString().Equals(XmlSpecsHelper.XmlSchemaDataTypeInteger))
     {
         return true;
     }
     else if (_validDouble.IsMatch(value) && dt.ToSafeString().Equals(XmlSpecsHelper.XmlSchemaDataTypeDouble))
     {
         return true;
     }
     else
     {
         return false;
     }
 }
开发者ID:jbunzel,项目名称:MvcRQ_git,代码行数:29,代码来源:TurtleSpecsHelper.cs


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