当前位置: 首页>>代码示例>>Java>>正文


Java OConstants.OntologyFormat方法代码示例

本文整理汇总了Java中gate.creole.ontology.OConstants.OntologyFormat方法的典型用法代码示例。如果您正苦于以下问题:Java OConstants.OntologyFormat方法的具体用法?Java OConstants.OntologyFormat怎么用?Java OConstants.OntologyFormat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gate.creole.ontology.OConstants的用法示例。


在下文中一共展示了OConstants.OntologyFormat方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: readOntologies

import gate.creole.ontology.OConstants; //导入方法依赖的package包/类
/**
     * @param theURL
     * @param baseURI
     * @param format
     * @param asImport
     * @param file
     */
    private void readOntologies(java.net.URL theURL, String baseURI,
                                OConstants.OntologyFormat format, boolean asImport, File file) throws OWLOntologyCreationException, FileNotFoundException {
        boolean isBaseURIset = true;
        if (baseURI == null || baseURI.length() == 0) {
            isBaseURIset = false;
            baseURI = OConstants.ONTOLOGY_DEFAULT_BASE_URI;
        }
        ((OWLOntologyServiceImpl) ontologyService).readOntologyData(file,
                baseURI, format, asImport);
        if (!asImport) {
            if (isBaseURIset && getDefaultNameSpace() == null) {
                setDefaultNameSpace(baseURI);
            }
            Set<OURI> us = addOntologyURIs();
            int n = us.size();
            if (n == 0) {
                Utils.warning("No ontology URI found for ontology loaded from " + theURL);
            } else if (n > 1) {
//        Utils.warning("More than one("+n+") ontology URI found for ontology loaded from "+theURL+": "+us);
            } else {
                setDefaultNameSpaceFromOntologyURI();
            }
        }
    }
 
开发者ID:naditina,项目名称:gate-semano,代码行数:32,代码来源:AbstractOWLOntology.java

示例2: readOntologyData

import gate.creole.ontology.OConstants; //导入方法依赖的package包/类
public void readOntologyData(File selectedFile, String baseURI,
                                 OConstants.OntologyFormat format, boolean asImport) throws OWLOntologyCreationException, FileNotFoundException {
        boolean isBaseURIset = true;
        if (baseURI == null || baseURI.length() == 0) {
            isBaseURIset = false;
            baseURI = OConstants.ONTOLOGY_DEFAULT_BASE_URI;
        }
        ((OWLOntologyServiceImpl) ontologyService).readOntologyData(selectedFile,
                baseURI, format, asImport);
        if (!asImport) {
            if (isBaseURIset && getDefaultNameSpace() == null) {
                setDefaultNameSpace(baseURI);
            }
            Set<OURI> us = addOntologyURIs();
            int n = us.size();
            if (n == 0) {
                Utils.warning("No ontology URI found for ontology loaded from " + selectedFile.getAbsolutePath());
            } else if (n > 1) {
//        Utils.warning("More than one("+n+") ontology URI found for ontology loaded from "+selectedFile.getAbsolutePath()+": "+us);
            } else {
                setDefaultNameSpaceFromOntologyURI();
            }
        }
    }
 
开发者ID:naditina,项目名称:gate-semano,代码行数:25,代码来源:AbstractOWLOntology.java

示例3: writeOntologyData

import gate.creole.ontology.OConstants; //导入方法依赖的package包/类
public void writeOntologyData(File selectedFile,
    OConstants.OntologyFormat format, boolean includeImports) {
  Writer writer = null;
  try {
    writer = new OutputStreamWriter(new FileOutputStream(selectedFile), 
        "UTF-8");
    ((OntologyServiceImplSesame) ontologyService).writeOntologyData(writer,
        format, includeImports);      
  } catch (IOException ex) {
    throw new GateOntologyException("Could not open writer for file " +
        selectedFile.getAbsolutePath(), ex);
  } finally {
    try {
      if(writer != null) writer.close();
    } catch(IOException e) {
      throw new GateOntologyException("Could not close writer for file " +
          selectedFile.getAbsolutePath(), e);
    }
  }

}
 
