<commit_before><commit_msg>added method to add API to tripletstore when deploying<commit_after>package org.fiteagle.north.sfa;

import info.openmultinet.ontology.vocabulary.Omn_component;
import info.openmultinet.ontology.vocabulary.Omn_federation;
import info.openmultinet.ontology.vocabulary.Omn_resource;
import info.openmultinet.ontology.vocabulary.Omn_service;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.ejb.Singleton;
import javax.ejb.Startup;

import org.apache.jena.atlas.logging.Log;
import org.fiteagle.api.core.IMessageBus;
import org.fiteagle.api.core.OntologyModelUtil;
import org.fiteagle.core.tripletStoreAccessor.TripletStoreAccessor;
import org.fiteagle.core.tripletStoreAccessor.TripletStoreAccessor.ResourceRepositoryException;

import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.Resource;
import com.hp.hpl.jena.vocabulary.RDFS;


@Startup
@Singleton
public class StartUp {

private Model defaultModel;	
	
	@PostConstruct
    public void addSfaApi(){
    	Model model = ModelFactory.createDefaultModel();
    Resource resource = model.createResource("http://localhost/resource/SFA");
    resource.addProperty(Omn_resource.hasInterface, "/sfa/api/am/v3");
    resource.addProperty(Omn_resource.hasInterface, "/sfa/api/sa/v1");
    try {
		TripletStoreAccessor.addResource(resource);
		defaultModel = model;
	} catch (ResourceRepositoryException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
    }
	
	
	@PreDestroy
	public void deleteSfaApi() throws Exception {
		try{	
	    TripletStoreAccessor.deleteModel(defaultModel);
		} catch (ResourceRepositoryException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		
	}
}

{'fraction_non_alphanumeric': 0.10450250138966093, 'fraction_numerical': 0.0011117287381878821, 'mean_word_length': 5.143344709897611, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '408805', 'n_tokens_mistral': 607, 'n_tokens_neox': 579, 'n_words': 94}