Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OME ontologies: schemas and samples reorganization #93

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion cmake/XsdFu.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ set(XSD_FU python ${XSD_FU_SCRIPT})
set(MODEL_VERSION 2016-06)

# Path to the model within the source tree
set(MODEL_PATH ${PROJECT_SOURCE_DIR}/specification/src/main/resources/released-schema/${MODEL_VERSION})
set(MODEL_PATH ${PROJECT_SOURCE_DIR}/specification/src/main/resources/schemas/${MODEL_VERSION})

# Files to use within the model directory
set(MODEL_FILES
Expand Down
2 changes: 1 addition & 1 deletion ome-xml/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
function(ome_xml_add_test)
add_test(${ARGV})
set_tests_properties(${ARGV0}
PROPERTIES ENVIRONMENT "OME_XML_SCHEMADIR=${PROJECT_SOURCE_DIR}/specification/src/main/resources/released-schema;OME_XML_TRANSFORMDIR=${PROJECT_SOURCE_DIR}/specification/src/main/resources/transforms;OME_XML_SAMPLEDIR=${PROJECT_SOURCE_DIR}/specification/src/main/resources/samples")
PROPERTIES ENVIRONMENT "OME_XML_SCHEMADIR=${PROJECT_SOURCE_DIR}/specification/src/main/resources/schemas;OME_XML_TRANSFORMDIR=${PROJECT_SOURCE_DIR}/specification/src/main/resources/transforms;OME_XML_SAMPLEDIR=${PROJECT_SOURCE_DIR}/specification/src/main/resources/samples")
endfunction()

add_subdirectory(src/main/cpp)
Expand Down
18 changes: 9 additions & 9 deletions ome-xml/src/main/cpp/ome/xml/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -239,15 +239,15 @@ add_custom_target(gensrc DEPENDS
${OME_XML_GENERATED_MODEL_ENUMS_HEADERS})

