## AllegroGraph Java Examples

This Learning Center is designed to facilitate understanding of RDF database technologies and best practices for AllegroGraph. It contains examples for working with RDF triples, triple stores, server management, querying with SPARQL, reasoning with RDFS++ and Prolog, Federating triple stores, the Jena API, the Sesame 2 Repository API, and applications involving Geospatial, Temporal and Social Network Analysis.

The examples can be freely downloaded (as an Eclipse project archive: AllegroGraphExamples-3.3.jar) and easily imported into Eclipse allowing you to experiment with the Java version of AllegroGraph, including the Free Edition. Please note that while we publish the source code for the examples on the web for convenience, it is recommended that you download the jar (rather than copying-and-pasting them individually from the web) to obtain data sets that are necessary to run the examples and supporting files such as AGPaths.java and AGUtils.java).

Questions? Are there additional examples you would like to see on the Learning Center? Please send comments, requests, suggestions to info@franz.com. You can review recent changes in the Change Log.

#### Preamble and Installation Choosing an Edition Downloading the software Installing the software Updating an installation #### Running the Examples Starting a server manually Building in Eclipse Running in Eclipse Configuring Paths Building from a Command Line Running from a Command Line Stopping a server manually #### Server Management Connecting to a server Getting server parameters Setting server parameters Evaluating lisp in the server Disconnecting from a server #### Triple Store Management Creating a Triple Store Opening a Triple Store Getting Store parameters Setting Store parameters Namespace Registries The SPOGI Cache Closing a Triple Store #### Parts of Triples Creating URIs Creating Literals URIs with Namespaces Creating Triples from Parts Named Graphs Triple IDs #### Populating a Triple Store Loading N-Triples files Loading RDF-XML files Loading gzip files Loading via Rapper Using Predicate Mappings Using Datatype Mappings Loading in Parallel Adding triples over a socket Duplicate triples Deleting triples #### Indexing a Triple Store Overview of Indexing Indexing all triples Indexing new triples Index Flavors Automatic Indexing #### Basic Retrieval Getting Triples Showing Results Range Queries Counting Solutions Serializing data | #### SPARQL Overview of SPARQL SELECT Basic Graph Patterns Matching RDF Literals Blank Node Labels FILTERs OPTIONAL Values FILTERs in OPTIONALs UNION FROM NAMED Default Dataset ORDER BY DISTINCT LIMIT and OFFSET Binding Query Variables ASK CONSTRUCT DESCRIBE Setting the Engine Setting the Planner #### RDFS++ Reasoning Overview of RDFS++ rdfs:subClassOf rdfs:subPropertyOf rdfs:domain and rdfs:range owl:inverseOf owl:sameAs owl:TransitiveProperty owl:hasValue SPARQL with Reasoning #### Prolog Retrieval with Functor q Reasoning with Functor q Retrieval with Functor q- Reasoning with Horn Rules Disjunction and Recursion Prolog Query Planner #### Free-Text Search Free-Text Indexing Free-Text Search SPARQL fti:match #### Federation Federating Basic Stores Federating Federations SPARQL-RDFS++ in a Federation Range Queries in a Federation Free-Text Search in a Federation #### Social Network Analysis Generators Degrees and Neighbors Search Paths Metrics and Centrality Cliques | #### Geospatial Primitives Geospatial Subtypes Cartesian Data Spherical Data Cartesian Bounding Boxes Spherical Bounding Boxes Haversine Distance Polygon Regions Predicate Mappings Loading and Serializing #### Temporal Primitives ISO8601 DateTimes Loading Temporal Data Point-Point Relations Point-Interval Relations Interval-Datetime Relations Interval-Interval Relations Gregorian Calendar #### Sesame 2 Repository API Value Factory Adding Data Tuple Queries Graph Queries Boolean Queries Get Statements Remove Statements Datasets #### Jena API Graph Maker Interface Graph Interface Model Interface Statements Selectors Query Execution Query All Graphs Named Graphs Result Sets #### Benchmarks and Datasets RDF Axioms N-Triples Test The Kennedy Family The Wine Ontology ISWC+ASWC 2007 Data Open CYC Database NCI Thesaurus Geonames Ontology WordNet Building LUBM-50 LUBM-50 Prolog Queries LUBM-50 SPARQL Queries Building LUBM-8000 Querying LUBM-8000 #### Miscellaneous Additional Utilities