Builds the graph
Inheritance: MonoBehaviour
Exemplo n.º 1
0
 /// <summary>
 /// Create an empty property graph with a random graph identification.
 /// </summary>
 /// <param name="GraphInitializer">An optional graph initializer.</param>
 public static IGenericPropertyGraph<UInt64, Int64, String, String, Object, UInt64, Int64, String, String, Object, UInt64, Int64, String, String, Object, UInt64, Int64, String, String, Object> CreateGraph(GraphInitializer<UInt64, Int64, String, String, Object,
                                  UInt64, Int64, String, String, Object,
                                  UInt64, Int64, String, String, Object,
                                  UInt64, Int64, String, String, Object> GraphInitializer = null,
                 Func<IVote<Boolean>> VoteCreator = null)
 {
     return GraphFactory.CreateGenericPropertyGraph(Convert.ToUInt64(new Random().Next()), GraphInitializer: GraphInitializer);
 }
Exemplo n.º 2
0
 /// <summary>
 /// Create a new property graph.
 /// </summary>
 /// <param name="GraphId">The graph identification.</param>
 /// <param name="Description">The optional description of the graph.</param>
 /// <param name="GraphInitializer">The optional graph initializer.</param>
 public static IPropertyGraph CreatePropertyGraph(UInt64 GraphId,
                                                  String Description = null,
                                                  GraphInitializer<UInt64, Int64, String, String, Object,
                                                                   UInt64, Int64, String, String, Object,
                                                                   UInt64, Int64, String, String, Object,
                                                                   UInt64, Int64, String, String, Object> GraphInitializer = null)
 {
     return new PropertyGraph(GraphId, GraphInitializer) {  } as IPropertyGraph;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Create an empty property graph with a random graph identification
 /// the given description and identification.
 /// </summary>
 /// <param name="GraphId">A graph identification.</param>
 /// <param name="Description">A description for this graph.</param>
 /// <param name="VoteCreator">An optional delegate to create a new vote.</param>
 /// <param name="GraphInitializer">An optional graph initializer.</param>
 public static IGenericPropertyGraph<UInt64, Int64, String, String, Object, UInt64, Int64, String, String, Object, UInt64, Int64, String, String, Object, UInt64, Int64, String, String, Object> CreateGraph(UInt64               GraphId,
                 String               Description  = null,
                 GraphInitializer<UInt64, Int64, String, String, Object,
                                  UInt64, Int64, String, String, Object,
                                  UInt64, Int64, String, String, Object,
                                  UInt64, Int64, String, String, Object> GraphInitializer = null,
                 Func<IVote<Boolean>> VoteCreator  = null)
 {
     return GraphFactory.CreateGenericPropertyGraph(GraphId, Description, VoteCreator, GraphInitializer);
 }
 /// <summary>
 /// Create a new GraphDevroom property graph.
 /// </summary>
 /// <param name="GraphId">The optional graph identification. If no value is given, a unique GraphId will be generated.</param>
 /// <param name="Description">The optional description of the graph.</param>
 /// <param name="GraphInitializer">The optional graph initializer.</param>
 public static IGenericPropertyGraph<UInt64, Int64, GDVertexLabel, String, Object, UInt64, Int64, GDEdgeLabel, String, Object, UInt64, Int64, GDMultiEdgeLabel, String, Object, UInt64, Int64, GDHyperEdgeLabel, String, Object> Create(UInt64                                                             GraphId,
            String                                                             Description,
            GraphInitializer<UInt64, Int64, GDVertexLabel,    String, Object,
                             UInt64, Int64, GDEdgeLabel,      String, Object,
                             UInt64, Int64, GDMultiEdgeLabel, String, Object,
                             UInt64, Int64, GDHyperEdgeLabel, String, Object>  GraphInitializer = null)
 {
     return GraphFactory.CreateLabeledPropertyGraph<GDVertexLabel,
                                                    GDEdgeLabel,
                                                    GDMultiEdgeLabel,
                                                    GDHyperEdgeLabel>(
                                                        GraphId,
                                                        Description,
                                                        GDVertexLabel.   DEFAULT,
                                                        GDEdgeLabel.     DEFAULT,
                                                        GDMultiEdgeLabel.DEFAULT,
                                                        GDHyperEdgeLabel.DEFAULT,
                                                        GraphInitializer);
 }
Exemplo n.º 5
0
 /// <summary>
 /// Creates a new class-based in-memory implementation of a property graph.
 /// </summary>
 /// <param name="GraphInitializer">A delegate to initialize the new property graph.</param>
 public PropertyGraph(GraphInitializer<UInt64, Int64, String, String, Object,
                                       UInt64, Int64, String, String, Object,
                                       UInt64, Int64, String, String, Object,
                                       UInt64, Int64, String, String, Object> GraphInitializer)
     : this(PropertyGraph.NewVertexId, GraphInitializer)
 { }
Exemplo n.º 6
0
        /// <summary>
        /// Creates a new class-based in-memory implementation of a property graph.
        /// </summary>
        /// <param name="GraphId">A unique identification for this graph (which is also a vertex!).</param>
        /// <param name="GraphInitializer">A delegate to initialize the new property graph.</param>
        public PropertyGraph(UInt64 GraphId,
                             GraphInitializer<UInt64, Int64, String, String, Object,
                                              UInt64, Int64, String, String, Object,
                                              UInt64, Int64, String, String, Object,
                                              UInt64, Int64, String, String, Object> GraphInitializer = null)

            : base (GraphId,

                    #region Vertices

                    // Property keys
                    GraphDBOntology.Id().Suffix,
                    GraphDBOntology.RevId().Suffix,
                    GraphDBOntology.Description().Suffix,
                    () => new Dictionary<String, Object>(),
                    
                    // Create a new vertex identification
                    (graph) => PropertyGraph.NewVertexId,

                    // Create a new vertex
                    (Graph, _VertexId, VertexInitializer) =>
                        new PropertyVertex
                            (Graph as IPropertyGraph,
                             _VertexId,
                             GraphDBOntology.Id().Suffix,
                             GraphDBOntology.RevId().Suffix,
                             GraphDBOntology.Description().Suffix,
                             () => new Dictionary<String, Object>(),

                             () => new GroupedCollection<String,    UInt64,    IGenericPropertyVertex   <UInt64, Int64, String, String, Object,
                                              UInt64, Int64, String, String, Object,
                                              UInt64, Int64, String, String, Object,
                                              UInt64, Int64, String, String, Object>>(),

                             () => new GroupedCollection<String,      UInt64,      IGenericPropertyEdge     <UInt64, Int64, String, String, Object,
                                              UInt64, Int64, String, String, Object,
                                              UInt64, Int64, String, String, Object,
                                              UInt64, Int64, String, String, Object>>(),

                             () => new GroupedCollection<String, UInt64, IGenericPropertyMultiEdge<UInt64, Int64, String, String, Object,
                                              UInt64, Int64, String, String, Object,
                                              UInt64, Int64, String, String, Object,
                                              UInt64, Int64, String, String, Object>>(),

                             () => new GroupedCollection<String, UInt64, IGenericPropertyHyperEdge<UInt64, Int64, String, String, Object,
                                              UInt64, Int64, String, String, Object,
                                              UInt64, Int64, String, String, Object,
                                              UInt64, Int64, String, String, Object>>(),
                             VertexInitializer
                            ),

                    // The vertices collection
                    () => new GroupedCollection<String, UInt64, IGenericPropertyVertex<UInt64, Int64, String, String, Object,
                                              UInt64, Int64, String, String, Object,
                                              UInt64, Int64, String, String, Object,
                                              UInt64, Int64, String, String, Object>>(),

                                #endregion

                    #region Edges

                    // Create a new edge identification
                    (graph) => PropertyGraph.NewEdgeId,

                    // Create a new edge
                    (Graph, OutVertex, InVertex, EdgeId, Label, EdgeInitializer) =>
                        new PropertyEdge
                            (Graph as IPropertyGraph,
                             OutVertex as IPropertyVertex,
                             InVertex as IPropertyVertex,
                             EdgeId,
                             Label,
                             GraphDBOntology.Id().Suffix,
                             GraphDBOntology.RevId().Suffix,
                             GraphDBOntology.Description().Suffix,
                             () => new Dictionary<String, Object>(),
                             EdgeInitializer
                            ),

                    // The edges collection
                    () => new GroupedCollection<String, UInt64, IGenericPropertyEdge<UInt64, Int64, String, String, Object,
                                              UInt64, Int64, String, String, Object,
                                              UInt64, Int64, String, String, Object,
                                              UInt64, Int64, String, String, Object>>(),

                    #endregion

                    #region MultiEdges

                    // Create a new multiedge identification
                    (graph) => PropertyGraph.NewMultiEdgeId,

                    // Create a new multiedge
                    (Graph, EdgeSelector, MultiEdgeId, Label, MultiEdgeInitializer) =>

                       new PropertyMultiEdge
                            (Graph as IPropertyGraph,
                             EdgeSelector,
                             MultiEdgeId,
                             Label,
                             GraphDBOntology.Id().Suffix,
                             GraphDBOntology.RevId().Suffix,
                             GraphDBOntology.Description().Suffix,

                             () => new Dictionary<String, Object>(),
                             () => new GroupedCollection<String, UInt64, IGenericPropertyEdge<UInt64, Int64, String, String, Object,
                                              UInt64, Int64, String, String, Object,
                                              UInt64, Int64, String, String, Object,
                                              UInt64, Int64, String, String, Object>>(),

                             MultiEdgeInitializer

                            ),

                    // The multiedges collection
                    () => new GroupedCollection<String, UInt64, IGenericPropertyMultiEdge<UInt64, Int64, String, String, Object,
                                              UInt64, Int64, String, String, Object,
                                              UInt64, Int64, String, String, Object,
                                              UInt64, Int64, String, String, Object>>(),
                    #endregion

                    #region HyperEdges

                    // Create a new hyperedge identification
                    (graph) => PropertyGraph.NewHyperEdgeId,

                    // Create a new hyperedge
                    (Graph, EdgeSelector, HyperEdgeId, Label, HyperEdgeInitializer) =>

                       new PropertyHyperEdge
                            (Graph as IPropertyGraph,
                             EdgeSelector,
                             HyperEdgeId,
                             Label,
                             GraphDBOntology.Id().Suffix,
                             GraphDBOntology.RevId().Suffix,
                             GraphDBOntology.Description().Suffix,

                             () => new Dictionary<String, Object>(),
                             () => new GroupedCollection<String, UInt64, IGenericPropertyVertex<UInt64, Int64, String, String, Object,
                                              UInt64, Int64, String, String, Object,
                                              UInt64, Int64, String, String, Object,
                                              UInt64, Int64, String, String, Object>>(),

                             HyperEdgeInitializer

                            ),

                    // The hyperedges collection
                    () => new GroupedCollection<String, UInt64, IGenericPropertyHyperEdge<UInt64, Int64, String, String, Object,
                                              UInt64, Int64, String, String, Object,
                                              UInt64, Int64, String, String, Object,
                                              UInt64, Int64, String, String, Object>>()

                    #endregion

                   )

        {

            _NewVertexId    = 0;
            _NewEdgeId      = 0;
            _NewMultiEdgeId = 0;
            _NewHyperEdgeId = 0;

            if (GraphInitializer != null)
                GraphInitializer(this);

        }