package oor; import java.util.List; import java.util.ArrayList; import java.util.Set; import java.util.HashSet; import java.util.Map; import java.util.HashMap; import java.util.Collection; import java.io.IOException; import java.io.FileNotFoundException; import javax.jws.WebService; import org.apache.lucene.search.Query; import org.ncbo.stanford.bean.AbstractIdBean; import org.ncbo.stanford.bean.CategoryBean; import org.ncbo.stanford.bean.concept.AbstractConceptBean; import org.ncbo.stanford.bean.concept.ClassBean; import org.ncbo.stanford.bean.concept.InstanceBean; import org.ncbo.stanford.bean.GroupBean; import org.ncbo.stanford.bean.logging.UsageLoggingBean; import org.ncbo.stanford.bean.notes.AppliesToBean; import org.ncbo.stanford.bean.notes.NoteBean; import org.ncbo.stanford.bean.OntologyBean; import org.ncbo.stanford.bean.OntologyIdBean; import org.ncbo.stanford.bean.OntologyMetricsBean; import org.ncbo.stanford.bean.OntologyVersionIdBean; import org.ncbo.stanford.bean.ProjectBean; import org.ncbo.stanford.bean.RatingBean; import org.ncbo.stanford.bean.RatingTypeBean; import org.ncbo.stanford.bean.ReviewBean; import org.ncbo.stanford.bean.search.SearchBean; import org.ncbo.stanford.bean.search.SearchResultListBean; import org.ncbo.stanford.bean.SubscriptionsBean; import org.ncbo.stanford.bean.TimedIdBean; import org.ncbo.stanford.bean.UserBean; import org.ncbo.stanford.enumeration.NoteAppliesToTypeEnum; import org.ncbo.stanford.enumeration.NotificationTypeEnum; import org.ncbo.stanford.enumeration.PropertyTypeEnum; import org.ncbo.stanford.exception.MetadataException; import org.ncbo.stanford.exception.MetadataObjectNotFoundException; import org.ncbo.stanford.exception.NoteNotFoundException; import org.ncbo.stanford.service.ontology.OntologyService; import org.ncbo.stanford.service.session.RESTfulSession; import org.ncbo.stanford.util.ontologyfile.compressedfilehandler.impl.CompressedFileHandlerFactory; import org.ncbo.stanford.util.ontologyfile.pathhandler.FilePathHandler; import org.ncbo.stanford.util.ontologyfile.pathhandler.impl.CommonsFileUploadFilePathHandlerImpl; import org.ncbo.stanford.util.ontologyfile.pathhandler.impl.URIUploadFilePathHandlerImpl; import org.ncbo.stanford.util.paginator.impl.Page; import org.protege.notesapi.notes.NoteType; import org.semanticweb.owlapi.apibinding.OWLManager; import org.semanticweb.owlapi.model.OWLOntology; import org.semanticweb.owlapi.model.OWLOntologyManager; @WebService(name = "OOR", targetNamespace = "http://oor/") public interface OORI { // Search and navigation within one ontology public List findConceptsByProperty(PropertyTypeEnum type, String value, Collection ontologyIds); public ClassBean findRootConcept(Integer ontologyVersionId, Integer maxNumChildren, boolean light) throws Exception; public ClassBean findConcept(Integer ontologyVersionId, String conceptId, Integer maxNumChildren, boolean light, boolean noRelations) throws Exception; public ClassBean findPathFromRoot(Integer ontologyVersionId, String conceptId, boolean light, Integer maxNumChildren) throws Exception; public List findParents1(OntologyVersionIdBean ontologyVersionId, String conceptId, Integer level, Integer offset, Integer limit) throws Exception; public List findParents2(OntologyIdBean ontologyId, String conceptId, Integer level, Integer offset, Integer limit) throws Exception; public List findChildren1(OntologyVersionIdBean ontologyVersionId, String conceptId, Integer level, Integer offset, Integer limit) throws Exception; public List findChildren2(OntologyIdBean ontologyId, String conceptId, Integer level, Integer offset, Integer limit) throws Exception; public Set findChildrenConceptIds(OntologyIdBean ontologyId, String conceptId, Integer level, Integer offset, Integer limit) throws Exception; public List findRootPaths1(OntologyVersionIdBean ontologyVersionId, String conceptId, Integer offset, Integer limit) throws Exception; public List findRootPaths2(OntologyIdBean ontologyVersionId, String conceptId, Integer offset, Integer limit) throws Exception; public List findSiblings1(OntologyVersionIdBean ontologyVersionId, String conceptId, Integer level, Integer offset) throws Exception; public List findSiblings2(OntologyIdBean ontologyId, String conceptId, Integer level, Integer offset) throws Exception; public List findLeaves1(OntologyVersionIdBean ontologyVersionId, String conceptId, Integer offset, Integer limit) throws Exception; public List findLeaves2(OntologyIdBean ontologyVersionId, String conceptId, Integer offset, Integer limit) throws Exception; public Page findAllConcepts(Integer ontologyVersionId, Integer pageSize, Integer pageNum) throws Exception; public InstanceBean findInstanceById(Integer ontologyVerId, String instanceId) throws Exception; public Page findInstancesByConceptId(Integer ontologyVerId, String instanceId, Integer pageSize, Integer pageNum) throws Exception; // Differences between ontologies public void createDiff(Integer newOntologyVersionId, Integer oldOntologyVersionId) throws Exception; public void createDiffForLatestActiveOntologyVersionPair(List ontologyIds) throws Exception; public void createDiffForAllActiveVersionsOfOntology(List ontologyIds) throws Exception ; public List> getAllDiffsForOntology(Integer ontologyId) throws Exception; public String getDiffFileForOntologyVersions(Integer ontologyVerisonId1, Integer ontologyVersionId2, String format) throws FileNotFoundException, Exception; // Generation of RDF public String generateRDFDump(Integer ontologyVersionId) throws Exception; public void generateRdf1() throws Exception; public String generateRdf2(OntologyBean ontology) throws Exception; public String generateRdf3(OntologyBean ontology, String conceptId) throws Exception; public String generateRdf4(OntologyBean ontology, List conceptIds) throws Exception; // Notification and subscriptions public void sendNotification(NotificationTypeEnum notificationType, OntologyBean ontologyBean, HashMap keywords); public void sendMail(String from, String email, String subject, String messageId, String inReplyTo, String sendingMessage); public List listOfSubscriptions(Integer userId); public void createSubscriptions(SubscriptionsBean subscriptionsBean); public void updateSubscriptions(SubscriptionsBean subscriptionsBean); public void removeSubscriptions(SubscriptionsBean subscriptionsBean); public SubscriptionsBean findSubscriptionsForUserId(Integer userId); public List listOfSubscriptionsForOntologyId(String ontologyId); // Administration public void indexAllOntologies(boolean doBackup, boolean doOptimize) throws Exception; public void indexOntology(Integer ontologyId, boolean doBackup, boolean doOptimize) throws Exception; public void indexOntologies(List ontologyIdList, boolean doBackup, boolean doOptimize) throws Exception; public void removeOntology(Integer ontologyId, boolean doBackup, boolean doOptimize) throws Exception; public void removeOntologies(List ontologyIds, boolean doBackup, boolean doOptimize) throws Exception; public void backupIndex() throws Exception; public void optimizeIndex() throws Exception; public void doCVSPull(); public void parseOntologies1(); public void parseOntologies2(List ontologyVersionIdList, String formatHandler); public List getErrorOntologies2(); public void reloadMetadataOntology() throws Exception; public RESTfulSession createNewSession(); public RESTfulSession getSession(String sessionKey); public UserBean findUser1(Integer userId); public UserBean findUser2(String username); public UserBean findUserByEmail(String email); public List findUsers(); public void createUser(UserBean userBean); public void updateUser(UserBean userBean); public void deleteUser(UserBean userBean); // Evaluations and Metrics public void updateOntologyMetrics(OntologyBean ontologyBean, OntologyMetricsBean metricsBean) throws Exception; public OntologyMetricsBean getOntologyMetrics(OntologyBean ontologyBean) throws Exception; public void extractOntologyMetrics(List ontologyVersionIds); public List getErrorOntologies1(); public ReviewBean retrieveReview(Integer id); public ReviewBean createReview(String text, Integer userid, Integer projectid, Integer ontologyid); public void updateReview(Integer id, String text, Integer userid, Integer projectid, Integer ontologyid); public void deleteReview(Integer id); public RatingBean createRating(ReviewBean reviewBean) throws MetadataObjectNotFoundException, MetadataException; public void updateRating(RatingBean ratingBean) throws MetadataObjectNotFoundException, MetadataException; public void deleteRating(Integer id) throws MetadataObjectNotFoundException; public Collection getReviewsForOntology(Integer id) throws MetadataObjectNotFoundException, MetadataException; public Collection getAllRatingTypes(); public RatingTypeBean retrieveRatingType(Integer id) throws MetadataObjectNotFoundException; public void logUsage(UsageLoggingBean usageLoggingBean); public List extractUsage(UsageLoggingBean usageLoggingBean); // Ontology Development public NoteBean createNote(OntologyBean ont, String appliesTo, NoteAppliesToTypeEnum appliesToType, NoteType noteType, String subject, String content, String author, String status, Long created) throws Exception; public NoteBean createNewTermProposal(OntologyBean ont, String appliesTo, NoteAppliesToTypeEnum appliesToType, NoteType noteType, String subject, String content, String author, String status, Long created, String reasonForChange, String contactInfo, String termDefinition, String termId, String termParent, String termPreferredName, List termSynonyms) throws Exception; public NoteBean createNewRelationshipProposal(OntologyBean ont, String appliesTo, NoteAppliesToTypeEnum appliesToType, NoteType noteType, String subject, String content, String author, String status, Long created, String reasonForChange, String contactInfo, String relationshipType, String relationshipTarget, String relationshipOldTarget) throws Exception; public NoteBean createNewPropertyValueChangeProposal(OntologyBean ont, String appliesTo, NoteAppliesToTypeEnum appliesToType, NoteType noteType, String subject, String content, String author, String status, Long created, String reasonForChange, String contactInfo, String propertyNewValue, String propertyOldValue, String propertyId) throws Exception; public NoteBean updateNote(OntologyBean ont, String noteId, NoteType noteType, String subject, String content, String author, Long created, String status, String appliesTo, NoteAppliesToTypeEnum appliesToType) throws Exception; public void archiveNote(OntologyBean ont, String noteId); public void unarchiveNote(OntologyBean ont, String noteId); public void archiveThread(OntologyBean ont, String rootNoteId); public void unarchiveThread(OntologyBean ont, String rootNoteId); public void deleteNote(OntologyBean ont, String noteId); public NoteBean getNoteBean(OntologyBean ont, String noteId) throws NoteNotFoundException; public NoteBean getRootNote(OntologyBean ont, NoteBean note) throws NoteNotFoundException; public List getAllNotesForOntology(OntologyBean ont, Boolean threaded, Boolean topLevelOnly); public List getAllNotesForOntologyByAuthor(OntologyBean ont, Integer author); public List getAllNotesForConcept(OntologyBean ont, ClassBean concept, Boolean threaded); public List getAllNotesForIndividual(OntologyBean ont, String instanceId, Boolean threaded); public List getAllNotesForNote(OntologyBean ont, String noteId, Boolean threaded) throws NoteNotFoundException; public List getProjectsForUser(Integer id) throws Exception; public ProjectBean retrieveProject(Integer id); public ProjectBean createProject(String name, String description, String homepage, String people, String institution, Integer userid); public void updateProject(Integer id, String name, String description, String homepage, String people, String institution, Integer userid); public void deleteProject(Integer id); // Find Ontologies public List findAllCategories() throws Exception; public List findCategoryIdsByOBOFoundryNames(String[] oboFoundryNames) throws Exception; public List findAllGroups() throws Exception; public OntologyBean findLatestOntologyVersionByOboFoundryId(String oboFoundryId) throws Exception; public List findLatestOntologyVersions() throws Exception; public List findLatestAutoPulledOntologyVersions() throws Exception; public List findLatestActiveOntologyVersions() throws Exception; public List findAllOntologyOrViewVersionsByVirtualId(Integer ontologyOrViewId, boolean excludeDeprecated) throws Exception; public List searchOntologyMetadata(String query, boolean includeViews) throws Exception; public OntologyBean findOntologyOrView(Integer ontologyVersionId) throws Exception; public OntologyBean findLatestOntologyOrViewVersion(Integer ontologyId) throws Exception; public OntologyBean findLatestActiveOntologyOrViewVersion(Integer ontologyId) throws Exception; public String getOntologyFile(OntologyBean ontologyBean) throws Exception; public List findLatestOntologyViewVersions() throws Exception; public List findLatestActiveOntologyViewVersions() throws Exception; public Page executeQuery1(String expr, boolean includeProperties, boolean isExactMatch, Integer pageSize, Integer pageNum, Integer maxNumHits) throws Exception; public Page executeQuery2(String expr, boolean includeProperties, boolean isExactMatch, Integer maxNumHits) throws Exception; public Page executeQuery3(String expr, Collection ontologyIds, boolean includeProperties, boolean isExactMatch, Integer pageSize, Integer pageNum, Integer maxNumHits, String subtreeRootConceptId) throws Exception; public Page executeQuery4(String expr, Collection ontologyIds, boolean includeProperties, boolean isExactMatch, Integer maxNumHits, String subtreeRootConceptId) throws Exception; public Page executeQuery5(Query query, Integer pageSize, Integer pageNum, Integer maxNumHits, String subtreeRootConceptId) throws Exception; public Page executeQuery6(Query query, Integer maxNumHits, String subtreeRootConceptId) throws Exception; public Query generateLuceneSearchQuery(Collection ontologyIds, String expr, boolean includeProperties, boolean isExactMatch) throws IOException; public SearchResultListBean runQuery(Query query, Integer maxNumHits, String subtreeRootConceptId) throws Exception; public void emptySearchCache(); public void reloadSearchCache(); // Ontology Registration public void createOntologyOrView(OntologyBean ontologyBean) throws Exception; public void updateOntologyOrView(OntologyBean ontologyBean) throws Exception; public void cleanupOntologyCategory(OntologyBean ontologyBean); public void deleteOntologyOrView(Integer ontologyVersionId, boolean removeMetadata, boolean removeOntologyFiles) throws Exception; public void deleteOntologiesOrViews(List ontologyVersionIds, boolean removeMetadata, boolean removeOntologyFiles); public String extractView(int ontologyversionid, String ontologyid, String delay, String filterrelations, String ontologyname, String existontology, String logcount, Integer savecount); }