开发者ID:Network-of-BioThings,项目名称:GettinCRAFTy,代码行数:22,代码来源:AbstractOntologyImplSesame.java

示例4: writeOntologyData

import gate.creole.ontology.OConstants; //导入方法依赖的package包/类
public void writeOntologyData(File selectedFile,
                              OConstants.OntologyFormat format, boolean includeImports) {
    FileWriter fw;
    try {
        fw = new FileWriter(selectedFile);
    } catch (IOException ex) {
        throw new GateOntologyException("Could not open writer for file " +
                selectedFile.getAbsolutePath(), ex);
    }
    ((OWLOntologyServiceImpl) ontologyService).writeOntologyData(fw,
            format, includeImports);
}
 
开发者ID:naditina,项目名称:gate-semano,代码行数:13,代码来源:AbstractOWLOntology.java

示例5: readOntologyData

import gate.creole.ontology.OConstants; //导入方法依赖的package包/类
public void readOntologyData(File selectedFile, String baseURI,
    OConstants.OntologyFormat format, boolean asImport) {
  Reader input = null;
  try {
    input = new InputStreamReader(new FileInputStream(selectedFile), "UTF-8");
    boolean isBaseURIset = true;
    if(baseURI == null || baseURI.length() == 0) {
      isBaseURIset = false;
      baseURI = OConstants.ONTOLOGY_DEFAULT_BASE_URI;
    }
   ((OntologyServiceImplSesame) ontologyService).readOntologyData(input,
        baseURI, format, asImport);
    if(!asImport) {
      if(isBaseURIset && getDefaultNameSpace() == null) {
        setDefaultNameSpace(baseURI);
      } else {
        setDefaultNameSpaceFromRepository();
        if(format.equals(OConstants.OntologyFormat.RDFXML)) {
          setDefaultNameSpaceByPeeking(selectedFile);
        }
      }
    }      
  } catch (IOException ex) {
    throw new GateOntologyException("Problem reading from file " + 
        selectedFile, ex);
  } finally {
    try {
      if(input != null)  input.close();
    } catch(IOException e) {
      throw new GateOntologyException("Problem closing file " + 
          selectedFile, e);
    }
  }

}
 
开发者ID:Network-of-BioThings,项目名称:GettinCRAFTy,代码行数:36,代码来源:AbstractOntologyImplSesame.java

示例6: getFormat

import gate.creole.ontology.OConstants; //导入方法依赖的package包/类
/**
 * Return the file format chosen by the user
 * @return the OntologyFormat chosen by the user
 */
public OConstants.OntologyFormat getFormat() {
  int selected = formatChooser.getSelectedIndex();
  return OntologyFormat.values()[selected];
}
 
开发者ID:Network-of-BioThings,项目名称:GettinCRAFTy,代码行数:9,代码来源:GUILoadOptionsPane.java

示例7: getFormat

import gate.creole.ontology.OConstants; //导入方法依赖的package包/类
/**
 * Get the ontology format specified by the user
 * @return a OntologyFormat for the file to be saved
 */
public OConstants.OntologyFormat getFormat() {
  int selected = formatChooser.getSelectedIndex();
  return OntologyFormat.values()[selected];
}
 
开发者ID:Network-of-BioThings,项目名称:GettinCRAFTy,代码行数:9,代码来源:GUISaveOptionsPane.java

示例8: getFormat

import gate.creole.ontology.OConstants; //导入方法依赖的package包/类
/**
 * Return the file format chosen by the user
 *
 * @return the OntologyFormat chosen by the user
 */
public OConstants.OntologyFormat getFormat() {
    int selected = formatChooser.getSelectedIndex();
    return OntologyFormat.values()[selected];
}
 
开发者ID:naditina,项目名称:gate-semano,代码行数:10,代码来源:GUILoadOptionsPane.java


注:本文中的gate.creole.ontology.OConstants.OntologyFormat方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。