TRIPLE(ID:8298/)


Web querying language


Related languages
SiLRI => TRIPLE   Evolution of

References:
  • Sintek, Michael; Decker, Stefan "TRIPLE - An RDF Query, Inference, and Transformation Language" view details Abstract: This paper presents TRIPLE, a layered and modular rule language for the semantic web [1]. TRIPLE is based on Horn logic and borrows many basic features from F-Logic [9] but is especially designed for querying and transforming RDF models [17].
    TRIPLE can be viewed as a successor of SiLRI (Simple Logic-based RDF Interpreter [5]). One of the most important differences to F-Logic and SiLRI is that TRIPLE does not have a fixed semantics for object-oriented features like classes and inheritance. Its layered architecture allows such features to be easily defined for different object-oriented and other RDF extensions like RDF Schema [16]. Description logics extensions of RDF (Schema) like OIL [14] and DAML+OIL [3] that cannot be handled directly by Horn logic are provided as modules that interact with a description logic classifier, e.g. FaCT [8], resulting in a hybrid rule language. This paper sketches syntax and semantics of TRIPLE. Extract: Introduction
    Introduction
    TRIPLE is a layered rule language, aiming to support applications in need of RDF reasoning and transformation. The core language is based on Horn logic which is syntactically extended to support RDF primitives like namespaces, resources, and statements (triples, which gave TRIPLE its name). This core language can be compiled into Horn logic programs and enacted by Prolog systems like XSB [15].
    Inference systems for higher level-languages like RDF Schema and DAML+OIL can either be implemented directly in TRIPLE or are provided as modules interacting with external reasoning components.
    TRIPLE provides a (human readable) Prolog-like syntax (both in mathematical and ASCII notation; cf. appendix A) as well as an RDF-based syntax.
    In this section we introduce TRIPLE (using its mathematical Prolog-like notation). Section 2 presents the layered architecture of TRIPLE, Section 3 introduces its RDF-based syntax (for the subset TRIPLEo), and Section 4 gives a semantic characterization. Section 5 finally concludes the paper.
    The reader is supposed to be familiar with RDF and RDF Schema.
    Extract: Features of TRIPLE
    Features of TRIPLE
    In the following, the main features of TRIPLE (i.e., those extending Horn logic) are informally described. Note that not all the features are available in TRIPLEo (cf. Section 2).
    Namespaces and Resources TRIPLE has special support for namespaces and resource identifiers. Namespaces are declared via clause-like constructs of the form nsabbrev := namespace., e.g.
    rdf := "http://www.w3.org/1999/02/22-rdf-syntax-ns#".
    Resources are written as nsabbrev:name, where nsabbrev is a namespace abbreviation and name is the local name of the resource.
    Resource abbreviations can be introduced analogously to namespace abbreviations, e.g.
    isa := rdfs:subClassOf.
    Statements and Molecules An RDF statement (triple) is?inspired by F-Logic object syntax?written as
    subject[predicate -»? object
    Several statements with the same subject can be abbreviated as "molecules":
    stefan[hasAge ?> 33; isMarried ?> yes;...] RDF statements (and molecules) can be nested, eg.: stefan[marriedTo ?> birgit[hasAge ?> 32]]
    Models RDF models, i.e., sets of statements, are made explicit in TRIPLE ("first class citizens").1 Statements, molecules, and also Horn atoms that are true in a specific model are written as atom@model (similar to Flora-2 module syntax), where atom is a statement, molecule, or Horn atom and model is a model specification (i.e., a resource denoting a model), e.g.
    michael[hasAge ->¦ 34] ©factsAboutDFKI
    TRIPLE also allows Skolem functions as model specifications. Skolem functions can be used to transform one model (or several models) into a new one when used in rules (e.g., for ontology mapping/integration):
    O[P-*Q]@s£(ml,X,Y)  «?   ...
    If all (or many) statements/molecules or Horn atoms in a formula (see Section 1.1) are from one model, the following abbreviation can be used: formula@model. All statements/molecules and Horn atoms in formula without an explicit model specification are implicitly suffixed with @model.
    Instead of constants, variables, and Skolem functions also boolean combinations can be used, eg.: (modeh n modeh) specifying the intersection of two models, (modeh U modeh) specifying the union of two models, and (modeh\modeh) specifying the set-difference of two models.
    Reified Statements Reified statements are written as < statement > and can be used inside other statements, allowing "modal" statements like
    stefan[believes ?>- homepage] >]
    Path Expressions For navigation purposes, path expressions have proven to be very useful in object oriented languages. TRIPLE allows the usage of path expressions instead of subject, predicate, or object definitions (and at all other places where terms are allowed). Path expressions are dot-delimited sequences of resources, e.g.:
    stefan.spouse.mother denotes Stefan's mother in law.
    Logical Formulae TRIPLE uses the usual set of connectives and quantifiers for building formulae from statements/molecules and Horn atoms, i.e., A, V, -¦, V, 3, etc.2 All variables must be introduced via quantifiers, therefore marking them is not necessary (i.e., TRIPLE does not require variables to start with an uppercase letter as in Prolog).
    1 Note that the notion of model in RDF does not coincide with its use in (mathematical) logics.
    2For TRIPLE programs in plain ASCII syntax, the symbols AND, OR, NOT, FORALL, EXISTS, <-, ->, etc. are used; cf. the example in Section 2.1.
    Clauses and Blocks A TRIPLE clause is either a fact or a rule. Rule heads may only contain conjunctions of molecules and Horn atoms and must not contain (explicitly or implicitly) any disjunctive or negated expressions.
    To assert that a set of clauses is true in a specific model, a model block is used:
    ©model {clauses}
    or, in case the model specification is parameterized: V Mdl @model(Mdl) {clauses}
    Clauses and Blocks A TRIPLE clause is either a fact or a rule. Rule heads may only contain conjunctions of molecules and Horn atoms and must not contain (explicitly or implicitly) any disjunctive or negated expressions.
    To assert that a set of clauses is true in a specific model, a model block is used:
    ©model {clauses}
    or, in case the model specification is parameterized: V Mdl @model(Mdl) {clauses}
    Extract: Semantic Characterization of TRIPLE
    Semantic Characterization of TRIPLE
    This section provides a first indirect semantic characterization of TRIPLE by defining a mapping to Horn Logic. This allows TRIPLE to be implemented on top of XSB (i.e., Prolog with tabled resolution), analogously to the F-Logic Flora [12].
    Figure 5 shows the rewrite rules for mapping RDF-specific features like resources and statements. All other mappings are well-known (Lloyd-Topor transformations for handling of quantifier [11]) or straightforward (see the SiLRI system [5]). Example:
    p:jdow[p:lastname ?> doe]@ml.   ?>
    true(statement(resource(p,  jdow),  resource(p,
    lastname),  doe),  ml).
    In a future document, a model-theoretic semantics based on minimal Herbrand models and fix-point operators will be provided. Extract: Conclusion
    Conclusion
    In this paper, we presented TRIPLE, a novel query and transformation language for RDF. Its core is a syntactical extension of Horn logic similar to F-Logic, but specialized for the requirements on the semantic web by making web resources, (RDF) models, and statements first class citizens.
    Its main purpose is to query web resources in a declarative way, e.g. for intelligent information retrieval based on background knowledge like ontologies and search heuristics. For early approaches in this area, refer to, e.g., [7, 6, 13].
    TRIPLE's layered architecture allows extensions of RDF to be implemented as extension modules (via parameterized models). Simple object-oriented extensions like RDF Schema can be directly implemented with the extended Horn logic features of TRIPLE, other extensions like DAML+OIL are realized via interaction with external reasoning components like a description logics classifier.
    TRIPLE's model concept (esp. the parameterized models) enables the transformation of models, thus enabling knowledge base and ontology mapping/integration tasks which are needed in distributed settings as the semantic web (see, e.g., [18]).
    Since models are first class citizens in TRIPLE, modal functionalities as needed in agent communication are also provided (e.g., agent A "believes" statements in
    model M, which has been received from agent B, to be true).
    TRIPLE is currently being developed by the authors.
    A first implementation of TRIPLE based on XSB is available at: http://www.dfki.uni-kl.de/frodo/triple/. In this version, all RDF data and TRIPLE rules are compiled into a single PROLOG program, therefore restricting the size of the knowledge base to what the underlying PROLOG system (i.e., XSB) can handle.
    Future versions will implement the complete TRIPLE language and allow querying distributed RDF data without compiling remote data to the local (PROLOG) knowledge base.
  • Stefan Decker, Michael Sintek, Wolfgang Nejdl "TRIPLE: A Logic for Reasoning with Parameterized Views over Semi-Structured Data" 2002 view details Abstract: This paper presents TRIPLE, a layered and modular rule language for the Semantic Web [1]. TRIPLE is based on Horn logic and borrows many basic features from F-Logic [11] but is especially designed for querying and transforming RDF models [20].
    TRIPLE can be viewed as a successor of SiLRI (Simple Logic-based RDF Interpreter [5]). One of the most important differences to F-Logic and SiLRI is that TRIPLE does not have a fixed semantics for object-oriented features like classes and inheritance. Its layered architecture allows such features to be easily defined for different object-oriented and other data models like UML, Topic Maps, or RDF Schema [19]. Description logics extensions of RDF (Schema) like OIL [17] and DAML+OIL [3] that cannot be fully handled by Horn logic are provided as modules that interact with a description logic classifier, e.g. FaCT [9], resulting in a hybrid rule language. This paper sketches syntax and semantics of TRIPLE.
    Extract: Conclusion
    Conclusion
    In this paper, we presented TRIPLE, a novel query and transformation language for RDF. Its core is a syntactical extension of Horn logic similar to F-Logic, but specialized for the requirements on the semantic web by making web resources, (RDF) models, and statements first class citizens.
    Its main purpose is to query web resources in a declarative way, e.g. for intelligent information retrieval based on background knowledge like ontologies and search heuristics. For early approaches in this area, refer to, e.g., [7,6,16].
    TRIPLE's layered architecture allows extensions of RDF to be implemented as extension modules (via parameterized models). Simple object-oriented extensions like RDF Schema can be directly implemented with the extended Horn logic features of TRIPLE, other extensions like DAML+OIL are realized via interaction with external reasoning components like a description logics classifier.
    TRIPLE's model concept (esp. the parameterized models) enables the transformation of models, thus enabling knowledge base and ontology mapping/integration tasks which are needed in distributed settings as the semantic web (see, e.g., [21]).
    Since models are first class citizens in TRIPLE, modal functionalities as needed in agent communication are also provided (e.g., agent A "believes" statements in model M, which has been received from agent B, to be true).
    TRIPLE is currently being developed by the authors. An implementation of TRIPLE based on XSB is available at: http://triple.semanticweb.org. In this version, all RDF data and TRIPLE rules are compiled into a single PROLOG program, therefore restricting the size of the knowledge base to what the underlying PROLOG system (i.e., XSB) can handle.
    Future versions will allow querying distributed RDF data without compiling remote data to the local (PROLOG) knowledge base.
    Extract: Introduction
    Introduction
    On the Semantic Web many different communities are publishing their formal data, and it is unlikely that established data models for representing this data will disappear. Examples of already established data models include UML, Top-icMaps, RDF Schema, Entity Relationship Models, DAML+OIL, and more, highly specialized data models. Integrating data based on these different data models has proven to be an error-prone and expensive task: different storage and query engines have to be combined into one program, and data has to be translated constantly from one representation to another. A first step to improve this situation is the use of RDF as a common representation formalism for all data involved. This, however, does not solve the problem entirely. Although many query languages and inference engines for RDF exist (e.g., SiLRI [5], RQL [10], SQUISH2), none of them is capable of representing multiple semantics as required by the different heterogeneous data models. E.g., when querying UML data the Generalization relation should be treated as a transitive relationship, as well as rdf s: subClassOf in RDF Schema. None of the cited query languages has the ability to query different data models with different kinds of semantics. Although some of them (RQL and SiLRI) have a built-in semantics for RDF Schema, this does not generalize to other data models.
    To remedy the situation we propose TRIPLE, a rule language, aiming to support applications in need of RDF reasoning and transformation under several different semantics. The core language is based on Horn logic which is syntactically extended to support RDF primitives like namespaces, resources, and statements (triples, which gave TRIPLE its name). This core language can be compiled into Horn logic programs and enacted by Prolog systems like XSB [18].
    Inference systems for data models like RDF Schema can be implemented directly in TRIPLE if expressible in Horn logic or may be provided as modules interacting with external reasoning components, if not implementable with Horn logic (e.g., for Description Logic based languages like DAML+OIL).
    TRIPLE provides a (human readable) ASCII-syntax as well as an RDF-based syntax.
  • Stefan Decker Michael Sintek Wolfgang Nejdl "The Model-Theoretic Semantics of TRIPLE" view details Abstract: In this paper we investigate and formalize the notion of RDF Models (or context) for RDF data by defining syntax and a model theoretic semantics of TRIPLE, a logic for dealing with RDF and contexts. A unique feature of the language is that one context can be used as parameters for other contexts. The definitions are used to derive a query and reasoning language based on deductive database technology. Applications include querying of data with respect to multiple semantics and information integration.
    Extract: Motivation
    1. Motivation
    The Resource Description Framewrok (RDF) is now the accepted standard for building ontology languages and sophisticated information models. Although every RDF API and application organizes it's RDF data according to RDF Models (also colled contexts in this paper, so far there has been no attempt to formalize and these RDF Models.
    In this paper we investigate and formalize the notion of RDF Models for RDF data by defining syntax and a model theoretic semantics of TRIPLE, a logic for dealing with context, inspired by F-Logic [11]. The definitions are used to derive a query and reasoning language based on deductive database technology, which supports parameterized contexts. Applications include querying of data with respect to multiple semantics and information integration. A unique feature of our approach is that contexts may be used as parameters for other contexts, therefore enabling composition of contexts.
    1.1    Contexts, RDF, and the Semantic Web
    In the Semantic Web many different communities are publishing their formal data, and it is unlikely that established data models for representing this data will disappear. Examples of already established data models include UML, TopicMaps, RDF Schem Entity Relationship Models, DAML+OIL, and more, highly specialized data models. Integrating data based on these different data models has proven to be an error prone and expensive task: different storage and query engines have to be combined into one system, and data has to be constantly translated from one representation to another. A first step to improve this situation is the use of a common data model as a representation formalism for all data involved. The web community has suggested XML and RDF as the underlying syntactic representation of data for data representation. Based on RDF many higher level data modelling languages have been developed, e.g., RDF vocabularies for UML, TopicMaps, or RDF Schema, DAML+OIL.1
    However, using a common representation, such as RDF, does not solve the complete problem: although many query languages and inference engines for RDF exist (e.g., SiLRI [7], RQL [10], SQUISH 2), none of them is capable of querying data with respect to multiple semantics as required by the different heterogeneous data modelling languages. E.g., when querying UML data the Generalization relation should be treated as a transitive relationship, as well as rdfs : subClassOf in RDF Schema. None of the cited query languages has the ability to query different data models with different kinds of semantics. Although some of them (RQL and SiLRI) have a built-in semantics for RDF Schema, this does not generalize to other data models. Since many different incompatible data models are already available this means existing query systems need to be extended with specialized reasoning engines for a particular data model.
    1.2    Approach
    Parameterized contexts for RDF data can be applied to to remedy the situation. A context in our case is a subgraph of the overall data graph, similar to the notion of views as defined in the database literature (cf [1]). Enabling the use of contexts as parameters enables one to define the semantics of a particular data modelling language (e.g., RDF Schema) as a dervived context over some source data, which is passed as a paramter.
    Figure 1 illustrates the approach: the first context (RDF Model) (the graph with the ID PersonData) is passed as a parameter to the context definition transitive which declares the transitivity of the subClassOf-relation (which might be a part of the semantics declaration of a data modelling language, e.g., RDF Schema, possibly with a richer set of axioms). The context definition takes a parameter, in this case another context. The result of applying the context definition transitive to the context PersonalData results in a new context, which respects the semantics of the data modeling language. The ID of the new context is constructed (by means of a skolem function) out of the ID of the data, PersonalData, and the ID of the context definition, here resulting in the ID transitive (PersonalData) . The example illustrates the approach?depending on the concrete implementation it may never be necessary to fully materialize the resulting context.
    1.3    Contributions
    The contributions of this paper are:
    -  We introduce the notion of parameterized contexts over RDF as first class citizens, meaning that parameterized contexts can be parameters of other contexts, using the query and rule language.
    -  We define TRIPLE, a logical language for reasoning with parameterized contexts over RDF data, and define a model theoretic semantics for the language (sections 2 and 3). TRIPLE also serves also as a formalization for rules and axioms language for RDF.
    -  Based on the full language, we sketch a language subset, analog to Horn-logic, and describe a prototypical implementation for this subset.
    -  Finally, two examples illustrate the language and the approach. Extract: Horn-Triple : The Query And Rule Language
    Horn-Triple : The Query And Rule Language
    In the previous sections a language and model theory was developed for TRIPLE-logic, similar to usual full first-order logic. Several fragments of first-order logic have been identified with preferable computational properties. In the case of first-order logic, Horn-logic is used as a basis for Logic Programming and Deductive Databases, and is extended with various forms of non-monotonic negation to serve representation needs. The following definition defines the TRIPLEequivalent to Horn-clauses.
    For Horn-TRIPLEthe usage of molecules is restricted to ensure the applicability of the usual type of fixpoint definition for the characterization of the semantics. The set-difference operator on contexts causes the usual fixpoint procedure (direct consequence operator, see [13]) to be non-monotonic, therefore a least fixpoint cannot be guaranteed. The union-operator in the head of a clause invalidates the model intersection property, that guaranties that the intersection of two Herbrand models is again another Herbrand model. The model intersection property is also necessary to guarantee the existence of a least Herbrand model.
    The Horn-subset HORN of a T-language is defined as the set of all clauses with at most one positive molecule. The context expression part of the positive molecules is either a simple term or an intersection expression. Of the negative molecules the context expression part is either a simple term, an intersection expression, or a union expression (no set-theoretic difference).
    The restriction to molecules with the specific context expressions is necessary to ensure the applicability of the usual type of fixpoint definition for the semantic characterization. The Set-difference operator on context causes the usual fixpoint procedure (direct consequence operator, see [13]) to be non-monotonic, therefore a least fixpoint cannot be guaranteed. The union-operator in the head of a clause invalidates the model intersection property, that guaranties that the intersection of two Herbrand models is again another Her-brand model. The model intersection property is also necessary to guarantee the existence of a least Herbrand model.
    Analogously to usual predicate logic it is possible to define skolem-ization, and Skolem's Theorem is easily transferable from the classical predicate logic calculus to TRIPLE.
    Furthermore the notion of the Herbrand-Base, Herbrand-Inter-pretation, and Herbrand Model can be defined analogously to the predicate logic case based on ground molecules. These definitions justify the definition of the Horn subset of TRIPLE .
    Definition 12 (Horn TRIPLE) The Horn-subset HORN of a T-language is defined as the set of all clauses with at most one positive molecule. The context expression part of the positive molecules is either a simple term or an intersection expression. Of the negative molecules the context expression part is either a simple term, intersection expression, or a union expression (no set-theoretic difference).
    The restriction to molecules with the specific context expressions is necessary to ensure the applicability of the usual type of fixpoint definition for the semantic characterization. The Set-difference operator on contexts causes the usual fixpoint procedure (direct consequence operator, see [13]) to be non-monotonic, therefore a least fixpoint cannot be guaranteed. The union-operator in the head of a clause invalidates the model intersection property, that guaranties that the intersection of two Herbrand models is again another Herbrand model. The model intersection property is also necessary to guarantee the existence of a least Herbrand model.
    Using the definition of the Horn-subset and the Herbrand base the usual semantic characterizations for logic programs can be adapted for the Horn part of TRIPLE.
    Using notions for non-monotonic negation developed in the logic programming community (e.g., well-founded negation [19]) it is possible to reintroduce set-difference again.
    Extract: Conclusion And Future Work
    Conclusion And Future Work
    We presented a logical language and accompanied model theory, which formalized the notion of parameterized contexts for RDF data. Using the full language we identified a subset which is imple-mentable using a deductive database. The language enables one to pass views as parameters to other views, realizing composition of views.
    We illustrated the language with two examples: querying data with respect to a certain semantics, and integrating various metadata schemata. We expect both types of application scenarios to become common on the Semantic Web, and we foresee a need for parameterized contexts as presented and formalized in this paper.
    No work has so far been done in the optimization of the execution of rules?the current implementation is a straightforward translation to an ordinary deductive database, thus no specialized optimization strategies are exploited. Future work also includes the investigation of distributed queries and data sources, which is a generalization of the work done in the MSL context [16].