Dataset Viewer (First 5GB)
Auto-converted to Parquet Duplicate
messages
listlengths
1
12
[ { "role": "user", "content": "Share the content of this arxiv-papers." }, { "role": "assistant", "content": "# General-Purpose Computing \non a \nSemantic Network Substrate111Rodriguez, M.A., “General-Purpose Computing on a\nSemantic Network Substrate,” Emergent Web Intelligence: Advanced Semantic\nTechnologies, Advanced Information and Knowledge Processing series, eds. R.\nChbeir, A. Hassanien, A. Abraham, and Y. Badr, Springer-Verlag, pages 57-104,\nISBN:978-1-84996-076-2, June 2010.\n\nMarko A. Rodriguez \nDigital Library Research and Prototyping Team \nLos Alamos National Laboratory \nLos Alamos, New Mexico 87545 \n\n(original: April 16, 2007 revision: October 7, 2007)\n\n###### Abstract\n\nThis article presents a model of general-purpose computing on a semantic\nnetwork substrate. The concepts presented are applicable to any semantic\nnetwork representation. However, due to the standards and technological\ninfrastructure devoted to the Semantic Web effort, this article is presented\nfrom this point of view. In the proposed model of computing, the application\nprogramming interface, the run-time program, and the state of the computing\nvirtual machine are all represented in the Resource Description Framework\n(RDF). The implementation of the concepts presented provides a practical\ncomputing paradigm that leverages the highly-distributed and standardized\nrepresentational-layer of the Semantic Web. \n \nkeywords: Resource Description Framework, Web Ontology Language, Virtual\nMachines, Object-Oriented Programming, Semantic Web Computing\n\n## 1 Introduction\n\nThis article discusses computing in semantic networks. A semantic network is a\ndirected labeled graph ( ?). The thesis of this article is that the state of a\ncomputing machine, its low-level instructions, and the executing program can\nbe represented as a semantic network. The computational model that is\npresented can be instantiated using any semantic network representation.\nHowever, given the existence of the Resource Description Framework (RDF) ( ?)\nand the popular Web Ontology Language (OWL) ( ?), this article presents the\ntheory and the application in terms of these constructs.\n\nThe computing model that is proposed is perhaps simple in theory, but in\napplication, requires a relatively strong background in the computer sciences.\nThis article discusses a wide breadth of concepts including those from\ncomputer architecture, the Semantic Web, and object-oriented programming. In\norder to accommodate all interested readers, each discipline’s concepts will\nbe introduced at a tutorial level in this introduction. The remainder of the\narticle presents a more in-depth practical application of the proposed model.\nThe practical application includes a specification for an RDF virtual machine\narchitecture (RVM) called Fhat (pronounced făt, like “fat”) and an RDF\nprogramming language designed specifically for that architecture called Neno\n(pronounced nēnō, like “knee-know”).\n\nThe introduction to this article is split into three subsections. §1.1\nprovides a brief introduction to the field of computer architecture in order\nto elucidate those concepts which will be of primary interest later in the\narticle. §1.2 discusses the Semantic Web and the RDF semantic network data\nmodel. Finally, §1.3 provides an overview of object-oriented programming and\nits relation to OWL.\n\n### 1.1 General-Purpose Computing and the Virtual Machine\n\nA general-purpose computer is one that can support any known computation. The\nmeaning of computability and what is required to compute was first developed\nby Alan Turning in the late 1930s ( ?). Since then, and with the large leaps\nin the engineering of computing machines, most computers of today are general-\npurpose computing machines. The two primary components of a computing machine\nare the central processing unit (CPU) and the main memory (RAM).\n\nThe purpose of the CPU is to perform calculations (i.e. execute algorithms on\ndata). Generally, the CPU reads instructions and data from RAM, performs a\ncalculation, and re-inserts its results back into RAM. Most CPUs maintain a\nrelatively small set of instructions that they can execute ( ?). Example\ninstructions include add, sub, load, store, branch, goto, etc. However, these\nprimitive instructions can be composed to perform any computing task desired\nby the programmer.\n\nCurrently, the smallest unit of information in a digital computer is the bit.\nA bit can either be a $0$ or a $1$. Bits are combined to form bytes (8-bits)\nand words (machine architecture dependent). Most desktop machines of everyday\nuse have a 32-bit word and are called 32-bit machines. 32-bits can be used to\nrepresent $2^{32}$ different “things”. For example, an unsigned 32-bit integer\ncan represent the numbers 0 to 4,294,967,295. While instructions, like data,\nare represented as a series of 0s and 1s, it is possible to represent the\ninstructions in a more human readable form. The abstraction above binary\nmachine language is called assembly language ( ?). For example, the following\nthree assembly instructions\n\n \n \n \n load 2, 3\n load 1, 2\n add 1, 2, 3\n store 3, 2\n \n \n\ninstruct the CPU to 1) read the word in the memory cell at memory address $2$\nin RAM and store it in CPU register $3$, 2) read the word at memory address\n$1$ and store it in register $2$, 3) add the contents of register $1$ and $2$\nand store the result in register $3$, and finally 4) store the word in\nregister $3$ into memory address $2$ of RAM.\n\nModern day computer languages are written at a much higher level of\nabstraction than both machine and assembly language. For instance, the\nprevious instructions could be represented by a single statement as\n\n \n \n \n z = y + x\n \n \n\nwhere register $1$ holds the value of variable y, register $2$ holds the value\nof variable x and memory address $3$ holds the value of variable z.\n\nTo the modern-day programmer, the low-level CPU instructions are hidden. It is\nthe role of the language compiler to translate the human readable/writeable\nsource code into the machine code of the CPU. Simply stated, a compiler is a\ncomputer program that translates information written in one language to\nanother language ( ?). In practice, the compiler translates the human code to\na list of CPU instructions that are stored in RAM and executed by the CPU in\nsequential order as pointed to by the CPU’s program counter (PC). In some\ninstances, the compiler will translate the human code to the native language\nof the CPU (the instruction set of the CPU). In other cases, the compiler will\ntranslate the human code to another language for a virtual machine to compute\n( ?). Virtual machine language is called byte-code. A virtual machine is, for\nall practical purposes, a CPU represented in software, not hardware. However,\ndepending on the complexity of the implementation, a virtual machine can\neither do a hard implementation (where an exact software replica of hardware\nis instantiated) or a soft implementation (where more of the hardware\ncomponents are black-boxed in software). The virtual machine computes its\nbyte-code instructions by using the underlying hardware CPU’s instruction set.\nFinally, to complete the computation stack, the CPU relies on the underlying\nphysical laws of nature to compute its instructions. The laws of physics drive\nthe CPU from state to state. The evolution of states and its effects on the\nworld is computing.\n\nPerhaps the most popular virtual machine is the Java virtual machine (JVM) (\n?) of the Java programming language ( ?). The JVM is a piece of software that\nruns on a physical machine. The JVM has its own instruction set much like a\nhardware CPU has its own instruction set. The JVM resides in RAM and requires\nthe physical CPU to compute its evolution. Thus, the JVM translates its\ninstructions to the instruction set of the native CPU. The benefit of this\nmodel is that irrespective of the underlying hardware CPU, a JVM designed for\nthat CPU architecture can read and process any Java software (i.e. any Java\nbyte-code). The drawback, is that the computation is slower than when\ninstructions are represented as instructions for the native CPU.\n\n### 1.2 The Semantic Web and RDF\n\nThe previous section described the most fundamental aspects of computing. This\nsection presents one of the most abstract levels of computing: the Semantic\nWeb. The primary goal of the Semantic Web effort is to provide a standardized\nframework for describing resources (both physical and conceptual) and their\nrelationships to one another ( ?). This framework is called the Resource\nDescription Framework (RDF) ( ?).222Note that RDF is a data model, not a\nsyntax. RDF has many different syntaxes like RDF/XML ( ?), Notation 3 (N3) (\n?), the N-TRIPLE format ( ?), and TRiX ( ?).\n\nRDF maintains two central tenets. The first states that the lowest unit of\nrepresentation is the Universal Resource Identifier (URI) ( ?) and the literal\n(i.e. strings, integers, floating point numbers, etc.).333There also exist\nblank or anonymous nodes. There will be no discussion of blank nodes in this\narticle. A URI unambiguously identifies a resource. When two resources share\nthe same URI, they are the same resource. However, note that when two\nresources do not share the same URI, this does not necessarily mean that they\nare not the same resource. In practice, URIs are namespaced to ensure that\nname conflicts do not occur across different organizations ( ?). For example,\nthe URI http://www.newspaper.org/Article can have a different meaning, or\nconnotation, than http://www.science.net/Article because they are from\ndifferent namespaces.444For the sake of brevity, prefixes are usually used\ninstead of the full namespace. For instance, http://www.w3.org/1999/02/22-rdf-\nsyntax-ns# is prefixed as rdf:.\n\nThe second tenet of RDF states that URIs and literal values are connected to\none another in sets of triples, denoting edges of a directed labeled graph. A\ntriple is the smallest relational fact that can be asserted about the world (\n?). For instance, the statement “I am”, can be denoted\n$(\\texttt{I},\\texttt{am},\\texttt{I})$ in triple form. The first element of the\ntriple is called the subject and can be any URI. The second element is called\nthe predicate, and it can also be any URI. Finally, the third element is\ncalled the object, and it can be any URI or literal. If $U$ denotes the set of\nall URIs and $L$ denotes the set of all literals, then an RDF network denoted\n$G$ can be defined as\n\n$G\\subseteq(U\\times U\\times(U\\cup L)).$\n\nRDF has attracted commercial and scholarly interest, not only because of the\nSemantic Web vision, but because RDF provides a unique way of modeling data.\nThis enthusiasm has sparked the development and distribution of various\ntriple-store applications dedicated to the storage and manipulation of RDF\nnetworks ( ?). Some triple-stores can support computations on RDF networks\nthat are on the order of $10^{10}$ triples ( ?). A triple-store is analagous\nto a relational database. However, instead of representing data in relational\ntables, a triple-store represents its data as a semantic network. A triple-\nstore provides an interface to an RDF network for the purpose of reading from\nand writing to the RDF network. The most implemented query language is the\nSPARQL Protocol and RDF Query Language (SPARQL) ( ?). SPARQL, loosely, is a\nhybrid of both SQL (a relational database language) and Prolog (a logic\nprogramming language) ( ?). As an example, the following SPARQL query returns\nall URIs that are both a type of CognitiveScientist and ComputerScientist.\n\n \n \n \n SELECT ?x\n WHERE {\n ?x <rdf:type> <ComputerScientist> .\n ?x <rdf:type> <CognitiveScientist> }\n \n \n\nThe example SPARQL query will bind the variable ?x to all URIs that are the\nsubject of the triples with a predicate of rdf:type and objects of\nComputerScientist and CognitiveScientist. For the example RDF network\ndiagrammed in Figure 1, ?x would bind to Marko. Thus, the query above would\nreturn Marko.555Many triple-store applications support reasoning about\nresources during a query (at run-time). For example, suppose that the triple\n(Marko, rdf:type, ComputerScientist) does not exist in the RDF network, but\ninstead there exist the triples (Marko, rdf:type, ComputerEngineer) and\n(ComputerEngineer, owl:sameAs, ComputerScientist). With OWL reasoning, $?x$\nwould still bind to Marko because ComputerEngineer and ComputerScientist are\nthe same according to OWL semantics. The RDF computing concepts presented in\nthis article primarily focus on triple pattern matching and thus, beyond\ndirect URI and literal name matching, no other semantics are used.\n\nFigure 1: An example RDF network.\n\nThe previous query can be represented in its more set theoretic sense as\n\n$\\displaystyle X=\\;$\n$\\displaystyle\\\\{?x\\;|\\;(?x,\\texttt{rdf:type},\\texttt{ComputerScientist})\\in\nG$\n$\\displaystyle\\;\\;\\;\\;\\wedge\\;(?x,\\texttt{rdf:type},\\texttt{CognitiveScientist})\\in\nG\\\\},$\n\nwhere $X$ is the set of URIs that bind to $?x$ and $G$ is the RDF network\nrepresented as an edge list. The above syntax’s semantics is “$X$ is the set\nof all elements $?x$ such that $?x$ is the head of the triple ending with\nrdf:type, ComputerScientist and the head of the triple ending with rdf:type,\nCognitiveScientist, where both triples are in the triple list $G$”. Only\nrecently has there been a proposal to extend SPARQL to support writing and\ndeleting triples to and from an RDF network. SPARQL/Update ( ?) can be used to\nadd the fact that Marko is also an rdf:type of Human.\n\n \n \n \n INSERT { <Marko> <rdf:type> <Human> . }\n \n \n\nIn a more set theoretic notation, this statement is equivalent to\n\n$G=G\\cup(\\texttt{Marko},\\texttt{rdf:type},\\texttt{Human}).$\n\nThe semantics of the previous statement is: “Set the triple list $G$ to the\ncurrent triple list $G$ unioned with the triple (Marko, rdf:type, Human).\nFinally, it is possible to remove a triple using SPARQL/Update. For instance,\n\n \n \n \n DELETE { <I> <am> <I> . }\n \n \n\nIn set theoretic notation, this is equivalent to\n\n$G=G\\setminus(\\texttt{I},\\texttt{am},\\texttt{I}),$\n\nwhere the semantics are“set the triple list $G$ to the current triple list $G$\nminus the triple (I, am, I)”.\n\n### 1.3 Object-Oriented Programming and OWL\n\nOWL is an ontology modeling language represented completely in RDF. In OWL, it\nis possible to model abstract classes and their relationships to one another\nas well as to use these models and the semantics of OWL to reason about\nunspecified relationships. In OWL semantics, if Human is a class and there\nexists the triple (Marko, rdf:type, Human), then Marko is considered an\ninstance of Human. The URI Human is part of the ontology-level of the RDF\nnetwork and the URI Marko is part of the instance-level (also called the\nindividual-level) of the RDF network. In OWL, it is possible to state that all\nHumans can have another Human as a friend. This is possible by declaring an\nowl:ObjectProperty named hasFriend that has an rdfs:domain of Human and an\nrdfs:range of Human. Furthermore, it is possible to restrict the cardinality\nof the hasFriend property and thus, state that a Human can have no more than\none friend. This is diagrammed in Figure 2.666In this article, ontology\ndiagrams will not explicitly represent the constructs rdfs:domain, rdfs:range,\nnor the owl:Restriction anonymous URIs. These URIs are assumed to be apparent\nfrom the diagram. For example, the restriction shown as [0..1] in Figure 2 is\nrepresented by an owl:Restriction for the hasFriend property where the\nmaxCardinality is $1$ and Human is an rdfs:subClassOf of this owl:Restriction.\n\nFigure 2: An ontology and an instance is represented in an RDF network.\n\nA class specification in object-oriented programming is called an application\nprogramming interface (API) ( ?). OWL ontologies share some similarities to\nthe object-oriented API. However, OWL ontologies also differ in many respects.\nOWL is a description logic language that is primarily focused on a means by\nwhich to reason on RDF data. An object-oriented API is primarily focused on\nconcretely defining classes and their explicit relationships to one another\nand is thus, more in line with the frames modeling paradigm. Furthermore, OWL\nontologies can contain instances (i.e. individuals), allow for multiple\ninheritance, do not support the unique name assumption, nor the closed world\nassumption ( ?, ?).\n\nAnother aspect of OWL that differs from object-oriented APIs is that object-\noriented APIs include the concept of a method. The method is an algorithmic\n“behavior” that forms the foundation of the evolutionary processes that drive\nthe instances of these classes from state to state. One of the primary\npurposes of this article is to introduce an OWL ontology for modeling methods\nand their low-level machine instructions. While process information can be\nrepresented in Frame Logic (i.e. F-Logic) ( ?), this article is primarily\ninterested in modeling methods in much the same way that they are represented\nin modern day object-oriented languages such as Java and C++ and in terms of\ntheir syntax, semantics, and low-level representation.\n\nIn Java and C++, a method is defined for a class and is used to manipulate the\nproperties (called fields) of an instance of that class. For example,\n\n \n \n \n class Human {\n Human hasFriend;\n void makeFriend(Human h) {\n this.hasFriend = h;\n }\n }\n \n\ndeclares that there exists an abstract class called Human. A Human has one\nfield called hasFriend. The hasFriend field refers to an object of type Human.\nFurthermore, according to the class declaration, a Human has a method called\nmakeFriend. The makeFriend method takes a single argument that is of type\nHuman and sets its hasFriend field to the Human provided in the argument. The\nthis keyword makes explicit that the hasFriend field is the field of the\nobject for which the makeFriend method was invoked.\n\nIn many object-oriented languages, an instance of Human is created with the\nnew operator. For instance,\n\n \n \n \n Human Marko = new Human();\n \n \n\ncreates a Human named (referenced as) Marko. The new operator is analogous to\nthe rdf:type property. Thus, after this code is executed, a similar situation\nexists as that which is represented in Figure 2. However, the ontological\nmodel diagrammed in the top half of Figure 2 does not have the makeFriend\nmethod URI. The relationship between object-oriented programming and OWL is\npresented in Table 1.\n\n| object-oriented | OWL | example \n---|---|---|--- \nclass specification | API | ontology | Human \nobject property | field | rdf:Property | hasFriend \nobject method | method | | makeFriend \ninstantiate | new operator | rdf:type property | new/rdf:type \nTable 1: The relationship between object-oriented programming, OWL, and the\nsection example.\n\nIt is no large conceptual leap to attach a method URI to a class. Currently,\nthere is no strong incentive to provide a framework for representing methods\nin OWL. RDF was originally developed as a data modeling framework, not a\nprogramming environment per se. However, in a similar vein, the Web Ontology\nLanguage for Services (OWL-S) has been proposed as a web services model to\nsupport the discovery, execution, and tracking of the execution of Semantic\nWeb services ( ?, ?). An OWL-S service exposes a service profile that\ndescribes what the service does, a service grounding that describes how to\ninvoke the service, and a service model that describes how the service works.\nWhile OWL-S does provide the notion of object-oriented method invocation on\nthe Semantic Web, OWL-S is more at the agent-oriented level and its intended\nuse is for more “client/server” type problems. Another interesting and related\nidea is to use RDF as a medium for communication between various computing\ndevices and thus, utilize the Semantic Web as an infrastructure for\ndistributed computing ( ?). Other object-oriented notions have been proposed\nwithin the context of RDF. For instance, SWCLOS ( ?) and ActiveRDF ( ?)\nutilize RDF as a medium for ensuring the long-term persistence of an object.\nBoth frameworks allow their respective languages (CLOS and Ruby) to populate\nthe fields of their objects for use in their language environments. Once their\nfields have been populated, the object’s methods can be invoked in their\nrespective programming environments.\n\n### 1.4 The Contributions of this Article\n\nThis article unifies all of the concepts presented hitherto into a framework\nfor computing on RDF networks. In this framework, the state of a computing\nvirtual machine, the API, and the low-level instructions are all represented\nin RDF. Furthermore, unlike the current programming paradigm, there is no\nstack of representation. The lowest level of computing and the highest level\nof computing are represented in the same substrate: URIs, literals, and\ntriples.\n\nThis article proposes the concept of OWL APIs, RDF triple-code, and RDF\nvirtual machines (RVM). Human readable/writeable source code is compiled to\ncreate an OWL ontology that abstractly represents how instructions should be\nunited to form instruction sequences.777While OWL has many features that are\nuseful for reasoning about RDF data, the primary purpose of OWL with respect\nto the concepts presented in this article is to utilize OWL for its ability to\ncreate highly restricted data models. These restricted models form the APIs\nand ensure that instance RDF triple-code can be unambiguously generated by an\nRVM. When objects and their methods are instantiated from an OWL API, RDF\ntriple-code is created. RDF triple-code is analogous to virtual machine byte-\ncode, but instead of being represented as bits, bytes, and words, it is\nrepresented as URIs and triples. In other words, a piece of executable\nsoftware is represented as a traversable RDF network. The RVM is a virtual\nmachine whose state is represented in RDF. The RVM’s stacks, program counter,\nframes, etc. are modeled as an RDF network. It is the role of the RVM to\n“walk” the traversable RDF triple-code and compute.\n\nIn summary, software is written in human readable/writeable source code,\ncompiled to an OWL API, instantiated to RDF triple-code, and processed by a\ncomputing machine whose state is represented in RDF. However, there is always\na homunculus. There is always some external process that drives the evolution\nof the representational substrate. For the JVM, that homunculus is the\nhardware CPU. For the hardware CPU, the homunculus is the physical laws of\nnature. For the RVM, the homunculus is some host CPU whether that host CPU is\nanother virtual machine like the JVM or a hardware CPU. Table 2 presents the\ndifferent levels of abstraction in computing and how they are represented by\nthe physical machine, virtual machine, and proposed RDF computing paradigms.\n\nlevel | machine paradigm | virtual machine paradigm | RDF paradigm \n---|---|---|--- \nhigh-level code | source code | source code | source code \nmachine code | native instructions | byte-code | triple-code \ninstruction units | bits | bits | URIs and literals \nmachine state | hardware | software | RDF \nmachine execution | physics | hardware | software \nTable 2: The various levels of abstraction in current and proposed computing\nparadigms.\n\n## 2 A High-Level Perspective\n\nAssume there exists an RDF triple-store. Internal to that triple-store is an\nRDF network. That RDF network is composed of triples. A triple is a set of\nthree URIs and/or literals. Those URIs can be used as a pointer to anything.\nThis article presents a model of computation that is represented by URIs and\nliterals and their interrelation to one another (triples). Thus, computation\nis represented as an RDF network. Figure 3 presents a high-level perspective\non what will be discussed throughout the remainder of this article. What is\ndiagrammed in Figure 3 is a very compartmentalized model of the components of\ncomputing. This model is in line with the common paradigm of computer science\nand engineering. However, less traditional realizations of this paradigm can\nremove the discrete levels of representation to support multi-level\ninteractions between the various computing components since all the components\nare represented in the same RDF substrate: as URIs, literals, and triples.\n\nFigure 3: A high-level perspective of the Semantic Web computing environment.\n\nFigure 3 shows 6 primary components. Two of these components are at the\nontological level of the RDF network, two are at the instance level of the RDF\nnetwork, and two are at the machine level external to the RDF network. While\nthere are many benefits that emerge from this computing model that are\ncurrently seen and as of yet unseen, established interesting aspects are\nenumerated below.\n\n 1. 1.\n\nThe total address space of the RVM is the space of all URIs and literals. In\nthe RVM model of computing, the RVM state has no concept of the underlying\nhardware CPU’s address space because instructions and data are represented in\nRDF. This idea is discussed in §3.1.\n\n 2. 2.\n\nThe Semantic Web is no longer an information gathering infrastructure, but a\ndistributed information processing infrastructure (the process can move to the\ndata, the data doesn’t have to move to the process). An RVM can be “GETed”\nfrom a web-server as an RDF/XML document or “SELECTed” from an RDF triple-\nstore. RDF programs and RVM states are “first-class” web-entities. The\nramifications of this is that an RVM can move between triple-store\nenvironments and can compute on local data sets without requiring moving the\ndata to the processor. This idea is discussed in §4.1.\n\n 3. 3.\n\nThis model maintains the “write once, run anywhere” paradigm of the JVM. The\nRVM model ensures that human readable/writeable source code is compiled down\nto an intermediate language that is independent of the underlying hardware CPU\nexecuting the RVM process.\n\n 4. 4.\n\nLanguages built on a semantic network substrate can have unique constructs not\nfound in other languages (e.g. inverse field referencing, multi-instance\nfields, field querying, etc.). While it is theoretically possible to add these\nconstructs to other languages, they are not provided in the core of the\nlanguages as these languages do not have an underlying semantic network data\nmodel. These novel language constructs are discussed in §3.2.\n\n 5. 5.\n\nCurrently, there already exists an infrastructure to support the paradigm\n(triple-stores, ontology modeling languages, query languages, etc.) and thus,\nrequires very little investment by the community. The primary investment is\nthe development of source-to-OWL API compilers, RVMs, and the standardization\nof RDF triple-code and RVM distribution/security protocols.\n\n 6. 6.\n\nAn RVM can be engineered at any level of complexity. It is possible to move\nthe complexity to the software implementing the RVM process to ease machine\narchitecture development and speed up computing time. This idea is discussed\nin §4.3.\n\n 7. 7.\n\nIn this model, language reflection exists at the API, software, and RVM level\n(everything is represented in RDF). This idea is discussed in §4.2.\n\n### 2.1 The Ontological Level\n\nThe ontological level of the RDF network diagrammed in Figure 3 is represented\nin OWL. This subsection will discuss the two primary ontological components:\nthe API, and the RVM architecture.\n\n#### 2.1.1 The API\n\nOWL supports the specification of class interactions. However, class\ninteractions are specified in terms of property relationships, not method\ninvocations. OWL has no formal way of specifying class behaviors (i.e.\nmethods). However, in OWL, it is possible to define method and instruction\nclasses and formally specify restrictions that dictate how instructions should\nbe interrelated within a method. The method and instruction ontology presented\nin this article makes RDF a programming framework and not just a data modeling\nframework.\n\n#### 2.1.2 The Machine Architecture\n\nThe RDF machine architecture is modeled in OWL. The machine architecture\nontology is an abstract description of an instance of a particular RVM.\nDepending on the level of abstraction required, different machine\narchitectures can be implemented at varying levels of detail.\n\n### 2.2 The Instance Level\n\nThe instance level of an RDF network is constrained by the requirements\nspecified in the ontological level of the RDF network. This subsection will\npresent the two components of the instance layer of the diagram in Figure 3.\n\n#### 2.2.1 The Program\n\nAn API abstractly defines a software application. When an API is instantiated,\ninstance RDF triple-code is created. Triple-code represents the instructions\nused by an RVM to compute.\n\n#### 2.2.2 The Virtual Machine\n\nAn instance of the machine architecture is an RDF virtual machine (RVM). The\npurpose of the RVM is to represent its state (stacks, program counter, etc.)\nin the same RDF network as the triple-code instructions. However, the RDF-\nbased RVM is not a “true” computer. The RVM simply represents its state in\nRDF. The RVM requires a software implementation outside the triple-store to\ncompute its instructions. This requires the machine level discussed next.\n\n### 2.3 The Machine Level\n\nThe machine level is where the actual computation is executed. An RDF network\nis a data structure. RDF is not a processor in the common sense—it has no way\nof evolving itself. In order to process RDF data, some external process must\nread and write to the RDF network. The reading and writing of the RDF network\nevolves the RVM and the objects on which it is computing. This section\ndiscusses the machine level that is diagrammed in Figure 3.\n\n#### 2.3.1 The Virtual Machine Process\n\nThe virtual machine process is represented in software on a particular host\nmachine. The RVM processor must be compatible with both the triple-store\ninterface (e.g. SPARQL/Update) and the underlying host machine. The RVM’s host\nmachine can be the physical machine (hardware CPU) or another virtual machine.\nFor instance, if the RVM’s machine process is implemented in the Java\nlanguage, then the machine process runs in the JVM. This is diagrammed in\nFigure 3 by the ... component in between the virtual machine process and the\nphysical machine.\n\n#### 2.3.2 The Physical Machine\n\nThe physical machine is the actual hardware CPU. The RVM implementation\ntranslates the RDF triple-code to the host machine’s instruction set. For\nexample, if the RVM process is running on the Intel Core Duo, then it is the\nrole of the RVM process to translate the RDF triple-code to that specified by\nthe Intel Core Duo instruction set. Thus, portability of this architectural\nmodel relies on a per host implementation of the RVM. Finally, to complete the\ncomputational stack, the laws of physics compute the hardware CPU. Much like\nthe RDF representation of the RVM is a “snap-shot” representation of a\ncomputation, the hardware CPU is a silicon/electron “snap-shot” representation\nof a computation.\n\n## 3 The Neno Language\n\nThis section presents the specification of a programming language designed to\ntake advantage of a pure RDF computing environment. This language is called\nNeno. Neno is a high-level object-oriented language that is written in a\ngrammar similar to other object-oriented languages such as Java and C++.\nHowever, Neno provides some functionality that is not possible with other\nlanguages (i.e. not explicit in the constructs of other object-oriented\nlanguages). This functionality is not due to the sophistication of the Neno\nlanguage, but instead, is due to the fact that it is written for an RDF\nsubstrate and thus, can take advantage of the flexibility of RDF and its\nread/write interfaces. For this reason, Neno is in a class of languages that\nis coined semantic network programming languages. The Ripple programming\nlanguage is another such semantic network programming language ( ?). Both Neno\nand Ripple are Turing complete and thus, can perform any classical (non-\nquantum) computation.\n\nNeno source code is written in human readable/writeable plain-text like the\nsource code of many other high-level programming languages. Neno source code\nis compiled by a NenoFhat compiler. The NenoFhat compiler compiles Neno source\ncode to a Fhat OWL API. The Fhat OWL API is analogous to the jar file of Java.\nA Fhat RVM instantiates (loads) aspects of the API into the instance layer of\nthe RDF network. This instantiated aspect of the API is executable RDF triple-\ncode. A Fhat RVM processes the triple-code and thus, computes. The analogies\nbetween the Neno and Java components are presented in Table 3.\n\nartifact | Neno | Java \n---|---|--- \nsource code | AClass.neno | AClass.java \ncompiler | nenofhat | javac \nAPI | AClass.owl | AClass.class \nvirtual machine | fhat | java \nprogram | RDF network | JVM memory \nTable 3: The mapping between Neno and Java components.\n\nThe following examples will only namespace those entities that are not within\nthe namespace http://neno.lanl.gov. Thus, the default namespace is\nhttp://neno.lanl.gov (prefixed as neno). The Neno programming language is\nengineered to be in compliance with OWL and the XML Schema Definition (XSD)\nnamespaces. OWL provides the concept of classes, inheritance, datatype and\nclass properties, and property restrictions. However, Neno restricts its\ncompiled Fhat OWL APIs to single-parent classes (i.e. multiple-inheritance is\nnot supported) and holds the closed world assumption (i.e. only properties\nthat are stated in the ontology can be computed on in a Neno object). This is\nsimilar to what is assumed in Java. XSD provides the specification for the\nliteral data types (e.g. string, integer, float, double, date, time, etc.).\nThe XSD URI namespace prefix is xsd.\n\nThe lexicon that will be used to express the following concepts is drawn from\nobject-oriented programming, not OWL. OWL parlance will only be used when\ncompletely describing the “back-end” of a particular aspect of the language.\nTable 4 states the relationship between OWL terms and object-oriented\nprogramming terms.\n\nOWL | object-oriented languages \n---|--- \nowl:Class | Class \nneno:Method | Method \nrdf:Property | Field \nsubject of rdf:type | Object \nTable 4: The mapping between the terms in OWL and object-oriented\nprogramming.\n\n### 3.1 The Universally Unique Identifier Address Space\n\nThroughout the remainder of this article, Universally Unique Identifiers\n(UUIDs) will be continually used ( ?). The set of all UUIDs is a subset of the\nset of all URIs. A UUID is a 128-bit (16-byte) string that can be created in\ndisparate environments with a near zero probability of ever being reproduced.\nTo understand the number of UUIDs that are possible at 128-bits, it would\nrequire 1 trillion unique UUIDs to be created every nanosecond for 10 billion\nyears to exhaust the space of all possible UUIDs.888This fact was taken from\nWikipedia at http://en.wikipedia.org/wiki/UUID. A UUID can be represented as a\n36 character hexadecimal string. For example, 6c3f8afe-\nec3d-11db-8314-0800200c9a66, is a UUID. The hexadecimal representation will be\nused in all the following examples. However, for the sake of brevity, since 36\ncharacters is too lengthy for the examples and diagrams, only the first 8\ncharacters will be used. Thus, 6c3f8afe-ec3d-11db-8314-0800200c9a66 will be\nrepresented as 6c3f8afe. Furthermore, UUIDs, when used as URIs are namespaced\nas\n\nurn:uuid:6c3f8afe-ec3d-11db-8314-0800200c9a66\n\nand for diagrams and examples, is abbreviated as urn:uuid:6c3f8afe.\n\nWhen Neno source code is compiled to Fhat triple-code, a UUID is created for\nnearly everything; every instruction class and instruction instance is\nidentified by a UUID. When a Fhat is instantiated, a UUID is created for all\nthe rdfs:Resources that compose the machine (i.e. stacks, frames, etc.). In\ntypical programming environments, the programming language and its computing\nmachine are constrained by the size of RAM (and virtual memory with most\nmodern day operating systems). For a 32-bit machine, the maximum size of RAM\nis approximately 4 gigabytes. This means that there are only $2^{32}$ possible\naddresses and thus, words in RAM. However, for Neno, no such constraints\nexist. The space of all UUIDs is the address space of a Fhat RVM (more\ngenerally, the space of all URIs and literals is the address space). Fhat does\nnot use RAM for storing its data and instructions, Fhat uses an RDF network.\nThus, Fhat does not have any hard constraint on how much memory it “allocates”\nfor its processing.\n\n### 3.2 Class Declarations in Neno Source Code\n\nNeno source code has a grammar that is very similar to other object-oriented\nlanguages. For instance, suppose the following simple class written in the\nJava programming language:\n\n \n \n \n package gov.lanl.neno.demo;\n \n import java.lang.*;\n import java.util.*;\n \n public class Human {\n private String hasName;\n private ArrayList<Human> hasFriend;\n \n public Human (String n) {\n this.hasName = n;\n }\n \n public void makeFriend(Human h) {\n if(h != this)\n this.hasFriend.add(h);\n }\n \n public void setName(String n) {\n this.hasName = n;\n }\n }\n \n \n\nThe Human class has two fields named hasName and hasFriend. The field hasName\ntakes a value of String (or java.lang.String to be more specific) and\nhasFriend takes a value of Human. The Human class has one constructor and one\nmethod. A constructor is used to create an object and is a type of method. In\nJava, a constructor tells the JVM to allocate memory for the object on the\nheap (i.e. an object “pool”) and set the object’s field values according to\nthe statements in the body of the constructor. The constructor for Human takes\na String called n and creates a new Human instance called an object. The Human\nconstructor sets that object’s hasName field to n. The Human method is called\nmakeFriend. This method takes a Human with variable name h as an argument. If\nthe object referenced by h is not the Human for which this method was invoked,\nthen the object for which this method was called has h added to its hasFriend\nfield. Note, that unlike the example in Figure 2, it is possible for a Human\nobject to have multiple friends because of the use of the\nArrayList<Human>.999Java generics as represented by the $<\\;>$ notation is\nsupported by Java 1.5+.\n\nThe Neno programming language is similar to Java. The following source code\ndemonstrates how to declare nearly the same class in Neno.101010When there are\nno ambiguities in naming, the class declaration can be written without\nprefixes.\n\n \n \n \n prefix owl: <http://www.w3.org/2002/07/owl>;\n prefix xsd: <http://www.w3.org/2001/XMLSchema>;\n prefix demo: <http://neno.lanl.gov/demo>;\n \n owl:Thing demo:Human {\n xsd:string hasName[1];\n demo:Human hasFriend[0..*];\n \n !Human(xsd:string n) {\n this.hasName = n;\n }\n \n makeFriend(demo:Human h) {\n if(h != this)\n this.hasFriend =+ h;\n }\n \n setName(xsd:string n) {\n this.hasName = n;\n }\n }\n \n\nWhile the Human class declaration in Java and in Neno are nearly identical,\nthere are a few constructs that make the two languages different. For one,\ninstead of “importing” packages, in Neno, namespaces are declared and\nontologies are imported.111111Note that languages such as Java and C++ do\nmaintain the concept of package namespaces. To ease namespace declarations,\nprefixes are used (e.g. owl, xsd, and demo). All constructors are denoted by\nthe class name prefixed by the ! symbol. Similarly, though not in the above\nexample, all destructors are denoted by the class name prefixed by the `~`\nsymbol. Notice that all datatype primitives (e.g. xsd:string) are from the XSD\nnamespace. The Fhat RVM is engineered specifically for these datatypes.\nPerhaps the most unique aspect of the Neno language is the cardinality\nrestriction specifier in the field declaration (e.g. [0..1]). Because Neno was\ndesigned for a semantic network substrate, there is nothing that prevents the\nsame property (i.e. field) to point to multiple different URIs. In order to\ndemand that there exist no more than one field, the [0..1] notation is used.\nNote that demo:Human is an rdfs:subClassOf owl:Thing as specified by the\nowl:Thing demo:Human class description. Class inheritance is specified by the\nprefix to the declaration of the class name. Note that in Neno, a class can\nonly have a single parent even though OWL supports multiple-\ninhertiance.121212This constraint does not apply to owl:Restrictions as Neno\nclasses utilize owl:Restrictions to make explicit property restrictions. Thus,\nexcluding owl:Restriction subclassing, a Neno object class can only be the\nsubclass of a single class. Furthermore, note that all class properties have a\nuniversal restriction on the class or datatype value. For example, in the\nabove demo:Human class, the hasName property must have an xsd:string value and\nall hasFriend properties must have demo:Human values.\n\nIn order to demonstrate the relationship between Neno source code and its\ncompiled OWL API, the following simple class example is presented. The class\n\n \n \n \n prefix owl: <http://www.w3.org/2002/07/owl>;\n prefix xsd: <http://www.w3.org/2001/XMLSchema>;\n prefix demo: <http://neno.lanl.gov/demo>;\n \n owl:Thing demo:Example {\n xsd:integer t[0..1];\n \n test(xsd:integer n) {\n for(xsd:integer i=0; i < n; i++) {\n this.t = this.t + 1;\n }\n }\n }\n \n \n\nhas the following OWL RDF/XML representation:\n\n \n \n <rdf:RDF\n xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\n xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\"\n xmlns:owl=\"http://www.w3.org/2002/07/owl#\">\n <owl:Ontology rdf:about=\"http://neno.lanl.gov\"/>\n <owl:Ontology rdf:about=\"http://neno.lanl.gov/demo\">\n <owl:imports rdf:resource=\"http://neno.lanl.gov\"/>\n </owl:Ontology>\n ...\n <!-- A PUSHVALUE INSTRUCTION -->\n \n <owl:Class rdf:about=\"http://neno.lanl.gov/demo#2271ea72-877c-4090-9f89-...\">\n <rdfs:subClassOf rdf:resource=\"http://neno.lanl.gov#PushValue\"/>\n <rdfs:subClassOf>\n <owl:Restriction>\n <owl:onProperty rdf:resource=\"http://neno.lanl.gov#hasValue\"/>\n <owl:allValuesFrom>\n <owl:Class rdf:about=\"http://neno.lanl.gov/demo#9792cc3c-5600-4660-...\"/>\n </owl:allValuesFrom>\n </owl:Restriction>\n </rdfs:subClassOf>\n <rdfs:subClassOf>\n <owl:Restriction>\n <owl:onProperty rdf:resource=\"http://neno.lanl.gov#nextInst\"/>\n <owl:allValuesFrom>\n <owl:Class rdf:about=\"http://neno.lanl.gov/demo#a80ba54c-5344-4df1-...\"/>\n </owl:allValuesFrom>\n </owl:Restriction>\n </rdfs:subClassOf>\n </owl:Class>\n \n <!-- THE PUSHED VALUE -->\n \n <owl:Class rdf:about=\"http://neno.lanl.gov/demo#9792cc3c-5600-4660-bc1f-...\">\n <rdfs:subClassOf rdf:resource=\"http://neno.lanl.gov#LocalDirect\"/>\n <rdfs:subClassOf>\n <owl:Restriction>\n <owl:hasValue rdf:datatype=\"http://www.w3.org/2001/XMLSchema#integer\"\n >1</owl:hasValue>\n <owl:onProperty rdf:resource=\"http://neno.lanl.gov#hasURI\"/>\n </owl:Restriction>\n </rdfs:subClassOf>\n </owl:Class>\n \n <!-- THE NEXT INSTRUCTION AFTER THE PUSHVALUE INSTRUCTION: AN ADD INSTRUCTION -->\n \n <owl:Class rdf:about=\"http://neno.lanl.gov/demo#a80ba54c-5344-4df1-91a0-...\">\n <rdfs:subClassOf rdf:resource=\"http://neno.lanl.gov#Add\"/>\n <rdfs:subClassOf>\n <owl:Restriction>\n <owl:onProperty rdf:resource=\"http://neno.lanl.gov#hasLeft\"/>\n <owl:allValuesFrom rdf:resource=\"http://neno.lanl.gov/demo#4c715d16-b6e6-...\"/>\n </owl:Restriction>\n </rdfs:subClassOf>\n <rdfs:subClassOf>\n <owl:Restriction>\n <owl:onProperty rdf:resource=\"http://neno.lanl.gov#hasRight\"/>\n <owl:allValuesFrom rdf:resource=\"http://neno.lanl.gov/demo#fdde7f6f-b9c0-...\"/>\n </owl:Restriction>\n </rdfs:subClassOf>\n <rdfs:subClassOf>\n <owl:Restriction>\n <owl:onProperty rdf:resource=\"http://neno.lanl.gov#nextInst\"/>\n <owl:allValuesFrom rdf:resource=\"http://neno.lanl.gov/demo#e3b8a797-849b-...\"/>\n </owl:Restriction>\n </rdfs:subClassOf>\n </owl:Class>\n ...\n </rdf:RDF>\n \n \n\nThe most important idea to take away from the above Fhat OWL API subset is\nthat the role of the compiler is to generate UUID-named instruction classes\nthat are subclasses of particular Fhat instructions (e.g. PushValue). These\ngenerated instruction classes have owl:Restrictions on them that ensure that\ninstances of these classes are connected to one another in an unambiguous way\n(e.g. owl:Restrictions on their respective nextInt property) and that their\noperand values are made explicit (e.g. owl:Restrictions on their respective\noperand properties). This unambiguous instantiation is the RDF triple-code\nthat is created when a Fhat RVM instantiates the API.\n\nFor example, in the above Fhat OWL API snippet, any demo:2271ea72 PushValue\ninstruction instance must have one and only one hasValue property. The value\nof that property must be a demo:9792cc3c LocalDirect value with a hasURI\nproperty value of \"1\"∧∧<xsd:integer>. The instance of demo:2271ea72 must also\nhave a nextInst property that is of rdf:type demo:a80ba54c, where\ndemo:a80ba54c is an rdfs:subClassOf Add. An instance of this demo:a80ba54c Add\ninstruction instructs the Fhat RVM to add its hasLeft operand and its hasRight\noperands together. This demo:a80ba54c Add also has a nextInst property value\nthat must be an instance of demo:e3b8a797. Though not shown, the demo:e3b8a797\nis an rdfs:subClassOf Set. In this way, through strict owl:Restrictions, the\nflow of triple-code can be generated in an unambiguous manner by the Fhat RVM.\n\nThe remainder of this section will go over the more salient aspects of the\nNeno programming language.\n\n#### 3.2.1 Declaring Namespaces\n\nNamespaces promote the distributed nature of the Semantic Web by ensuring that\nthere are no URI name conflicts in the ontologies and instances of different\norganizations ( ?). The Java language has a similar construct called\npackaging. The package specification in Java supports organizational\nnamespacing. Neno supports the prefixing of namespaces. For example,\ndemo:Human resolves to\n\n$\\texttt{http://neno.lanl.gov/demo\\\\#Human}.$\n\n#### 3.2.2 Datatypes\n\nFhat is engineered to handle xsd:anySimpleType and provides specific support\nfor any of its derived types ( ?). The XSD namespace maintains, amongst\nothers: xsd:string, xsd:double, xsd:integer, xsd:date, etc. Example operations\ninclude,\n\n \n \n \n \"neno\"^^xsd:string + \"fhat\"^^xsd:string\n \"2007-11-30\"^^xsd:date < \"2007-12-01\"^^xsd:date\n \"1\"^^xsd:integer - \"0\"^^xsd:integer\n \n \n\nNeno has low-level support for high-level datatype manipulations such as\nstring concatenation, data and time comparisons, date incrementing, etc.\nExactly what operations are allowed with what datatypes will be discussed\nlater when describing the Fhat instruction set.\n\n#### 3.2.3 The this Variable\n\nThe this variable is used in many object-oriented languages to specify the\nfield to be accessed or the method to be invoked. All methods inherently have\nthis as a variable they can use. The same construct exists in Neno with no\nvariation in meaning.\n\n#### 3.2.4 Field Cardinality\n\nWhile Neno is an object-oriented language, it is also a semantic network\nprogramming language. Neno is more in line with the concepts of RDF than it is\nwith those of Java and C++. One of the major distinguishing features of an\nobject in Neno is that objects can have multi-instance fields. This means that\na single field (predicate) can have more than one value (object). For\ninstance, in Java\n\n \n \n \n Human marko = new Human(\"Marko Rodriguez\");\n marko.setName(\"Marko Antonio Rodriguez\");\n \n \n\nwill initially set the hasName field of the Human object referenced by the\nvariable name marko to “Marko Rodriguez”. The invocation of the setName method\nof marko will replace “Marko Rodriguez” with “Marko Antonio Rodriguez”. Thus,\nthe field hasName has a cardinality of 1. All fields in Java have a\ncardinality of 1 and are universally quantified for the specified class\n(though taxonomical subsumption is supported).\n\nIn Neno, it is possible for a field to have a cardinality greater than one. In\nNeno, when a class’ fields are declared, the cardinality specifier is used to\ndenote how many properties of this type are allowed for an instance of this\nclass. Thus, in the Neno code at the start of this section,\n\n \n \n \n xsd:string hasName[1];\n \n \n\nstates that any Human object must have one and only one field (property) called hasName and that hasName field points to some xsd:string. Therefore, it is illegal for the Fhat RVM to add a new hasName property to the class marko. The original property must be removed before the new property can be added. The general grammar for field restrictions in Neno is [# (..(# | *))], where # refers to some integer value.\n\nNeno does not adopt any of the OWL semantics regarding cardinality and\n“semantically distinct” resources. The owl:sameAs relationship between\nresources is not considered when determining the cardinality of a property and\nthus, only the explicit number of properties (explicit triples) of a\nparticular type (predicate) are acknowledged by the NenoFhat compiler and Fhat\nRVM.\n\n#### 3.2.5 Handling Fields\n\nNeno provides the following field and local variable operators: =+, =-, =/,\nand =. These operators are called “set plus”, “set minus”, “set clear”, and\n“set”, respectively. The definition of these operators is made apparent\nthrough examples that demonstrate their use. For instance, from the class\ndeclarations above, the Human class has the field hasFriend. For the Java\nexample, the hasFriend field can have more than one Human value only\nindirectly through the use of the ArrayList<Human> class. In Neno, no\nArrayList<Human> is needed because a field can have a cardinality greater than\n1. The cardinality specifier [0..*] states that there are no restrictions on\nthe number of friends a Human can have. In order to add more friends to a\nHuman object, the =+ operator is used. If the Human instance has the URI\nurn:uuid:2db4a1d2 and the provided Human argument has the URI\nurn:uuid:47878dcc then the =+ operator instructs Fhat to execute\n\n \n \n \n INSERT { <urn:uuid:2db4a1d2> <demo:hasFriend> <urn:uuid:47878dcc> .}\n \n \n\non the triple-store. On the other hand, if the = operator was used, then Fhat\nwould issue the following commands to the triple-store:\n\n \n \n \n DELETE { <urn:uuid:2db4a1d2> <demo:hasFriend> ?x .}\n INSERT { <urn:uuid:2db4a1d2> <demo:hasFriend> <urn:uuid:47878dcc> .}\n \n \n\nFor a multi-instance field, the $=$ is a very destructive operator. For a\n[0..1] or [1] field, = behaves as one would expect in any other object-\noriented language. Furthermore, for a [0..1] or [1] field, =+ is not allowed\nas it will cause the insertion of more than one property of the same\npredicate.\n\nIn order to control the removal of fields from a multi-instance field, the =-\nand =/ operators can be used. For example, suppose the following method\ndeclaration in Neno\n\n \n \n \n makeEnemy(Human h) {\n this.hasFriends =- h;\n }\n \n \n\nThe makeEnemy method will remove the Human object identified by the variable\nname h from the hasFriend fields. If the h variable is a reference to the URI\nurn:uuid:4800e2c2, then at the Fhat level, Fhat will execute the following\ncommand on the triple-store:\n\n \n \n \n DELETE { <urn:uuid:2db4a1d2> <demo:hasFriend> <urn:uuid:4800e2c2> .}\n \n \n\nFinally, assume that there is a rogue Human that wishes to have no friends at\nall. In order for this one man army to sever his ties, the $=/$ operator is\nused. Assume the following overloaded method declaration for a Human.\n\n \n \n \n makeEnemy() {\n this.hasFriends =/;\n }\n \n \n\nThe above statement statement would have Fhat execute the following delete\ncommand on the triple-store:\n\n \n \n \n DELETE { <urn:uuid:2db4a1d2> <demo:hasFriend> ?human }\n \n \n\n#### 3.2.6 Field Querying\n\nIn many cases, a field (i.e. property) will have many instances. In computer\nprogramming terms, fields can be thought of as arrays. However, these “arrays”\nare not objects, but simply greater than one cardinality fields. In Java,\narrays are objects and high-level array objects like the java.util.ArrayList\nprovide functions to search an array. In Neno, there are no methods that\nsupport such behaviors since fields are not objects. Instead, Neno provides\nlanguage constructs that support field querying. For example, suppose the\nfollowing method\n\n \n \n \n boolean isFriend(Human unknown) {\n if(this.hasFriend =? unknown) {\n return true;\n }\n else {\n return false;\n }\n }\n \n\nIn the above isFriend method, the provided Human argument referenced by the\nvariable name unknown is checked against all the hasFriend fields. Again, the\nowl:sameAs property is not respected and thus, “sameness” is determined by\nexact URIs. The =? operator is a conditional operator and thus, always returns\neither \"true\"∧∧xsd:boolean or \"false\"∧∧xsd:boolean. At the Fhat level, if this\nreferences the UUID urn:uuid:2d386232 and unknown references\nurn:uuid:75e05c12, then the Fhat RVM executes the following query on the\ntriple-store:\n\n \n \n \n ASK { <urn:uuid:2d386232> <demo:hasFriend> <urn:uuid:75e05c12> . }\n \n \n\nSimilarly, imagine the following method,\n\n \n \n \n boolean isFriendByName(Human unknown) {\n if(this.hasFriend.hasName =? unknown.hasName) {\n return true;\n }\n else {\n return false;\n }\n }\n \n\nAssuming the same UUID references for this and unknown from previous examples,\nthe =? operation would have the Fhat execute the following query on the RDF\nnetwork\n\n \n \n \n ASK { <urn:uuid:2d386232> <demo:hasFriend> ?x .\n ?x <demo:hasName> ?y .\n <urn:uuid:75e05c12> <demo:hasName> ?y }\n \n \n\nAgain, there is no reasoning involved in any of these triple-store operations;\nonly “raw” triple and URI/literal matching is used.\n\n#### 3.2.7 Looping and Conditionals\n\nLooping and conditionals are nearly identical to the Java language. In Neno,\nthere exists the for, while, and if/else constructs. For example, a for\nstatement is\n\n \n \n \n for(xsd:integer i = \"0\"^^xsd:integer; i<\"10\"^^xsd:integer; i++)\n { /* for block */ }\n \n \n\na while statement is\n\n \n \n \n while(xsd:integer i < \"10\"^^xsd:integer)\n { /* while block */ }\n \n \n\nand an if/else statement is\n\n \n \n \n if(xsd:integer i < \"10\"^^xsd:integer)\n { /* if block */ }\n { /* else block */}\n \n \n\nIt is important to note that these statements need not have the literal type\nspecifier (e.g. xsd:integer) on every hardcoded literal. The literal type can\nbe inferred from its context and thus, is automatically added by the compiler.\nFor example, since i is an xsd:integer, it is assumed that $10$ is also.\n\n#### 3.2.8 Field Looping\n\nIn many cases it is desirable to loop through all the resources of a field for\nthe purposes of searching or for manipulating each resource. For instance,\nsuppose the following Human method:\n\n \n \n \n namelessFaces() {\n for(Human h : this.hasFriend) {\n h.hasName = \"...\"^^xsd:string;\n }\n for(xsd:integer i=0; i<this.hasFriend*; i++) {\n Human h = this.hasFriend[i];\n h.hasName = \".\"^^xsd:string;\n }\n }\n \n \n\nThe above namelessFaces method demonstrates two types of field looping\nmechanisms offered by Neno. The first is analogous to the Java 1.5 language\nspecification. With the first for loop, the variable h is set to a single\nhasFriend of this. The second for loop uses the index i that goes from index 0\nto the size of the “array” (this.hasFriend*). The * notation in this context\nreturns the number of hasFriend properties of the this object. In other words\n* returns the cardinality of the this.hasFriend field.\n\nFinally, as field values are not stored in a vector, but instead as an\nunordered set, the field “arrays” in Neno are not guaranteed to be ordered.\nThus, this.hasFriend[1] may not be the same value later in the code. Ordering\nis dependent upon the triple-store’s indexing algorithm and stability of a\nparticular order is dependent upon how often re-indexing occurs in the triple-\nstore. It is worth noting that higher-order classes can be created such as\nspecialized rdf:Seq and rdf:List classes to provided ordered support for\narrays.\n\n#### 3.2.9 Type Checking\n\nThe typeof operator can be used to determine the class type of a URI. For\ninstance, the following statement,\n\n \n \n \n xsd:boolean isType = urn:uuid:2db4a1d2 typeof Human\n \n \n\nwould return true if urn:uuid:2db4a1d2 is rdf:type Human or rdf:type of some\nclass that is an rdfs:subClassOf Human. Also,\n\n \n \n \n xsd:boolean isType = urn:uuid:2db4a1d2 typeof rdfs:Resource\n \n \n\nalways returns true. Thus, RDFS subsumption semantics are respected and thus,\nNeno respects the subclassing semantics employed by modern objected-oriented\nlanguages. Similarly the typeOf? operator returns the type of the resource.\nFor instance,\n\n \n \n \n xsd:anyURI type = urn:uuid:2db4a1d2 typeof?\n \n \n\nreturns http://neno.lanl.gov/demo#Human.\n\n#### 3.2.10 Inverse Field Referencing\n\nIn object-oriented languages the “dot” operator is used to access a method or\nfield of an object. For instance, in this.hasName, on the left of the “dot” is\nthe object and on the right of the “dot” is the field. Whether the right hand\nside of the operator is a field or method can be deduced by the compiler from\nits context. If this resolves to the URI urn:uuid:2db4a1d2, then the following\nNeno code\n\n \n \n \n Human h[0..*] = this.hasFriend;\n \n \n\nwould instruct Fhat to execute the following query:\n\n \n \n \n SELECT ?h\n WHERE { <urn:uuid:2db4a1d2> <demo:hasFriend> ?h . }\n \n \n\nAccording to the previous query, everything that binds to ?h will be set to\nthe variable h. The above query says “locate all Human hasFriends of this\nobject.” However, Neno provides another concept not found in other object-\noriented languages called the “dot dot” operator. The “dot dot” operator\nprovides support for what is called inverse field referencing (and inverse\nmethod invocation discussed next). Assume the following line in some method of\nsome class,\n\n \n \n \n Human h[0..*] = this..hasFriend;\n \n \n\nThe above statement says, “locate all Humans that have this object as their\nhasFriend.” At the Fhat level, Fhat executes the following query on the\ntriple-store:\n\n \n \n \n SELECT ?h\n WHERE { ?h <demo:hasFriend> <urn:uuid:2db4a1d2> .}\n \n \n\nFurthermore, if the statement is\n\n \n \n \n Human h[0..3] = this..hasFriend;\n \n \n\nFhat would execute:\n\n \n \n \n SELECT ?h\n WHERE { ?h <demo:hasFriend> <urn:uuid:2db4a1d2> .} LIMIT 3\n \n \n\n#### 3.2.11 Inverse Method Invocation\n\nLike inverse field referencing, inverse method invocation is supported by\nNeno. Inverse method invocation will invoke all the methods that meet a\nparticular requirement. For instance,\n\n \n \n \n this..hasFriend.makeEnemy(this);\n \n \n\nwill ensure that all objects that have this as their friend are no longer\nfriends with this.\n\n#### 3.2.12 Variable Scoping\n\nVariable scoping in Neno is equivalent to Java. For example, in\n\n \n \n \n xsd:integer a = \"11\"^^xsd:integer;\n if(a < \"10\"^^xsd:integer) {\n xsd:integer b = \"2\"^^xsd:integer;\n }\n else {\n xsd:integer c = \"3\"^^xsd:integer;\n }\n \n \n\nthe true and false block of the if statement can read the variable a, but the\ntrue block can not read the c in the false block and the false block can not\nread the b in the true block. Also, methods are out of scope from one another.\nThe only way methods communicate are through parameter passing, return values,\nand object manipulations.\n\n#### 3.2.13 Constructors and Destructors\n\nConstructors and destructors are used in object-oriented languages to create\nand destroy object, respectively. The concept of a constructor in Neno is\nsimilar to that of Java and C++. The concept of a destructor does not exist in\nJava, but does in C++. It is very important in Neno to provide the programmer\nan explicit way of performing object destruction. Again, unlike Java, Neno is\nintended to be used on a persistent semantic network substrate. Thus, when a\nFhat stops executing or an object is no longer accessible by a Fhat, that\nobject should not be automatically removed. In short, Fhat does not provide\nautomatic garbage collection ( ?). It is the role of the programmer to\nexplicitly remove all unwanted objects from the RDF network.\n\nIn order to create a new object, the constructor of a class is called using\nthe new operator. For example,\n\n \n \n \n Human marko = new Human(\"Marko\"^^xsd:string);\n \n \n\nwill generate a sub-network in the RDF network equivalent to Figure 4.\n\nFigure 4: A Fhat instance maintains a variable reference to an object.\n\nThe algorithm by which Fhat creates the RDF sub-network will be discussed in\nthe next section. For now, understand that in the variable environment of a\nFhat instance there exists a variable named marko that points to the newly\ncreated Human instance (e.g.\n$\\langle\\texttt{marko},\\texttt{rdf:type},\\texttt{Human}\\rangle$).\n\nA destructor will instruct Fhat to destroy an object. A destructor is\nspecified in the class declaration. For instance, suppose the following\nspecification for demo:Human:\n\n \n \n \n Thing Human {\n string hasName[1];\n Human hasFriend[0..*];\n \n !Human(string n) {\n this.hasName = n;\n }\n \n ~Human() {\n this.hasName =/\n this.hasFriend =/\n this..hasFriend =/\n }\n }\n \n \n\nIn the above class declaration !Human(string n) is a constructor and\n`~`Human() is a destructor. A destructor is called using the delete operator.\nFor instance,\n\n \n \n \n delete marko;\n \n \n\ncalls marko’s `~`Human() destructor.\n\nA class can only have at most one destructor and the destructor takes no\narguments. The `~`Human() destructor removes the reference to the object’s\nname, removes all the references to the object’s friends, and removes all\nhasFriend references to that object. Thus, if the Human object has the URI\nurn:uuid:55b2a3b0, Fhat would execute the following commands on the triple-\nstore:\n\n \n \n \n DELETE { <urn:uuid:55b2a3b0> <demo:hasName> ?name .}\n DELETE { <urn:uuid:55b2a3b0> <demo:hasFriend> ?human .}\n DELETE { ?human <demo:hasFriend> <urn:uuid:55b2a3b0> .}\n \n \n\nBehind the scenes, Fhat would also remove all the method references of\nurn:uuid:55b2a3b0, internal variable references to urn:uuid:55b2a3b0, and the\nrdf:type relationships that relate the object to the ontological-layer. When\nan object is properly destroyed, only its instance is removed from the RDF\nnetwork. The object’s class specification still exists in the ontological-\nlayer.\n\n#### 3.2.14 General Query\n\nIn many instances, Fhat will not have a reference to a particular object.\nAgain, the environment anticipated is one in which objects persist in the RDF\nnetwork. Thus, when code is executed, it is necessary to locate the URI of a\nparticular object for processing. In order to make this easy for the\nprogrammer, a query operator is defined called the “network query” operator\nand is denoted by the symbol <?. For example,\n\n \n \n \n xsd:string x = \"Marko Antonio Rodriguez\"^^xsd:string;\n xsd:string query =\n \"SELECT ?x WHERE { ?x <demo:hasName> <\" + x + \"> }\n LIMIT 1\"^^xsd:string;\n Human h[0..1] <? query;\n \n \n\nwill query the RDF network for at most one Human named “Marko Antonio\nRodriguez”. Note that three statements above could have been written as one.\nHowever, to demonstrate string concatenation and variable use, three were\nused.\n\n### 3.3 Starting a Program in Neno\n\nIn Neno, there are no static methods. Thus, there does not exist something\nlike the public static void main(String[] args) method in Java. Instead, Fhat\nis provided a class URI and a method for that class that takes no arguments.\nThe class is automatically instantiated by Fhat and the specified no-argument\nmethod is invoked. For example, if Fhat is pointed to the following Test class\nand main method, then the main method creates a Human, changes its name, then\nexits. When main exits, Fhat halts.\n\n \n \n \n owl:Thing demo:Test {\n main() {\n demo:Human h = new Human(\"Marko Rodriguez\");\n h.setName(\"Marko Antonio Rodriguez\");\n }\n }\n \n \n\n### 3.4 Typical Use Case\n\nThis section describes how a developer would typically use the Neno/Fhat\nenvironment. The terminal commands below ensure that the NenoFhat compiler\ntranslates Neno source code to a Fhat OWL API, loads the Fhat OWL API into the\ntriple-store, instantiates a Fhat RVM, and points the RVM to the demo:Test\nclass with a main method. Note that the third command is broken into four\nlines for display purposes. Do not assume that there is a newline character at\nthe end of the first three lines of the third statement.\n\n \n \n \n > nenofhat Human.neno -o ntriple -t http://www.triplestore.net/sparql\n > nenofhat Test.neno -o xml -t http://www.triplestore.net/sparql\n > fhat -vmc http://neno.lanl.gov/neno#Fhat\n -c http://neno.lanl.gov/neno/demo#Test\n -cm main\n -t http://www.triplestore.net/sparql\n \n \n\nThe first terminal command compiles the Human.neno source code into a Fhat OWL\nAPI represented in N-TRIPLE format and then inserts the Human.ntriple triples\ninto the triple-store pointed to by the “-t” URL. The second terminal command\ncompiles the Test.neno source code and generates a Fhat OWL API in RDF/XML\ncalled Test.xml. That RDF/XML file is then loaded into the triple-store. The\nnenofhat compiler can produce any of the popular RDF syntaxes. While in most\ncases, one or another is chosen, two different syntaxes are shown to\ndemonstrate what is possible with the compiler. Finally, a Fhat processor is\ninitiated. The virtual machine process (fhat) is called with a pointer to an\nontological model of the desired machine architecture. The machine\narchitecture is instantiated. The instantiated Fhat then instantiates a Test\nobject and calls its main method. The instantiated Test main method is\nexecutable RDF triple-code.\n\nIn some instances, a Fhat RVM state may already exist in the triple-store. In\nsuch cases, the following command can be invoked to point the Fhat RVM process\nto the stored RVM state. In the example below, assume that urn:uuid:60ab17c2\nis of rdf:type Fhat.\n\n \n \n \n > fhat -vmi urn:uuid:60ab17c2 -t http://www.triplestore.net/sparql\n \n \n\nWhen the Fhat RVM state is located, fhat processes the current instruction\npointed to by its programLocation.\n\nThe following list outlines the flags for the nenofhat compiler,\n\n * •\n\n-o : output type (ntriple $|$ n3 $|$ xml)\n\n * •\n\n-t : triple-store interface\n\nand the fhat RVM process,\n\n * •\n\n-vmi : virtual machine instance URI\n\n * •\n\n-vmc : virtual machine class URI\n\n * •\n\n-c : start class URI\n\n * •\n\n-cm : start class no-argument method\n\n * •\n\n-t : triple-store interface.\n\n## 4 The Fhat Virtual Machine Architecture\n\nFhat is an RVM that was specifically designed for RDF-based semantic network\nlanguages. Fhat is a semi-hard implementation of a computing machine. Table 5\npresents an explanation of the various levels of virtual machine\nimplementations. The concept of soft, semi-hard, and hard implementations are\ndeveloped here and thus, are not part of the common lexicon. In the JVM, all\nof the “hardware” components are represented in software and the state of the\nmachine is not saved outside the current run-time environment. For VHSIC\nHardware Description Language (VHDL) machines, the hardware components are\nmodeled at the level of logic gates (AND, OR, XOR, NOT, etc.) ( ?). In Fhat,\nthe hardware components are modeled in RDF (the state), but component\nexecution is modeled in software (the process).\n\nimplementation type | requirements | example \n---|---|--- \nsoft | hardware methods | Java Virtual Machine, r-Fhat \nsemi-hard | high-level components | Fhat \nhard | low-level components | VHDL designs \nTable 5: Different VM implementation types, their requirements, and an\nexample.\n\nThere are many reasons why a semi-hard implementation was desired for Fhat and\nthese reasons will be articulated in the sections discussing the various\ncomponents of the Fhat architecture. However, while this section presents the\nsemi-hard implementation, a soft implementation of Fhat called reduced Fhat\n(r-Fhat) will be briefly discussed. In short, r-Fhat is faster than the Fhat\nvirtual machine, but does not support run-time machine portability and\nmachine-level reflection. In other words, r-Fhat does not support those\nfunctions that require an RDF representation of the machine state.\n\nAny high-level language can be written to take advantage of the Fhat\narchitecture. While Neno and Fhat were developed in concert and thus, are\nstrongly connected in their requirements of one another, any language that\ncompiles to Fhat RDF triple-code can use a Fhat RVM. This section will discuss\nthe Fhat RVM before discussing the Fhat instruction set. Figure 5 presents the\nFhat machine architecture. This machine architecture is represented in OWL and\nis co-located with other resources in the ontology layer of the RDF network.\n\nFigure 5: The ontological model of the Fhat virtual machine.\n\nThere are $8$ primary components to the Fhat RVM. These are enumerated below\nfor ease of reference. Each component will be discussed in more detail in the\nfollowing subsections.\n\n 1. 1.\n\nFhat: the CPU that interprets instructions and uses its various components for\nprocessing those instructions.\n\n 2. 2.\n\nhalt: suspends Fhat processing when false, and permits processing when true.\n\n 3. 3.\n\nmethodReuse: determines whether or not method triple-code is reused amongst\nobject instances.\n\n 4. 4.\n\nprogramLocation: a pointer to the current instruction being executed (i.e. a\nPC).\n\n 5. 5.\n\nBlockStack: an rdf:List that can be pushed and popped for entering and exiting\nblocks.\n\n 6. 6.\n\nOperandStack: an rdf:List that can be pushed and popped for arithmetic\ncomputations.\n\n 7. 7.\n\nFrame: a Method unique environment for storing local variables.\n\n 8. 8.\n\nReturnStack: an rdf:List that provides a reference to the instruction that\ncalled a method and the frame of that method.\n\nWhile all of these components are represented in RDF, only Fhat has an\nexternal software component. The software implementation of Fhat is called the\n“virtual machine process” in Figure 3.131313When the term Fhat is used, it is\nreferring to the entire virtual machine, when the teletyped term Fhat is used,\nit is referring to the virtual machine process identified by the URI Fhat.\n\n#### 4.0.1 Fhat\n\nFhat is the primary component of the Fhat RVM. Fhat is the most complicated\ncomponent in the entire Fhat architecture. The high-level Neno pseudo-code for\nthe Fhat component is\n\n \n \n \n Thing Fhat {\n execute() {\n while(!this.halt && this.programLocation != null) {\n Instruction i = this.programLocation\n if(i typeof Block) { ... }\n else if(i typeof If) { ... }\n else if(i typeof Expression) { ... }\n else if(i typeof Set) { ... }\n ...\n /* update programLocation */\n }\n }\n }\n \n \n\nThe above pseudo-code should be implemented in the language of the virtual\nmachine process and thus, for the executing hardware CPU.\n\nIt is worth noting that a Fhat virtual machine process can be written in Neno\nas demonstrated in the Neno code above. For example, assume a Neno implemented\nFhat instance called Fhat1. In such cases, another Fhat, called Fhat2, is\nprocessing Fhat1. Fhat2 can be run on yet another Fhat, called Fhat3, or\ngrounded into some other language that is translating code to the native\nmachine language. This is possible because Neno/Fhat is Turing complete and\nthus, can run a simulation of itself. When a simulation of itself is run, a\ncomplete RDF virtual machine is created. In this simulation environment, both\nthe state and process of the Fhat RVM are represented in RDF.\n\nThe current version of Fhat supports most common uses of the xsd:anySimpleType\nand a few of these uses are summarized below:\n\n * •\n\nxsd:boolean: Not, Equals\n\n * •\n\nxsd:integer, xsd:float, xsd:double: Arithmetic, Compare\n\n * •\n\nxsd:string: Add, Compare\n\n * •\n\nxsd:date, xsd:dateTime: Add, Subtract, Compare\n\n * •\n\nxsd:anyURI: Compare.\n\n#### 4.0.2 halt\n\nAt any time, Fhat can be forced to halt by setting the halt property of Fhat\nto true∧∧xsd:boolean. Multi-threading can be simulated in this way. A Neno\nprogram can be engineered to run a master Fhat that has a reference to the\nhalt property of all its slave Fhats. By setting the halt property, the Fhat\nmaster can control which Fhat slaves are able to process at any one time. In\nessence, the master Fhat serves as an operating system.\n\n#### 4.0.3 methodReuse\n\nWhen methodReuse is set to true∧∧xsd:boolean, Fhat will instantiate new\nobjects with unique instructions for each method. When methodReuse is set to\nfalse∧∧xsd:boolean, Fhat will reuse method triple-code amongst the same\nmethods for the different objects. This will be discussed in more detail in\n§5.2.\n\n#### 4.0.4 programLocation\n\nThe programLocation is a pointer to the current instruction being executed by\nFhat. Fhat executes one instruction at a time and thus, the programLocation\nmust always point to a single instruction. The “while” loop of Fhat simply\nmoves the programLocation from one instruction to the next. At each\ninstruction, Fhat interprets what the instruction is (by its rdf:type\n“opcode”) and uses its various components appropriately. When there are no\nmore instructions (i.e. when there no longer exists a programLocation\nproperty), Fhat halts.\n\n#### 4.0.5 BlockStack\n\nThe BlockStack is important for variable setting. When a new variable is\ncreated in a block of code, it is necessary to associate that variable with\nthat block. When the thread of execution exits the block, all variables\ncreated in that block are dereferenced (i.e. deallocated).\n\n#### 4.0.6 OperandStack\n\nThe OperandStack is a LIFO (i.e. “last in, first out”) stack that supports any\nrdfs:Resource. The OperandStack is used for local computations such as x = 1 +\n(2 * 3). For example, when x = 1 + (2 * 3) is executed by Fhat, Fhat will\n\n 1. 1.\n\npush the value 1 on the OperandStack\n\n 2. 2.\n\npush the value 2 on the OperandStack\n\n 3. 3.\n\npush the value 3 on the OperandStack\n\n 4. 4.\n\npop both 2 and 3 off the OperandStack, multiply the two operands, and push the\nvalue 6 on the OperandStack\n\n 5. 5.\n\npop both 1 and 6 the OperandStack, add the two operands, and push the value 7\non the OperandStack\n\n 6. 6.\n\nset the current Frame FrameVariable x to the value $7$ popped off the\nOperandStack.\n\nThe Neno statement x = 1 + (2 * 3) is actually multiple instructions when\ncompiled to Fhat triple-code. The NenoFhat compiler would translate the\nstatement to the triple-code represented in Figure 6.\n\nFigure 6: The triple-code representation of the statement x = 1 + (2 * 3).\n\nIt is very important to represent such components as the OperandStack\ncomponent in RDF and not simply in the memory of the host CPU. Suppose that a\nFhat instance is to move to another physical machine or, by chance, lose its\nprocess “back-end”. If any of these two scenarios were the case, the state of\nthe machine is always saved in RDF and thus, would simply “freeze” to await\nanother virtual machine process to continue its execution. If the OperandStack\nwas represented in software and thus, in RAM, then when the software halted,\nthe OperandStack would be lost and the state of the machine would be\ninconsistent with its programLocation. With an RDF state, the RAM\nrepresentation of the virtual machine process has a negligible effect on the\nconsistency of the machine.\n\n#### 4.0.7 Frame\n\nFhat is a frame-based processor. This means that each invoked method is\nprovided a Frame, or local environment, for its variables (i.e.\nFrameVariables). Due to how variables are scoped in object-oriented languages\nand because Neno does not support global variables, each method can only\ncommunicate with one another through parameter (i.e. method arguments)\npassing, return value passing, or object manipulations. When method $A$ calls\nmethod $B$, the parameters passed by method $A$ are stored in method $B$’s\nFrame according to the variable names in the method description. For example,\nassume the following method,\n\n \n \n \n xsd:integer methodB(xsd:integer a) {\n return a + \"1\"^^xsd:integer;\n }\n \n \n\nIf method $A$ calls method $B$, with the statement,\n\n \n \n \n xsd:integer x = marko.methodB(\"2\"^^xsd:integer);\n \n \n\nthe value $2$ is placed into the Frame of method $B$ with the associated\nvariable a. Method $B$ adds $1$ to the value and pushes the value $3$ on the\nOperandStack. Method $A$ pops one value off the OperandStack and sets the\nlocal variable x to the value $3$. The OperandStack is used for the placement\nof method return values.\n\n#### 4.0.8 ReturnStack\n\nThe ReturnStack is a LIFO stack that maintains pointers to the return location\nof a method and the method Frame. To support recursion, the ReturnStack\nmaintains a pointer to the specific Frame that is being returned to.\n\nIn order to explain how the ReturnStack is used, an example is provided. When\nmethod $A$ calls method $B$, the next instruction of method $A$ following the\nmethod invocation instruction is pushed onto the ReturnStack. When method $B$\nhas completed its execution (e.g. a return is called), Fhat pops the\ninstruction off the ReturnStack and sets its programLocation to that\ninstruction. In this way, control is returned to method $A$ to complete its\nexecution. When return is called in method $B$, Fhat will delete (i.e.\ndeallocate) all triples associated with the method $B$ Frame. If return has a\nvalue (e.g. return 2), that value is pushed onto the OperandStack for method\n$A$ to use in its computation.\n\n### 4.1 Migrating Fhat Across Different Host CPUs\n\nAn interesting aspect of Fhat is the ability to migrate a Fhat process across\nvarious host CPUs. A Fhat implementation has two primary components: an RDF\nstate representation and a software process. Because both the RDF triple-code\nand the complete state of a Fhat instance is represented in the RDF network,\nit does not matter which Fhat process is executing a particular Fhat state.\nThe Fhat RDF state representation ensures that there are no global variables\nin the software process. The only variables created in the software process\nare local to the instruction being executed. Because there are no global\nvariables in the software process, any software process can execute the Fhat\nRDF state without requiring inter-software process communication. For example,\none host CPU can be running the Fhat software process and halt. Another CPU\ncan then start another Fhat software process that points to the URI of the\noriginally halted Fhat RDF state and continue its execution. This concept is\ndiagrammed in Figure 7 where $n=1$ refers to instruction 1.\n\nFigure 7: Migrating a Fhat execution across multiple host CPUs.\n\nIn principle, each CPU can execute one instruction and then halt. In this way,\nit is possible to migrate the Fhat RVM across different host CPU’s. Thus, if a\nportion of the Semantic Web is needed for a particular computation, it may be\nbest to have the physical computer supporting that RDF sub-network host the\nFhat RVM. Once the Fhat RVM has completed computing that particular RDF sub-\nnetwork, it can halt and another CPU can pick up the process on a yet another\narea of the Semantic Web that needs computing by the Fhat RVM. In this model\nof computing, data doesn’t move to the process, the process moves to the data.\nThis idea is diagrammed in Figure 8, where both triple-store servers have Fhat\nprocess implementations.\n\nFigure 8: Migrating a Fhat state across different triple-stores.\n\n### 4.2 Fhat Reflection\n\nA Fhat RVM and the triple-code that it is executing are in the same address\nspace and thus, can reference one another. It is the UUID address space of\nNeno/Fhat that makes it a unique programming environment in that Neno is not\nonly a completely reflective language, but also that it removes the\nrepresentational stack found in most other programming environments. Language\nreflection means that the program can modify itself during its execution. Many\nscripting languages and even Java (through the java.lang.reflect package)\nsupport language reflection. However, not only does Neno/Fhat support language\nreflection, it also supports machine reflection. A Fhat can modify itself\nduring its execution. There are no true boundaries between the various\ncomponents of the computation. This idea is represented in Figure 9, where a\nFhat RVM has its program counter (programLocation) pointing to a Push\ninstruction. The Push instruction is instructing Fhat to push a reference to\nitself on its operand stack. With a reference to the Fhat instance in the Fhat\noperand stack, Fhat can manipulate its own components. Thus, the Fhat RVM is\nexecuting triple-code that is manipulating itself.\n\nFigure 9: A Fhat processor can process itself.\n\n### 4.3 r-Fhat\n\nWhat has been presented thus far is a semi-hard implementation of Fhat. The\nsemi-hard implementation explicitly encodes the state of a Fhat instance in\nRDF. While this has benefits such as fault tolerance due to virtual machine\nprocess failures, support for distributed computing in the form of processor\nmigration, and support for machine-based evolutionary algorithms, it requires\na large read/write overhead. Each instruction requires the virtual machine\nprocess to explicitly update the virtual machine state. A faster Fhat virtual\nmachine can be engineered that does not explicitly encode the state of the\nmachine in the RDF network. In such cases, the only read/write operations that\noccur are when an object is instantiated, destroyed, or a property\nmanipulated. This faster Fhat is called reduced Fhat (r-Fhat). In r-Fhat, the\noperand stack, return stack, etc. are data structures in the implementing\nlanguage. r-Fhat does not have an OWL machine architecture nor an RDF state.\n\n## 5 The Fhat Instruction Set\n\nIn order for Neno software to run on a Fhat machine instance, it must be\ncompiled to a Fhat OWL API that is compliant with the Fhat instruction set\n(the Fhat OWL API owl:imports the Fhat instruction set ontology). A Fhat RVM\nuses the Fhat OWL API as a “blueprint” for constructing the instance-level\nrepresentation of the RDF triple-code. It is the instance-level triple-code\nthat the Fhat RVM “walks” when a program is executing.\n\n### 5.1 The Method\n\nIn Neno, the only process code that exists is that which is in a Method Block.\nFigure 10 defines the OWL ontology of a Method.\n\nFigure 10: The OWL Method ontology.\n\nA Method has an ArgumentDescriptor that is of rdfs:subClassOf rdf:Seq and a\nreturn descriptor that is of type rdfs:Resource. The sequence of the\nArgumentDescriptor Argument denotes the placement of the Method parameter in\nthe method declaration. For instance,\n\n \n \n \n xsd:integer exampleMethod(xsd:string n, Human h) { ... }\n \n \n\nwould set the object of the hasReturnDescriptor property to the URI\nxsd:integer and the ArgumentDescriptor to the Arguments n (rdf:_1) and h\n(rdf:_2).\n\nThe hasHumanCode property can be used, if desired, to point to the original\nhuman readable/writeable source code that describes that class and its\nmethods. By using the hasHumanCode property, it is possible for “in-network”\nor run-time compiling of source code. In principle, a Neno compiler can be\nwritten in Neno and be executed by a Fhat RVM. The Neno compiler can compile\nthe representation that results from resolving the URI that is the value of\nthe xsd:anyURI.\n\n#### 5.1.1 A Block of Fhat Triple-Code\n\nA Method has a single Block. A Block is an rdfs:subClassOf Instruction and is\ncomposed of a sequence of Instructions. The Instruction sequence is denoted by\nthe nextInst property. The Instruction rdf:type is the “opcode” of the\nInstruction. The set of all Instructions is the instruction set of the Fhat\narchitecture. Figure 11 provides a collection of the super class Instructions\nthat can exist in a Block of code and their relationship to one another.\n\nFigure 11: The OWL ontology for a Block of Instructions.\n\nExamples of these super classes are itemized below.141414Conditions are unique\nin that they have a trueInst and a falseInst property. If the Condition is\ntrue, the next Instruction is the one pointed to by the trueInst property,\nelse the next Instruction is one pointed to by the falseInst property.\n\n * •\n\nArithmetic: Add, Divide, Multiply, Not, Subtract.\n\n * •\n\nCondition: Equals, GreaterThan, GreaterThanEqual, LessThan, LessThanEqual.\n\n * •\n\nSetter: NetQuery, Set, SetClear, SetMinus, SetPlus, SetQuery.\n\n * •\n\nInvoke: Construct, Destruct.\n\nThe Value class has a set of subclasses. These subclasses are itemized below.\n\n * •\n\nDirect: LocalDirect, PopDirect.\n\n * •\n\nVariable: LocalVariable, FieldVariable, ObjectVariable.\n\nWhen a Fhat instance enters a Method it creates a new Frame. When a Variable\nis declared, that Variable is specified in the Frame and according to the\ncurrent Block of the Fhat instance as denoted by Fhat’s blockTop property. A\nBlock is used for variable scoping. When Fhat leaves a Block, it destroys all\nthe FrameVariables in the current Frame that have that Block as their\nfromBlock property (refer to Figure 5). However, entering a new Block is not\nexiting the old Block. Parent Block FrameVariables can be accessed by child\nBlocks. For instance, in the following Neno code fragment,\n\n \n \n \n xsd:integer x = \"1\"^^xsd:integer;\n if(x > 2) {\n xsd:integer y = x;\n }\n else{\n xsd:integer y = x;\n }\n \n \n\nthe two y Variables in the if and else Blocks are two different FrameVariables\nsince they are from different Blocks. Furthermore, note that both the if and\nelse Blocks can access the value of x since they are in the child Block of the\nBlock declaring the variable x. When Fhat leaves a Method (i.e. returns), its\nFrame and its FrameVariables are destroyed through dereferencing.\n\n### 5.2 A Method Instance\n\nThere are two ways in which a Method instance is handled by Fhat: global and\nlocal instance models. In the global instance model, when a new object is\ninstantiated, its methods are also instantiated. However, if the instantiated\nMethod already exists in the RDF network, the newly created object points its\nhasMethod property to a previously created Method of the same hasMethodName\nand UUID. Thus, only one instance of a Method exists for all the objects of\nthe same class type. While it is possible to have a unique Method instance for\neach object, by supporting method reuse amongst objects, Fhat limits the\ngrowth (in terms of the number of triples) in the RDF network. Furthermore,\nthis increases the speed of the Fhat RVM since it does not need to create a\nnew Method from the Fhat OWL API of that Method. The global instance model is\ndiagrammed in Figure 12. To ensure global instances, the methodReuse property\nof the Fhat instance is set to \"true\"∧∧xsd:boolean (refer to Figure 5).\n\nFigure 12: Multiple object’s of the same type will share the same Method\ninstance.\n\nIn the local instance model, the methodReuse property of a Fhat instance is\nset to \"false\"∧∧xsd:boolean. In such cases, a new Method instance is created\nwith each new instance of an owl:Thing. The benefit of this model is that\nmethod reflection can occur on a per-object basis. If an object is to\nmanipulate its Method triple-code at run-time, it can do so without destroying\nthe operation of its fellow owl:Things. The drawback of the local instance\nmodel is triple-store “bloat” and an increase in the time required to\ninstantiate an object relative to the global instance model. The local\ninstance model is diagrammed in Figure 13.\n\nFigure 13: Multiple object’s of the same type each have a unique Method\ninstance.\n\n#### 5.2.1 An Example Method Instance\n\nSuppose the following code,\n\n \n \n \n owl:Thing demo:Human\n {\n xsd:int example(xsd:string a) {\n if(a == \"marko\"^^xsd:string) {\n return \"1\"^^xsd:int;\n }\n else {\n return \"2\"^^xsd:int;\n }\n }\n }\n \n \n\nWhen this code is compiled, it compiles to a Fhat OWL API. When an instance of\ndemo:Human is created, the Fhat RVM will start its journey at the URI\ndemo:Human and move through the ontology creating instance UUID URIs for all\nthe components of the demo:Human class. This includes, amongst its hard-coded\nproperties, its Methods, their Blocks, and their Instructions. When the\ndemo:Human class is instantiated, an instance will appear in the RDF network\nas diagrammed in Figure 14.\n\nFigure 14: The RDF triple-code for the example(xsd:string) method.\n\n## 6 Conclusion\n\nThe primary drawback of the RVM is computing time because a virtual machine\nmust not only read the RDF network to interpret the program instructions, it\nmust also read/write to the RDF network to manipulate data (i.e. instance\nobjects) in the RDF network. Moreover, the virtual machine must read and write\nto that sub-network of the RDF network that represents the virtual machine’s\nstate (e.g. program counter, operand stack, etc.). In doing so, many\nread/write operations occur in order for the virtual machine to compute.\nHowever, much of this issue can be resolved through the use of r-Fhat.\n\nImagine a world where virtual machines are as easy to distribute as an HTML\ndocument (e.g. an RDF/XML encoding of the virtual machine sub-network). Given\nthat a virtualized machine encodes its state in the RDF network, think about\nhow RVMs can “move” between physical machines in mid-execution. There is\ncomplete hardware independence as no physical machine maintains a state\nrepresentation. Physical machines compute the RVM by reading its program\nlocation, its operand stack, its heap, etc. and update those data structures.\nIn such situations, a personal computer can be encoded in the RDF network and\nbe accessed anywhere. Thus, the underlying physical machine is only a hardware\nshell for the more “personal” machine encoded in the RDF network. These ideas\nare analogous to those presented in ( ?).\n\nIn the RDF network, RVMs, APIs, and triple-code are “first-class” web\nentities. What happens when archiving services such as the Internet Archive,\nsearch engine caches, and digital libraries archive such RDF programs and\n“snap-shot” states of the executing RVMs ( ?, ?)? In theory, the state of\ncomputing world-wide, can be saved/archived and later retrieved to resume\nexecution. The issues and novelties that archiving computations presents are\nmany and are left to future work in this area.\n\nMuch of the Semantic Web effort is involved in the distribution of knowledge\nbetween organizational boundaries ( ?). This is perhaps the primary purpose of\nthe ontology. In this respect, organizations of a similar domain should\nutilize shared ontologies in order to make their information useable between\ntheir respective organizations. Procedural encodings support the distribution\nof not only the knowledge models, but also the algorithms that can be applied\nto compute on those models. In a non-disjoint manner, data and code are easily\nexchanged between organizational boundaries ( ?).\n\nGiven that the RDF network is composed of triples and triples are composed of\nURIs and literals, the address space of any virtual machine in the RDF network\nis the set of all URIs and literals. Given that there are no bounds to the\nsize of these resources, there are no realistic space limitations on the RVM.\nIn other words, the amount of disk-space provided world-wide to support the\nSemantic Web is the actual memory constraints of this model. However, the\nsuccess of this distributed computing paradigm relies on the consistent use of\nsuch standards as the Link Data specification ( ?). With further developments\nin Linked Data models and the RVM model of computing, the Semantic Web can be\nmade to behave like a general-purpose computer.\n\n## Acknowledgments\n\nThis research was made possible by a generous grant from the Andrew W. Mellon\nFoundation. Herbert Van de Sompel, Ryan Chute, and Johan Bollen all provided\nmuch insight during the development of these ideas.\n\n## References\n\n * Aasman Aasman, J. (2006). _Allegro graph_ (Tech. Rep. No. 1). Franz Incorporated. \n * Aho, Sethi, & Ullman Aho, A. W., Sethi, R., & Ullman, J. D. (1986). _Compilers: Principles, techniques, and tools._ Addison-Wesley. \n * Alesso & Smith Alesso, H. P., & Smith, C. F. (2005). _Developing Semantic Web services._ Wellesey, MA: A.K. Peters LTD. \n * Beckett Beckett, D. (2001). _N-Triples_ (Tech. Rep.). University of Bristol. \n * Berners-Lee Berners-Lee, T. (1998). _Notation 3_ (Tech. Rep.). World Wide Web Consortium. \n * Berners-Lee Berners-Lee, T. (2006). _Linked data_ (Tech. Rep.). World Wide Web Consortium. \n * Berners-Lee, Fielding, Software, Masinter, & Systems Berners-Lee, T., Fielding, R. T., Software, D., Masinter, L., & Systems, A. (2005, January). _Uniform Resource Identifier (URI): Generic Syntax._\n * Biron & Malhotra Biron, P. V., & Malhotra, A. (2004). _XML schema part 2: Datatypes second edition_ (Tech. Rep.). World Wide Web Consortium. \n * Bray, Hollander, Layman, & Tobin Bray, T., Hollander, D., Layman, A., & Tobin, R. (2006). _Namespaces in XML 1.0_ (Tech. Rep.). World Wide Web Consortium. \n * Britton Britton, R. (2003). _MIPS assembly language programming._ Prentice Hall. \n * Carroll & Stickler Carroll, J. J., & Stickler, P. (2004). RDF triples in XML. In _Extreme markup languages._ Montréal, Québec: IDEAlliance. \n * Coelho & Stanculescu Coelho, D., & Stanculescu, A. (1988). A state-of-the-art VHDL simulator. In _Thirty-third IEEE computer society international conference_ (p. 320-323). San Francisco, CA. \n * Craig Craig, I. D. (2005). _Virtual machines._ Springer. \n * Davies, Fensel, & Harmelen Davies, J., Fensel, D., & Harmelen, F. van. (2003). _Towards the semantic web: Ontology-driven knowledge management._ Wiley. \n * Eckel Eckel, B. (2002). _Thinking in Java._ Prentice Hall. \n * Fensel Fensel, D. (2004). Triple-space computing: Semantic web services based on pesistent publication of information. In _Proceedings of the International Conference on Intelligence in Communication Systems_ (pp. 43–53). Bangkok, Thailand. \n * Fensel, Hendler, Lieberman, & Wahlster Fensel, D., Hendler, J. A., Lieberman, H., & Wahlster, W. (Eds.). (2003). _Spinning the Semantic Web: Bringing the World Wide Web to its full potential._ MIT Press. \n * Hennessy & Patterson Hennessy, J. L., & Patterson, D. A. (2002). _Computer architecture: A quantitative approach._ Morgan Kaufmann. \n * Kifer, Lausen, & Wu. Kifer, M., Lausen, G., & Wu., J. (1995). Logical foundations of object-oriented and logical foundations of object-oriented and. _Journal of the ACM_ , _42_(4), 741-843. \n * Koide & Kawamura Koide, S., & Kawamura, M. (2004). SWCLOS: A Semantic Web processor on Common Lisp object system. In _Proceedings of the International Semantic Web Conference._ Hiroshima, Japan. \n * Leach Leach, P. J. (2005). _A Universally Unique IDentifier (UUID) URN Namespace_ (Tech. Rep.). Network Working Group. \n * Lee Lee, R. (2004). _Scalability report on triple store applications_ (Tech. Rep.). Massachusetts Institute of Technology. \n * Lindholm & Yellin Lindholm, T., & Yellin, F. (1999). _The Java virtual machine specification._ Addison-Wesley. \n * Lorie Lorie, R. A. (2001). Long term preservation of digital information. In _Proceedings of the 1st ACM/IEEE-CS joint conference on digital libraries_ (pp. 346–352). New York, NY, USA: ACM Press. \n * Louden Louden, K. C. (2003). _Progamming languages: Principles and practice._ Brooks/Cole - Thomson Learning. \n * Manola & Miller Manola, F., & Miller, E. (2004, February). _RDF primer: W3C recommendation._\n * Martin et al. Martin, D., Burstein, M., Hobbs, J., Lassila, O., McDermott, D., McIlraith, S., Narayanan, S., Paolucci, M., Parsia, B., Payne, T., Sirin, E., Srinivasan, N., & Sycara, K. (2004). _OWL-S: Semantic markup for web services_ (Tech. Rep.). World Wide Web Consortium. \n * McGuinness & Harmelen McGuinness, D. L., & Harmelen, F. van. (2004, February). _OWL web ontology language overview._\n * Nelson, McCown, Smith, & Klein Nelson, M. L., McCown, F., Smith, J., & Klein, M. (2007). Using the web infrastructure to preserve web pages. _International Journal on Digital Libraries_. \n * Oren, Delbru, Gerke, Haller, & Decker Oren, E., Delbru, R., Gerke, S., Haller, A., & Decker, S. (2007). ActiveRDF: Object-oriented semantic web programming. In _Proceedings of the International World Wide Web Conference WWW07._ Banff, Canada. \n * Prud’hommeaux & Seaborne Prud’hommeaux, E., & Seaborne, A. (2004). _SPARQL query language for RDF_ (Tech. Rep.). World Wide Web Consortium. \n * Rodriguez, Watkins, Bollen, & Gershenson Rodriguez, M. A., Watkins, J. H., Bollen, J., & Gershenson, C. (2007). Using RDF to model the structure and process of systems. _InterJournal of Complex Systems_ , _2131_. \n * Satyanarayanan et al. Satyanarayanan, M., Gilbert, B., Toups, M., Tolia, N., Surie, A., O’Hallaron, D. R., Wolbach, A., Harkes, J., Perrig, A., Farber, D. J., Kozuch, M. A., Helfrich, C. J., Nath, P., & Lagar-Cavilla, H. A. (2007). Pervasive personal computing in an internet suspend/resume system. _IEEE Internet Computing_ , _11_(2), 16-25. \n * Seaborne & Manjunath Seaborne, A., & Manjunath, G. (2007). _SPARQL/Update: A language for updating RDF graphs_ (Tech. Rep.). Hewlett-Packard. \n * Sebesta Sebesta, R. W. (2005). _Concepts of programming languages._ Addison-Wesley. \n * Shinavier Shinavier, J. (2007). Functional programs as Linked Data. In _3rd Workshop on Scripting for the Semantic Web._ Innsbruck, Austria. \n * Sowa Sowa, J. F. (1991). _Principles of semantic networks: Explorations in the representation of knowledge._ San Mateo, CA: Morgan Kaufmann. \n * Sowa Sowa, J. F. (1999). _Knowledge representation: Logical, philosophical, and computational foundations._ Course Technology. \n * Turing Turing, A. M. (1937). On computable numbers, with an application to the entscheidungsproblem. _Proceedings of the London Mathematical Society_ , _42_(2), 230–265. \n * Wang et al. Wang, H. H., Noy, N., Rector, A., Musen, M., Redmond, T., Rubin, D., Tu, S., Tudorache, T., Drummond, N., Horridge, M., & Sedenberg, J. (2007). Frames and OWL side by side. In _10th International Protégé Conference._ Budapest, Hungary. \n\n" } ]
[{"role":"user","content":"Share the content of this arxiv-papers."},{"role":"assistant","content":"(...TRUNCATED)
[{"role":"user","content":"Share the content of this arxiv-papers."},{"role":"assistant","content":"(...TRUNCATED)
[{"role":"user","content":"Share the content of this arxiv-papers."},{"role":"assistant","content":"(...TRUNCATED)
[{"role":"user","content":"Share the content of this arxiv-papers."},{"role":"assistant","content":"(...TRUNCATED)
[{"role":"user","content":"Share the content of this arxiv-papers."},{"role":"assistant","content":"(...TRUNCATED)
[{"role":"user","content":"Share the content of this arxiv-papers."},{"role":"assistant","content":"(...TRUNCATED)
[{"role":"user","content":"Share the content of this arxiv-papers."},{"role":"assistant","content":"(...TRUNCATED)
[{"role":"user","content":"Share the content of this arxiv-papers."},{"role":"assistant","content":"(...TRUNCATED)
[{"role":"user","content":"Share the content of this arxiv-papers."},{"role":"assistant","content":"(...TRUNCATED)
End of preview. Expand in Data Studio

No dataset card yet

Downloads last month
53