Skip to content

Unable to omit 'Unrecognized extension field' warnings for fields in RDF schema #623

Open

Description

@bogdang989

Hi,
The attachment contains test files to reproduce the issue (CWL and the xml schema file) - cwl-schemas.tar.gz

When running the tool with cwltool version 1.0.20180116213856 an 'Unrecognized extension field' warning is printed out. While running with an older version (1.0.20170413194156) there was no warning.
cwltool schemas-tool1.cwl -- --input foobar

Expected Behavior

After including $schemas in the CWL, cwltool should not print out a warning.

Actual Behavior

After including $schemas in the CWL, cwltool version 1.0.20180116213856 prints out a warning.

Workflow Code

class: CommandLineTool
cwlVersion: v1.0
id: schema
baseCommand:
  - echo
inputs:
  - id: input
    type: string?
    inputBinding:
      position: 0
outputs:
  - id: output
    type: File?
    outputBinding:
      glob: stdout.txt
label: schemas-tool1
requirements:
  - class: DockerRequirement
    dockerPull: 'ubuntu:16.04'
stdout: stdout.txt
$namespaces:
  sbg: 'http://sbgenomics.com/schema#'
$schemas:
  - sbg-schema.xml
'sbg:appVersion':
  - v1.0

Full Traceback

schemas-tool1.cwl:1:1: unrecognized extension field `http://sbgenomics.com/schema#appVersion`.  Did you include a $schemas section?

Your Environment

  • cwltool version: 1.0.20180116213856
    Check using cwltool --version

Activity

  1. tetron commented on Jan 24, 2018

    @tetron
    Member

    Hmm, this looks correct, will have to investigate.

  2. tetron commented on Jan 24, 2018

    @tetron
    Member

    Also, this is actually a schema-salad bug. You should get a similar result using schema-salad-tool for validation:

    schema-salad-tool common-workflow-language/v1.0/CommonWorkflowLanguage.yml schemas-tool1.cwl
    
  3. bogdang989 commented on Jan 24, 2018

    @bogdang989
    MemberAuthor

    Cool, thanks for the quick response.

  4. bogdang989 commented on Jan 24, 2018

    @bogdang989
    MemberAuthor

    Yes, actually when running with schema-salad-tool version 2.6.20171201034858 there is no warning

  5. tetron commented on Jan 25, 2018

    @tetron
    Member

    Perhaps you just need to update the version of schema salad you are using with cwltool?

  6. anton-khodak commented on Jan 27, 2018

    @anton-khodak
    Member

    Confirming with cwltool 1.0.20180116213856, using schema-salad of the latest version does not help

  7. keiranmraine commented on Feb 7, 2018

    @keiranmraine

    also #455 (discussed with mr-c on gitter 14-Dec)

  8. tetron commented on Feb 13, 2018

    @tetron
    Member

    This turn out to be a really stupid bug. The default for --skip-schemas is True so it would never load the schemas as intended. See #656 has the fix.

    Separately there is a schema-salad bug in that it prints warnings even when extension schemas were skipped.

  9. mr-c commented on Feb 15, 2018

    @mr-c
    Member

    @tetron I can confirm that the behaviour of --skip-schemas is fixed, however cwltool is still printing a false warning:
    test.cwl:1:1: unrecognized extension field 'http://edamontology.org/topic_0003'. Did you include a $schemas section?

    Here's a minimal reproducible version:

    class: CommandLineTool
    cwlVersion: v1.0
    id: schema
    baseCommand: [] 
    inputs: []
    outputs: []
    
    $namespaces:
      edam: http://edamontology.org/
    
    $schemas:
      http://edamontology.org/EDAM_1.16.owl
    
    edam:topic_0003: edam:topic_3500
    
    
  10. added this to the v1.1 milestone on Feb 15, 2018
  11. tetron commented on Feb 15, 2018

    @tetron
    Member

    Here's what schema salad infers to be property (== RDF predicate) based on my understanding of RDFS and OWL:

    • Anything rdf:type rdf:Property
    • Anything defined as a subproperty of something else
    • Anything listed as having a range of values
    • Anything rdf:type owl:ObjectProperty

    It doesn't look to me like edam:topic_0003 is any of those things. Is it mislabeled in the ontology or am I misunderstanding what should be considered a predicate in OWL?

            for s, _, _ in self.graph.triples((None, RDF.type, RDF.Property)):
                self._add_properties(s)
            for s, _, o in self.graph.triples((None, RDFS.subPropertyOf, None)):
                self._add_properties(s)
                self._add_properties(o)
            for s, _, _ in self.graph.triples((None, RDFS.range, None)):
                self._add_properties(s)
            for s, _, _ in self.graph.triples((None, RDF.type, OWL.ObjectProperty)):
                self._add_properties(s)
    
  12. mr-c commented on Feb 15, 2018

    @mr-c
    Member

    @tetron Admittedly I just switched to EDAM as I don't have a copy of sbg-schema.xml.

    Checking cwltool --validate https://raw.githubusercontent.com/common-workflow-language/workflows/master/tools/ucsc-liftOver.cwl (which uses schema.org) and I get no errors.

    So I guess the issue remains that schemas-tool1.cwl:1:1: unrecognized extension field 'http://sbgenomics.com/schema#appVersion'. Did you include a $schemas section? is not a helpful error message.

  13. tetron commented on Feb 15, 2018

    @tetron
    Member

    Yes, the error message could be more helpful (like, if you did include $schemas section, it shouldn't lecture you about it). It could also list all the predicates it is expecting to find, although that could be long, and it's not nice to spam the user.

    On EDAM, I think edam:topic_0003 is the "class of things which are topics in edam". I believe what you actually want is the predicate edam:has_topic, so see if this works:

    edam:has_topic: edam:topic_3500

    Which would express that the workflow was related to the topic of Zoology.

  14. added a commit that references this issue on Mar 20, 2018
  15. added a commit that references this issue on Apr 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions