Building from a Command Line

Below are instructions for building examples from the command line on various platforms.

Please note that the Learning Center examples are not intended to be treated as command line utilities; rather, they are best understood by first reading through the source code to learn what the example does, and then running it to see the output. Java developers may prefer an IDE such as Eclipse for this purpose.

Open a shell (command prompt) and cd to a convenient directory for unpacking and building the examples.

On Windows


C:\tmp>mkdir agexamples
C:\tmp>cd agexamples
C:\tmp\agexamples>jar xvf [AllegroGraphInstallation]\doc\learning\AllegroGraphExamples-3-0.jar
  created: data/
 inflated: data/Geonames_v2.0_Lite.rdf
 inflated: data/geospatial.nt
 inflated: data/iswc-aswc-2007-complete.rdf
 inflated: data/kennedy.ntriples
 inflated: data/rdf-axioms.rdf
 inflated: data/sna-cycle.nt
 inflated: data/sna-doublediamond.nt
 inflated: data/sna.nt
 inflated: data/temporal.nt
 inflated: data/test.nt
 inflated: data/wilburwine.ntriples
 inflated: data/wilburwine.rdf
  created: lib/
 inflated: lib/agraph.jar
 inflated: lib/agsrc.jar
  created: src/
  created: src/com/
  created: src/com/franz/
  created: src/com/franz/ag/
  created: src/com/franz/ag/examples/
 inflated: src/com/franz/ag/examples/AGAddStatements.java
 inflated: src/com/franz/ag/examples/AGCloseTripleStore.java
 inflated: src/com/franz/ag/examples/AGConnecting.java
 inflated: src/com/franz/ag/examples/AGCreateLiteral.java
 inflated: src/com/franz/ag/examples/AGCreateTripleStore.java
 inflated: src/com/franz/ag/examples/AGCreateURI.java
 inflated: src/com/franz/ag/examples/AGCreatingTriples.java
 inflated: src/com/franz/ag/examples/AGDeleteTriples.java
 inflated: src/com/franz/ag/examples/AGDisconnecting.java
 inflated: src/com/franz/ag/examples/AGDuplicates.java
 inflated: src/com/franz/ag/examples/AGEvalInServer.java
 inflated: src/com/franz/ag/examples/AGFederationBasics.java
 inflated: src/com/franz/ag/examples/AGFederationOfFederations.java
 inflated: src/com/franz/ag/examples/AGFederationRangeQueries.java
 inflated: src/com/franz/ag/examples/AGFederationSparqlReasoning.java
 inflated: src/com/franz/ag/examples/AGFreetextIndex.java
 inflated: src/com/franz/ag/examples/AGFreetextSearch.java
 inflated: src/com/franz/ag/examples/AGGeonames.java
 inflated: src/com/franz/ag/examples/AGGeospatialBoundingBox.java
 inflated: src/com/franz/ag/examples/AGGeospatialBoundingBoxSpherical.java
 inflated: src/com/franz/ag/examples/AGGeospatialCartesianData.java
 inflated: src/com/franz/ag/examples/AGGeospatialHaversine.java
 inflated: src/com/franz/ag/examples/AGGeospatialLoaderSerializer.java
 inflated: src/com/franz/ag/examples/AGGeospatialPolygons.java
 inflated: src/com/franz/ag/examples/AGGeospatialPredicateMapping.java
 inflated: src/com/franz/ag/examples/AGGeospatialSphericalData.java
 inflated: src/com/franz/ag/examples/AGGetStatements.java
 inflated: src/com/franz/ag/examples/AGIndexAllTriples.java
 inflated: src/com/franz/ag/examples/AGIndexAutomatically.java
 inflated: src/com/franz/ag/examples/AGIndexFlavors.java
 inflated: src/com/franz/ag/examples/AGIndexNewTriples.java
 inflated: src/com/franz/ag/examples/AGISWCASWC2007.java
 inflated: src/com/franz/ag/examples/AGKennedy.java
 inflated: src/com/franz/ag/examples/AGLoadNtriples.java
 inflated: src/com/franz/ag/examples/AGLoadRDF.java
 inflated: src/com/franz/ag/examples/AGLoadStoreInThread.java
 inflated: src/com/franz/ag/examples/AGLoadWithDatatypeMapping.java
 inflated: src/com/franz/ag/examples/AGLoadWithPredicateMapping.java
 inflated: src/com/franz/ag/examples/AGLubm50Build.java
 inflated: src/com/franz/ag/examples/AGLubm50Sparql.java
 inflated: src/com/franz/ag/examples/AGNamedGraphs.java
 inflated: src/com/franz/ag/examples/AGNamespaceRegistries.java
 inflated: src/com/franz/ag/examples/AGNamespaces.java
 inflated: src/com/franz/ag/examples/AGNCIThesaurus.java
 inflated: src/com/franz/ag/examples/AGNtriplesTest.java
 inflated: src/com/franz/ag/examples/AGOpenCyc.java
 inflated: src/com/franz/ag/examples/AGOpenTripleStore.java
 inflated: src/com/franz/ag/examples/AGPaths.java
 inflated: src/com/franz/ag/examples/AGPrologDisjunction.java
 inflated: src/com/franz/ag/examples/AGPrologFunctorQ.java
 inflated: src/com/franz/ag/examples/AGPrologFunctorQminus.java
 inflated: src/com/franz/ag/examples/AGPrologRules.java
 inflated: src/com/franz/ag/examples/AGRangeQueries.java
 inflated: src/com/franz/ag/examples/AGRDFAxioms.java
 inflated: src/com/franz/ag/examples/AGReasoningDomainRange.java
 inflated: src/com/franz/ag/examples/AGReasoningInverseOf.java
 inflated: src/com/franz/ag/examples/AGReasoningSameAs.java
 inflated: src/com/franz/ag/examples/AGReasoningSubClassOf.java
 inflated: src/com/franz/ag/examples/AGReasoningSubPropertyOf.java
 inflated: src/com/franz/ag/examples/AGReasoningTransitiveProperty.java
 inflated: src/com/franz/ag/examples/AGSerializers.java
 inflated: src/com/franz/ag/examples/AGServerInfo.java
 inflated: src/com/franz/ag/examples/AGSetServerParams.java
 inflated: src/com/franz/ag/examples/AGSetTripleStoreParams.java
 inflated: src/com/franz/ag/examples/AGSNACliques.java
 inflated: src/com/franz/ag/examples/AGSNADegreesNeighbors.java
 inflated: src/com/franz/ag/examples/AGSNAGenerators.java
 inflated: src/com/franz/ag/examples/AGSNAMetrics.java
 inflated: src/com/franz/ag/examples/AGSNAPaths.java
 inflated: src/com/franz/ag/examples/AGSparqlAsk.java
 inflated: src/com/franz/ag/examples/AGSparqlBasicGraphPatterns.java
 inflated: src/com/franz/ag/examples/AGSparqlBlankNodeLabels.java
 inflated: src/com/franz/ag/examples/AGSparqlConstruct.java
 inflated: src/com/franz/ag/examples/AGSparqlDescribe.java
 inflated: src/com/franz/ag/examples/AGSparqlDistinct.java
 inflated: src/com/franz/ag/examples/AGSparqlFilters.java
 inflated: src/com/franz/ag/examples/AGSparqlFiltersInOptionals.java
 inflated: src/com/franz/ag/examples/AGSparqlFreetextSearch.java
 inflated: src/com/franz/ag/examples/AGSparqlGraphs.java
 inflated: src/com/franz/ag/examples/AGSparqlLimitOffset.java
 inflated: src/com/franz/ag/examples/AGSparqlOptionals.java
 inflated: src/com/franz/ag/examples/AGSparqlOrderBy.java
 inflated: src/com/franz/ag/examples/AGSparqlRDFLiterals.java
 inflated: src/com/franz/ag/examples/AGSparqlReasoning.java
 inflated: src/com/franz/ag/examples/AGSparqlUnions.java
 inflated: src/com/franz/ag/examples/AGTemporalCalendars.java
 inflated: src/com/franz/ag/examples/AGTemporalDateTime.java
 inflated: src/com/franz/ag/examples/AGTemporalIntervalIntervalRelations.java
 inflated: src/com/franz/ag/examples/AGTemporalLoading.java
 inflated: src/com/franz/ag/examples/AGTemporalPointIntervalRelations.java
 inflated: src/com/franz/ag/examples/AGTemporalPointPointRelations.java
 inflated: src/com/franz/ag/examples/AGTripleIds.java
 inflated: src/com/franz/ag/examples/AGTripleStoreInfo.java
 inflated: src/com/franz/ag/examples/AGUtils.java
 inflated: src/com/franz/ag/examples/AGWilburwine.java
 inflated: src/com/franz/ag/examples/AGWordNet.java
  created: ts/
 inflated: ts/README.txt
 inflated: .classpath
 inflated: .project

C:\tmp\agexamples>mkdir bin

C:\tmp\agexamples>javac -cp lib\agraph.jar src\com\franz\ag\examples\*.java -d bin

The .class files will now be available in the bin directory.

On Mac OS X and other Unix Platforms


$ mkdir agexamples
$ cd agexamples
$ jar xvf [AllegroGraphInstallation]/doc/learning/AllegroGraphExamples-3-0.jar
  created: data/
 inflated: data/temporal.nt
 inflated: data/sna-cycle.nt
 inflated: data/wilburwine.rdf
 inflated: data/test.nt
 inflated: data/geospatial.nt
 inflated: data/rdf-axioms.rdf
 inflated: data/kennedy.ntriples
 inflated: data/sna.nt
 inflated: data/sna-doublediamond.nt
 inflated: data/Geonames_v2.0_Lite.rdf
 inflated: data/iswc-aswc-2007-complete.rdf
 inflated: data/wilburwine.ntriples
  created: lib/
 inflated: lib/agraph.jar
 inflated: lib/agsrc.jar
  created: src/
  created: src/com/
  created: src/com/franz/
  created: src/com/franz/ag/
  created: src/com/franz/ag/examples/
 inflated: src/com/franz/ag/examples/AGSparqlFreetextSearch.java
 inflated: src/com/franz/ag/examples/AGEvalInServer.java
 inflated: src/com/franz/ag/examples/AGNamespaceRegistries.java
 inflated: src/com/franz/ag/examples/AGCreatingTriples.java
 inflated: src/com/franz/ag/examples/AGGeospatialBoundingBox.java
 inflated: src/com/franz/ag/examples/AGReasoningSubPropertyOf.java
 inflated: src/com/franz/ag/examples/AGLubm50Sparql.java
 inflated: src/com/franz/ag/examples/AGOpenTripleStore.java
 inflated: src/com/franz/ag/examples/AGNCIThesaurus.java
 inflated: src/com/franz/ag/examples/AGPrologFunctorQ.java
 inflated: src/com/franz/ag/examples/AGSparqlConstruct.java
 inflated: src/com/franz/ag/examples/AGTemporalDateTime.java
 inflated: src/com/franz/ag/examples/AGSparqlDescribe.java
 inflated: src/com/franz/ag/examples/AGLoadWithDatatypeMapping.java
 inflated: src/com/franz/ag/examples/AGSparqlOrderBy.java
 inflated: src/com/franz/ag/examples/AGGetStatements.java
 inflated: src/com/franz/ag/examples/AGCreateTripleStore.java
 inflated: src/com/franz/ag/examples/AGCreateURI.java
 inflated: src/com/franz/ag/examples/AGReasoningTransitiveProperty.java
 inflated: src/com/franz/ag/examples/AGSparqlLimitOffset.java
 inflated: src/com/franz/ag/examples/AGFederationSparqlReasoning.java
 inflated: src/com/franz/ag/examples/AGSNACliques.java
 inflated: src/com/franz/ag/examples/AGSparqlAsk.java
 inflated: src/com/franz/ag/examples/AGDisconnecting.java
 inflated: src/com/franz/ag/examples/AGFreetextIndex.java
 inflated: src/com/franz/ag/examples/AGLoadStoreInThread.java
 inflated: src/com/franz/ag/examples/AGSparqlFilters.java
 inflated: src/com/franz/ag/examples/AGNtriplesTest.java
 inflated: src/com/franz/ag/examples/AGPaths.java
 inflated: src/com/franz/ag/examples/AGGeospatialPolygons.java
 inflated: src/com/franz/ag/examples/AGSparqlDistinct.java
 inflated: src/com/franz/ag/examples/AGRangeQueries.java
 inflated: src/com/franz/ag/examples/AGLoadRDF.java
 inflated: src/com/franz/ag/examples/AGSparqlRDFLiterals.java
 inflated: src/com/franz/ag/examples/AGReasoningSubClassOf.java
 inflated: src/com/franz/ag/examples/AGRDFAxioms.java
 inflated: src/com/franz/ag/examples/AGLoadWithPredicateMapping.java
 inflated: src/com/franz/ag/examples/AGTemporalPointIntervalRelations.java
 inflated: src/com/franz/ag/examples/AGAddStatements.java
 inflated: src/com/franz/ag/examples/AGTemporalIntervalIntervalRelations.java
 inflated: src/com/franz/ag/examples/AGFederationOfFederations.java
 inflated: src/com/franz/ag/examples/AGIndexNewTriples.java
 inflated: src/com/franz/ag/examples/AGNamedGraphs.java
 inflated: src/com/franz/ag/examples/AGFederationBasics.java
 inflated: src/com/franz/ag/examples/AGSNAGenerators.java
 inflated: src/com/franz/ag/examples/AGIndexFlavors.java
 inflated: src/com/franz/ag/examples/AGGeospatialCartesianData.java
 inflated: src/com/franz/ag/examples/AGConnecting.java
 inflated: src/com/franz/ag/examples/AGSparqlBlankNodeLabels.java
 inflated: src/com/franz/ag/examples/AGIndexAutomatically.java
 inflated: src/com/franz/ag/examples/AGPrologRules.java
 inflated: src/com/franz/ag/examples/AGFederationRangeQueries.java
 inflated: src/com/franz/ag/examples/AGGeospatialHaversine.java
 inflated: src/com/franz/ag/examples/AGGeonames.java
 inflated: src/com/franz/ag/examples/AGTripleIds.java
 inflated: src/com/franz/ag/examples/AGSparqlFiltersInOptionals.java
 inflated: src/com/franz/ag/examples/AGTemporalCalendars.java
 inflated: src/com/franz/ag/examples/AGLubm50Build.java
 inflated: src/com/franz/ag/examples/AGReasoningSameAs.java
 inflated: src/com/franz/ag/examples/AGTemporalPointPointRelations.java
 inflated: src/com/franz/ag/examples/AGSerializers.java
 inflated: src/com/franz/ag/examples/AGGeospatialPredicateMapping.java
 inflated: src/com/franz/ag/examples/AGOpenCyc.java
 inflated: src/com/franz/ag/examples/AGSetServerParams.java
 inflated: src/com/franz/ag/examples/AGServerInfo.java
 inflated: src/com/franz/ag/examples/AGGeospatialBoundingBoxSpherical.java
 inflated: src/com/franz/ag/examples/AGSparqlGraphs.java
 inflated: src/com/franz/ag/examples/AGDeleteTriples.java
 inflated: src/com/franz/ag/examples/AGReasoningDomainRange.java
 inflated: src/com/franz/ag/examples/AGIndexAllTriples.java
 inflated: src/com/franz/ag/examples/AGTemporalLoading.java
 inflated: src/com/franz/ag/examples/AGCreateLiteral.java
 inflated: src/com/franz/ag/examples/AGFreetextSearch.java
 inflated: src/com/franz/ag/examples/AGISWCASWC2007.java
 inflated: src/com/franz/ag/examples/AGPrologDisjunction.java
 inflated: src/com/franz/ag/examples/AGGeospatialLoaderSerializer.java
 inflated: src/com/franz/ag/examples/AGSparqlUnions.java
 inflated: src/com/franz/ag/examples/AGWordNet.java
 inflated: src/com/franz/ag/examples/AGPrologFunctorQminus.java
 inflated: src/com/franz/ag/examples/AGSNAMetrics.java
 inflated: src/com/franz/ag/examples/AGNamespaces.java
 inflated: src/com/franz/ag/examples/AGSparqlReasoning.java
 inflated: src/com/franz/ag/examples/AGSNADegreesNeighbors.java
 inflated: src/com/franz/ag/examples/AGGeospatialSphericalData.java
 inflated: src/com/franz/ag/examples/AGSparqlOptionals.java
 inflated: src/com/franz/ag/examples/AGLoadNtriples.java
 inflated: src/com/franz/ag/examples/AGReasoningInverseOf.java
 inflated: src/com/franz/ag/examples/AGCloseTripleStore.java
 inflated: src/com/franz/ag/examples/AGUtils.java
 inflated: src/com/franz/ag/examples/AGDuplicates.java
 inflated: src/com/franz/ag/examples/AGKennedy.java
 inflated: src/com/franz/ag/examples/AGWilburwine.java
 inflated: src/com/franz/ag/examples/AGSparqlBasicGraphPatterns.java
 inflated: src/com/franz/ag/examples/AGSNAPaths.java
 inflated: src/com/franz/ag/examples/AGTripleStoreInfo.java
 inflated: src/com/franz/ag/examples/AGSetTripleStoreParams.java
  created: ts/
 inflated: ts/README.txt
 inflated: .classpath
 inflated: .project
$ mkdir bin
$ javac -cp lib/agraph.jar src/com/franz/ag/examples/*.java -d bin

The .class files will now be available in the bin directory.

Up | Next