Skip to content

Running example problem #10

@jupiterhyun

Description

@jupiterhyun

Hi, when I play with the example. Basically I have three schemes need to run the match algorithm, I use one match manager to do the job, however, I have received this error message:
Exception in thread "main" java.lang.IllegalArgumentException: the value should be from 0 to 4, found instead: 5
at it.unitn.disi.smatch.async.AsyncTask.setProgress(AsyncTask.java:289)
at it.unitn.disi.smatch.async.AsyncTask.progress(AsyncTask.java:590)
at it.unitn.disi.smatch.async.AsyncTask.progress(AsyncTask.java:574)
at it.unitn.disi.smatch.matchers.element.RunnableElementMatcher.elementLevelMatching(RunnableElementMatcher.java:218)
at it.unitn.disi.smatch.MatchManager.elementLevelMatching(MatchManager.java:189)
at it.unitn.disi.smatch.MatchManager.online(MatchManager.java:220)
at it.unitn.disi.smatch.MatchManager.match(MatchManager.java:232)
at it.unitn.disi.smatch.examples.SMatchAPIDemo.example(SMatchAPIDemo.java:78)
at it.unitn.disi.smatch.examples.SMatchAPIDemo.main(SMatchAPIDemo.java:21)

Could you please help on how to solve this? Thank you very much,

The source code is here:

    System.out.println("Starting example...");
    System.out.println("Creating MatchManager...");
    IMatchManager mm = MatchManager.getInstanceFromResource("/it/unitn/disi/smatch/examples/conf/s-match-spsm.xml");

    System.out.println("Creating source context...");
    IContext s = mm.createContext();
    INode sroot = s.createRoot("university one");
    sroot.createChild("student");

    System.out.println("Creating target context...");
    IContext t = mm.createContext();
    INode root = t.createRoot("student.xml");
    root.createChild("student name");
    root.createChild("date of birth");
    root.createChild("cell number");
    root.createChild("email");
    root.createChild("student id");
    root.createChild("major");

    IContext s2 = mm.createContext();
    INode sroot2 = s2.createRoot("student two");
    sroot2.createChild("student");
    
    IContextMapping<INode> result = mm.match(s, s2);
    
    System.out.println("Processing results...");
    System.out.println("Printing matches:");
    for (IMappingElement<INode> e : result) {
        System.out.println(e.getSource().nodeData().getName() + "\t" + e.getRelation() + "\t" + e.getTarget().nodeData().getName());
    }
    
    result = mm.match(s, t);
    
    System.out.println("Processing results...");
    System.out.println("Printing matches:");
    for (IMappingElement<INode> e : result) {
        System.out.println(e.getSource().nodeData().getName() + "\t" + e.getRelation() + "\t" + e.getTarget().nodeData().getName());
    }
    
    System.out.println("Done");

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions