Menu

[ee7d4c]: / apps / find_ontologies.cpp  Maximize  Restore  History

Download this file

37 lines (35 with data), 1.3 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/** @file "/owlcpp/apps/find_ontologies.cpp"
part of owlcpp project.
@n Distributed under the Boost Software License, Version 1.0; see doc/license.txt.
@n Copyright Mikhail K Levin 2010
*******************************************************************************/
#include <iostream>
#include "boost/foreach.hpp"
#include "owlcpp/io/catalog.hpp"
#include "owlcpp/lib_info.hpp"
/**
Make a catalog of OWL ontologies in input locations
*******************************************************************************/
int main(int argc, char* argv[]) {
owlcpp::Lib_info::print(std::cout << "find_owl\n" "built with ") << std::endl;
if( argc < 2 ) {
std::cout << "Usage: find_owl path1 [path2 ...]" << std::endl;
return 0;
}
try {
owlcpp::Catalog cat;
for(int i = 1; i != argc; ++i) add(cat, argv[i], false, 100);
std::cout << "path" << '\t' << "ontologyIRI" << '\t' << "versionIRI" << '\n';
BOOST_FOREACH(const owlcpp::Doc_id id, cat) {
std::cout
<< '\"' << cat.path(id) << "\"\t\""
<< cat.ontology_iri_str(id) << "\"\t\""
<< cat.version_iri_str(id) << "\"\n"
;
}
} catch(...) {
std::cerr << boost::current_exception_diagnostic_information() << std::endl;
return 1;
}
return 0;
}
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.