Running from a Command Line

Below are instructions for running 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.

The instructions assume that the examples have already been built (either from a command line or in Eclipse), and that a server is running.

Open a shell (command prompt) and cd to the directory where the examples jar file was unpacked. You can confirm that you have the example .class files and try a few examples as shown below. You may find it helpful to proceed through the examples in the order provided in the Learning Center index.

On Windows


C:\tmp\agexamples>dir /b
.classpath
.project
bin
data
lib
src
ts

C:\tmp\agexamples>dir /b bin\com\franz\ag\examples
AGAddStatements.class
AGCloseTripleStore.class
AGConnecting.class
AGCreateLiteral.class
AGCreateTripleStore.class
AGCreateURI.class
AGCreatingTriples.class
AGDeleteTriples.class
AGDisconnecting.class
AGDuplicates.class
AGEvalInServer.class
AGFederationBasics.class
AGFederationOfFederations.class
AGFederationRangeQueries.class
AGFederationSparqlReasoning.class
AGFreetextIndex.class
AGFreetextSearch.class
AGGeonames.class
AGGeospatialBoundingBox.class
AGGeospatialBoundingBoxSpherical.class
AGGeospatialCartesianData.class
AGGeospatialHaversine.class
AGGeospatialLoaderSerializer.class
AGGeospatialPolygons.class
AGGeospatialPredicateMapping.class
AGGeospatialSphericalData.class
AGGetStatements.class
AGIndexAllTriples.class
AGIndexAutomatically.class
AGIndexFlavors.class
AGIndexNewTriples.class
AGISWCASWC2007.class
AGKennedy.class
AGLoadNtriples.class
AGLoadRDF.class
AGLoadStoreInThread.class
AGLoadWithDatatypeMapping.class
AGLoadWithPredicateMapping.class
AGLubm50Build.class
AGLubm50Sparql.class
AGNamedGraphs.class
AGNamespaceRegistries.class
AGNamespaces.class
AGNCIThesaurus.class
AGNtriplesTest.class
AGOpenCyc.class
AGOpenTripleStore.class
AGPaths.class
AGPrologDisjunction.class
AGPrologFunctorQ.class
AGPrologFunctorQminus.class
AGPrologRules.class
AGRangeQueries.class
AGRDFAxioms.class
AGReasoningDomainRange.class
AGReasoningInverseOf.class
AGReasoningSameAs.class
AGReasoningSubClassOf.class
AGReasoningSubPropertyOf.class
AGReasoningTransitiveProperty.class
AGSerializers.class
AGServerInfo.class
AGSetServerParams.class
AGSetTripleStoreParams.class
AGSNACliques.class
AGSNADegreesNeighbors.class
AGSNAGenerators.class
AGSNAMetrics.class
AGSNAPaths.class
AGSparqlAsk.class
AGSparqlBasicGraphPatterns.class
AGSparqlBlankNodeLabels.class
AGSparqlConstruct.class
AGSparqlDescribe.class
AGSparqlDistinct.class
AGSparqlFilters.class
AGSparqlFiltersInOptionals.class
AGSparqlFreetextSearch.class
AGSparqlGraphs.class
AGSparqlLimitOffset.class
AGSparqlOptionals.class
AGSparqlOrderBy.class
AGSparqlRDFLiterals.class
AGSparqlReasoning.class
AGSparqlUnions.class
AGTemporalCalendars.class
AGTemporalDateTime.class
AGTemporalIntervalIntervalRelations.class
AGTemporalLoading.class
AGTemporalPointIntervalRelations.class
AGTemporalPointPointRelations.class
AGTripleIds.class
AGTripleStoreInfo.class
AGUtils.class
AGWilburwine.class
AGWordNet.class

C:\tmp\agexamples>java -cp bin;lib\agraph.jar com/franz/ag/examples/AGConnecting

Attempting to connect to the default server.
Connected to the server on port 4567
Disconnecting from the server.
Done.

