In order for resources to be indexed in the triplestore, they must be flagged as "indexable". See documentation under External Search for how to mark resources for indexing.
Instructions for how to setup the triplestores currently supported by the JMS indexer: Fuseki and Sesame. Other triplestores that support SPARQL Update may also work, but have not been tested.
Creating, modifying or deleting resources in the repository generates JMS events. The indexer listens to those events, and retrieves the RDF from the repository. The indexer can be configured to process the event in various ways, such as copying the resource RDF to a triplestore or indexing in Solr.
This page provides detailed steps for creating repository content via the REST API, and SPARQL queries to demonstrate that content has been synchronized to an external triplestore. For more details on setting up triplestore sync, see External Triplestore. Much more information about the REST API is available at: RESTful HTTP API and Another Take on the REST API .