# Find and install all schemas
file(GLOB OME_SCHEMAS RELATIVE "${PROJECT_SOURCE_DIR}/specification/src/main/resources/released-schema/"
"${PROJECT_SOURCE_DIR}/specification/src/main/resources/released-schema/catalog.xml"
"${PROJECT_SOURCE_DIR}/specification/src/main/resources/released-schema/2*/*.xsd"
"${PROJECT_SOURCE_DIR}/specification/src/main/resources/released-schema/2*/catalog.xml"
"${PROJECT_SOURCE_DIR}/specification/src/main/resources/released-schema/external/*.xsd"
"${PROJECT_SOURCE_DIR}/specification/src/main/resources/released-schema/external/catalog.xml")
file(GLOB OME_SCHEMAS RELATIVE "${PROJECT_SOURCE_DIR}/specification/src/main/resources/schemas/"
"${PROJECT_SOURCE_DIR}/specification/src/main/resources/schemas/catalog.xml"
"${PROJECT_SOURCE_DIR}/specification/src/main/resources/schemas/2*/*.xsd"
"${PROJECT_SOURCE_DIR}/specification/src/main/resources/schemas/2*/catalog.xml"
"${PROJECT_SOURCE_DIR}/specification/src/main/resources/schemas/external/*.xsd"
"${PROJECT_SOURCE_DIR}/specification/src/main/resources/schemas/external/catalog.xml")
foreach(schema ${OME_SCHEMAS})
get_filename_component(SCHEMA_RELEASE ${schema} PATH)
install(FILES "${PROJECT_SOURCE_DIR}/specification/src/main/resources/released-schema/${schema}"
install(FILES "${PROJECT_SOURCE_DIR}/specification/src/main/resources/schemas/${schema}"
DESTINATION "${OME_XML_INSTALL_SCHEMADIR}/${SCHEMA_RELEASE}"
COMPONENT "runtime")
endforeach(schema)
Expand All @@ -263,10 +263,10 @@ foreach(transform ${OME_TRANSFORMS})
endforeach(transform)

# Find and install all samples
file(GLOB_RECURSE OME_SAMPLES RELATIVE "${PROJECT_SOURCE_DIR}/specification/samples/" "${PROJECT_SOURCE_DIR}/specification/samples/*")
file(GLOB_RECURSE OME_SAMPLES RELATIVE "${PROJECT_SOURCE_DIR}/specification/src/main/resources/samples/" "${PROJECT_SOURCE_DIR}/specification/src/main/resources/samples/*")
foreach(sample ${OME_SAMPLES})
get_filename_component(SAMPLE_FILE ${sample} PATH)
install(FILES "${PROJECT_SOURCE_DIR}/specification/samples/${sample}"
install(FILES "${PROJECT_SOURCE_DIR}/specification/src/main/resources/samples/${sample}"
DESTINATION "${OME_XML_INSTALL_SAMPLEDIR}/${SAMPLE_FILE}"
COMPONENT "runtime")
endforeach(sample)
2 changes: 1 addition & 1 deletion ome-xml/src/test/cpp/model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ namespace

/// @todo Use the correct model version when available.
/// @todo Use all model versions when transforms available.
path dir(PROJECT_SOURCE_DIR "/specification/samples/" "2015-01");
path dir(PROJECT_SOURCE_DIR "/specification/src/main/resources/samples/" "2015-01");
if (exists(dir) && is_directory(dir))
{
for(directory_iterator i(dir); i != directory_iterator(); ++i)
Expand Down
2 changes: 1 addition & 1 deletion ome-xml/src/test/cpp/transform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ namespace
ome::xml::OMETransformResolver tr;
std::set<std::string> versions = tr.schema_versions();

path samplesdir(PROJECT_SOURCE_DIR "/specification/samples");
path samplesdir(PROJECT_SOURCE_DIR "/specification/src/main/resources/samples");
if (exists(samplesdir) && is_directory(samplesdir))
{
for (directory_iterator si(samplesdir); si != directory_iterator(); ++si)
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
<ome-common.version>${ome_common.version}</ome-common.version>

<ome.model.schemaver>2016-06</ome.model.schemaver>
<ome.model.schemapath>specification/src/main/resources/released-schema/${ome.model.schemaver}</ome.model.schemapath>
<ome.model.schemapath>specification/src/main/resources/schemas/${ome.model.schemaver}</ome.model.schemapath>
<ome.model.omeschema>${ome.model.schemapath}/ome.xsd</ome.model.omeschema>

<!-- NB: Avoid platform encoding warning when copying resources. -->
Expand Down
10 changes: 5 additions & 5 deletions specification/publish
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ curdate() {
# Get the most recent version of a schema
# $1=schema name
mostrecentversion() {
echo "$(basename $(dirname $(find src/main/resources/released-schema -name "$1" | grep -v $devmarker | sort | tail -n1)))"
echo "$(basename $(dirname $(find src/main/resources/schemas -name "$1" | grep -v $devmarker | sort | tail -n1)))"
}

# Check if the a schema is the most recent version (return true) or legacy (return false)
Expand Down Expand Up @@ -88,7 +88,7 @@ schemastatus() {
# $1=schema name
# $2=release to check if current
schemaversion() {
version=$(grep "version=" "src/main/resources/released-schema/$2/$1" | grep -v 'xml' | head -n1 | sed -e 's;^.*version="\([0-9][0-9]*\)".*$;\1;')
version=$(grep "version=" "src/main/resources/schemas/$2/$1" | grep -v 'xml' | head -n1 | sed -e 's;^.*version="\([0-9][0-9]*\)".*$;\1;')
if [ -z "$version" ]; then
version="1"
fi
Expand Down Expand Up @@ -155,7 +155,7 @@ root=target/published
rm -rf "$root"
mkdir -p "$root"

for dir in src/main/resources/released-schema/20*
for dir in src/main/resources/schemas/20*
do

if contains $dir $devmarker; then
Expand Down Expand Up @@ -407,11 +407,11 @@ the
<ul>
EOF

for release in $(ls -1d src/main/resources/released-schema/20* | grep -v 2003 | grep -v $devmarker | xargs $XARGSOPTS -n1 basename | sort -r); do
for release in $(ls -1d src/main/resources/schemas/20* | grep -v 2003 | grep -v $devmarker | xargs $XARGSOPTS -n1 basename | sort -r); do
reldate=$(parsedate "$release")
echo "<li>$reldate - namespace /$release/</li>"
done
for release in $(ls -1d src/main/resources/released-schema/20* | grep 2003 | xargs $XARGSOPTS -n1 basename | sort -r | grep FC | sed -e 's;2003-\(.*\);\1;') $(ls -1d src/main/resources/released-schema/20* | grep 2003 | xargs $XARGSOPTS -n1 basename | sort -r | grep -v FC | sed -e 's;2003-\(.*\);\1;'); do
for release in $(ls -1d src/main/resources/schemas/20* | grep 2003 | xargs $XARGSOPTS -n1 basename | sort -r | grep FC | sed -e 's;2003-\(.*\);\1;') $(ls -1d src/main/resources/schemas/20* | grep 2003 | xargs $XARGSOPTS -n1 basename | sort -r | grep -v FC | sed -e 's;2003-\(.*\);\1;'); do
reldate="2003 ($release)"
echo "<li>$reldate - namespace /$release/*.xsd</li>"
done
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public class SchemaResolver implements LSResourceResolver
private static String GIT_MASTER_PATH = "http://git.openmicroscopy.org/src/master/components/specification";
private static String GIT_DEVELOP_PATH = "http://git.openmicroscopy.org/src/develop/components/specification";
private static String MAIN_PATH = "http://www.openmicroscopy.org/Schemas/";
private static String MAIN_SEARCH_PATH = "/released-schema/";
private static String MAIN_SEARCH_PATH = "/schemas/";
private static String LEGACY_AC_PATH = "http://www.openmicroscopy.org/XMLschemas/AnalysisChain/RC1/";
private static String LEGACY_AM_PATH = "http://www.openmicroscopy.org/XMLschemas/AnalysisModule/RC1/";
private static String LEGACY_BF_PATH = "http://www.openmicroscopy.org/XMLschemas/BinaryFile/RC1/";
Expand All @@ -67,7 +67,7 @@ public class SchemaResolver implements LSResourceResolver
private static String LEGACY_ML_PATH = "http://www.openmicroscopy.org/XMLschemas/MLI/IR2/";
private static String LEGACY_OM_PATH = "http://www.openmicroscopy.org/XMLschemas/OME/FC/";
private static String LEGACY_ST_PATH = "http://www.openmicroscopy.org/XMLschemas/STD/RC2/";
private static String LEGACY_SEARCH_PATH = "/released-schema/2003-FC/";
private static String LEGACY_SEARCH_PATH = "/schemas/2003-FC/";

public SchemaResolver() throws ClassNotFoundException, InstantiationException, IllegalAccessException
{
Expand Down Expand Up @@ -136,7 +136,7 @@ public LSInput resolveResource(
// Match the requested schema locations and create the appropriate LSInput object
if (systemId.equals("http://www.w3.org/2001/xml.xsd"))
{
theResult = makeSubstutionStream("/released-schema/external/xml.xsd", systemId);
theResult = makeSubstutionStream("/schemas/external/xml.xsd", systemId);
}
else if (systemId.startsWith(GIT_MASTER_PATH))
{
Expand Down
Loading