Ejemplo n.º 1
0
        /// <summary>
        /// Implementation of the visit function to generate some output, used in the visitor pattern
        /// </summary>
        /// <param name="node">The actual node which needs to be generated</param>
        /// <param name="parent">The parent object of the node</param>
        public override void Visit(OwlProperty node, Object parent)
        {
            XmlElement parentElement = parent as XmlElement;

            if (parentElement != null)
            {
                XmlComment comment = _owlDocument.CreateComment("Visiting a property: " + node.ID);
                parentElement.AppendChild(comment);
                // Nothing is done when a regular property has been reached
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Adds an OWL Resource of type owl:FunctionalProperty to the graph</summary>
 /// <param name="nodeUri">The Uri of the resource.</param>
 /// <returns>Returns a reference to the newly added resource.</returns>
 /// <exception cref="UriFormatException">The specified nodeUri is not a well formed Uri.</exception>
 private OwlProperty AddFunctionalPropertyToGraph(string nodeUri)
 {
     //if the uri is null then create a blank node uri
     if(nodeUri == null)
         nodeUri = GetBlankNodeUri(null);
     OwlNode node = (OwlNode)_owlGraph[nodeUri];
     if((node != null) && (node is OwlProperty))
         return (OwlProperty)node;
     OwlNode typeNode = (OwlNode)_owlGraph.AddNode(OwlNamespaceCollection.OwlNamespace+"FunctionalProperty");
     if(node == null)
     {
         node = new OwlProperty(nodeUri,typeNode);
         _owlGraph.AddEdge(((OwlProperty)node).Type);
         _owlGraph.AddNode(node);
         return (OwlProperty)node;
     }
     OwlProperty newNode = new OwlProperty(nodeUri,typeNode);
     _owlGraph.AddEdge(newNode.Type);
     MoveEdges(node, newNode);
     _owlGraph.Nodes.Remove(node);
     _owlGraph.AddNode(newNode);
     return newNode;
 }
 /// <summary>
 /// Implementation of the visit function to generate some output, used in the visitor pattern
 /// </summary>
 /// <param name="node">The actual node which needs to be generated</param>
 /// <param name="parent">The parent object of the node</param>
 public override void Visit(OwlProperty node, Object parent)
 {
     XmlElement parentElement = parent as XmlElement;
     if(parentElement != null)
     {
         XmlComment comment = _owlDocument.CreateComment("Visiting a property: " + node.ID);
         parentElement.AppendChild(comment);
         // Nothing is done when a regular property has been reached
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Implementation of the visit function to generate some output, used in the visitor pattern
 /// </summary>
 /// <param name="node">The actual node which needs to be generated</param>
 /// <param name="parent">The parent object of the node</param>
 public abstract void Visit(OwlProperty node, Object parent);
Ejemplo n.º 5
0
 /// <summary>
 /// Implementation of the visit function to generate some output, used in the visitor pattern
 /// </summary>
 /// <param name="node">The actual node which needs to be generated</param>
 /// <param name="parent">The parent object of the node</param>
 public abstract void Visit(OwlProperty node, Object parent);