Ejemplo n.º 1
0
        // GET: ABoxOntologyGeneration
        public ActionResult Index()
        {
            OpcuaNodeList opcuaNodeList = new OpcuaNodeList();

            opcuaNodeList.ontologyConcepts = new List <OntologyConcept>();
            opcuaNodeList.ChildrenNodes    = new List <OpcuaNodeLink>();
            ViewBag.OntologyConcepts       = new SelectList(opcuaNodeList.ontologyConcepts, "IRI", "IRI");
            ViewBag.axiomList = new SelectList(dictAxioms.Select(kv => new { Value = kv.Key, Text = kv.Value }), "Text", "Text");
            return(View(opcuaNodeList));
        }
Ejemplo n.º 2
0
        public ActionResult browseOPCUAServer(OpcuaNodeList opcuaNodeList)
        {
            OPCUAUtility.connectToOPCUAServer(opcuaNodeList.opcuaEndpointURL);

            var mE_SEMANTIC_ANNOTATION = db.ME_SEMANTIC_ANNOTATION.ToList();

            opcuaNodeList.ontologyConcepts = mE_SEMANTIC_ANNOTATION
                                             .Select(x => new OntologyConcept()
            {
                Id = x.ID, IRI = x.IRI, Short_Name = x.SHORT_NAME
            })
                                             .ToList();
            ViewBag.OntologyConcepts = new SelectList(opcuaNodeList.ontologyConcepts, "IRI", "IRI");
            ViewBag.axiomList        = new SelectList(dictAxioms.Select(kv => new { Value = kv.Value, Text = kv.Value }), "Text", "Text");

            return(View("Index", OPCUAUtility.opcuaNodeStructure));
        }
Ejemplo n.º 3
0
        public ActionResult saveMethodOntology(OpcuaNodeList opcuaNodeList)
        {
            String SelectedMethodNodeId = opcuaNodeList.SelectedMethodNodeId;

            opcuaNodeList.ChildrenNodes     = OPCUAUtility.opcuaNodeStructure.ChildrenNodes;
            opcuaNodeList.MethodBrowseLinks = new List <OpcuaNodeLink>();

            int insertCount = 0;

            while (true)
            {
                OpcuaNodeLink link = opcuaNodeList.ChildrenNodes.Where(node => node.nodeID.Equals(SelectedMethodNodeId)).FirstOrDefault();
                //OpcuaNodeLink parentNode = opcuaNodeList.ChildrenNodes.Where(n => n.nodeID.Equals(sourceNode.parentNodeId)).FirstOrDefault();
                opcuaNodeList.MethodBrowseLinks.Insert(insertCount, link);

                if (String.IsNullOrWhiteSpace(link.parentNodeId))
                {
                    break;
                }

                SelectedMethodNodeId = link.parentNodeId;
                insertCount++;
            }
            opcuaNodeList.MethodBrowseLinks.Reverse();
            opcuaNodeList.ChildrenNodes = OPCUAUtility.opcuaNodeStructure.ChildrenNodes;
            String strOpcuaNodeList = new JavaScriptSerializer().Serialize(opcuaNodeList);

            RestClient.SendRequest("http://localhost:8081/ABoxOntReceiverService/webapi/myresource/getOntology", "POST", "application/json", strOpcuaNodeList);

            var mE_SEMANTIC_ANNOTATION = db.ME_SEMANTIC_ANNOTATION.ToList();

            opcuaNodeList.ontologyConcepts = mE_SEMANTIC_ANNOTATION
                                             .Select(x => new OntologyConcept()
            {
                Id = x.ID, IRI = x.IRI, Short_Name = x.SHORT_NAME
            })
                                             .ToList();
            OPCUAUtility.connectToOPCUAServer(opcuaNodeList.opcuaEndpointURL);
            ViewBag.OntologyConcepts = new SelectList(opcuaNodeList.ontologyConcepts, "IRI", "IRI");
            ViewBag.axiomList        = new SelectList(dictAxioms.Select(kv => new { Value = kv.Key, Text = kv.Value }), "Text", "Text");

            return(View("Index", OPCUAUtility.opcuaNodeStructure));
        }