C:\tmp\agexamples>java -cp bin;lib\agraph.jar com/franz/ag/examples/AGKennedy
Loading N-Triples C:\tmp\agexamples\data\kennedy.ntriples
Loaded 1214 triples.

On Mac OS X and other Unix Platforms


$ ls
bin  data  lib  src  ts
$ ls bin/com/franz/ag/examples/
AGAddStatements.class
AGCloseTripleStore.class
AGConnecting.class
AGCreateLiteral.class
AGCreateTripleStore.class
AGCreateURI.class
AGCreatingTriples.class
AGDeleteTriples.class
AGDisconnecting.class
AGDuplicates.class
AGEvalInServer.class
AGFederationBasics.class
AGFederationOfFederations.class
AGFederationRangeQueries.class
AGFederationSparqlReasoning.class
AGFreetextIndex.class
AGFreetextSearch.class
AGGeonames.class
AGGeospatialBoundingBox.class
AGGeospatialBoundingBoxSpherical.class
AGGeospatialCartesianData.class
AGGeospatialHaversine.class
AGGeospatialLoaderSerializer.class
AGGeospatialPolygons.class
AGGeospatialPredicateMapping.class
AGGeospatialSphericalData.class
AGGetStatements.class
AGIndexAllTriples.class
AGIndexAutomatically.class
AGIndexFlavors.class
AGIndexNewTriples.class
AGISWCASWC2007.class
AGKennedy.class
AGLoadNtriples.class
AGLoadRDF.class
AGLoadStoreInThread.class
AGLoadWithDatatypeMapping.class
AGLoadWithPredicateMapping.class
AGLubm50Build.class
AGLubm50Sparql.class
AGNamedGraphs.class
AGNamespaceRegistries.class
AGNamespaces.class
AGNCIThesaurus.class
AGNtriplesTest.class
AGOpenCyc.class
AGOpenTripleStore.class
AGPaths.class
AGPrologDisjunction.class
AGPrologFunctorQ.class
AGPrologFunctorQminus.class
AGPrologRules.class
AGRangeQueries.class
AGRDFAxioms.class
AGReasoningDomainRange.class
AGReasoningInverseOf.class
AGReasoningSameAs.class
AGReasoningSubClassOf.class
AGReasoningSubPropertyOf.class
AGReasoningTransitiveProperty.class
AGSerializers.class
AGServerInfo.class
AGSetServerParams.class
AGSetTripleStoreParams.class
AGSNACliques.class
AGSNADegreesNeighbors.class
AGSNAGenerators.class
AGSNAMetrics.class
AGSNAPaths.class
AGSparqlAsk.class
AGSparqlBasicGraphPatterns.class
AGSparqlBlankNodeLabels.class
AGSparqlConstruct.class
AGSparqlDescribe.class
AGSparqlDistinct.class
AGSparqlFilters.class
AGSparqlFiltersInOptionals.class
AGSparqlFreetextSearch.class
AGSparqlGraphs.class
AGSparqlLimitOffset.class
AGSparqlOptionals.class
AGSparqlOrderBy.class
AGSparqlRDFLiterals.class
AGSparqlReasoning.class
AGSparqlUnions.class
AGTemporalCalendars.class
AGTemporalDateTime.class
AGTemporalIntervalIntervalRelations.class
AGTemporalLoading.class
AGTemporalPointIntervalRelations.class
AGTemporalPointPointRelations.class
AGTripleIds.class
AGTripleStoreInfo.class
AGUtils.class
AGWilburwine.class
AGWordNet.class
$ java -cp bin:lib/agraph.jar com/franz/ag/examples/AGConnecting
Attempting to connect to the default server.
Connected to the server on port 4567
Disconnecting from the server.
Done.
$ java -cp bin:lib/agraph.jar com/franz/ag/examples/AGKennedy 
Loading N-Triples /net/gemini/home/bmillar/test/data/kennedy.ntriples
Loaded 1214 triples.

Up | Next