Hi Hasan,

What do you think about adding these tutorials into clerezza as an example
module? You can check Tika as an example:
https://github.com/apache/tika/tree/main/tika-example

By the way, Yusuf, could you update the first tutorial if there is not any
problem left?

Kind Regards,
Furkan KAMACI

On Tue, May 25, 2021 at 9:39 PM Yusuf Karadağ <[email protected]>
wrote:

> Hello!
> So i've tried to run tutorial with *representation *module. But it kept
> giving *null. *I've kept track of it and it's giving in this line of
> *Parser.class:
> *
>
> ParsingProvider provider =
> (ParsingProvider)this.providerMap.get(deParameterizedIdentifier);
>
> It can't get the provider and throws
> *UnsupportedParsingFormatException.*
>
>
> *and the output was:
> [main] INFO org.apache.clerezza.representation.Parser - constructing Parser
> [main] WARN org.apache.clerezza.tutorial.Example02 - text/turtle is
> not supported by the used parser
>
> *
>
> Then I tried with the dependencies as written in Tutorial 2. I moved
> *example02.ttl *file under *resources *directory of module and made a
> change in the code as:
> package org.apache.clerezza.tutorial;
> import org.apache.clerezza.commons.rdf.Graph;import
> org.apache.clerezza.commons.rdf.Triple;import
> org.apache.clerezza.rdf.core.serializedform.Parser;import
> org.apache.clerezza.rdf.core.serializedform.SupportedFormat;import
>
> org.apache.clerezza.rdf.core.serializedform.UnsupportedFormatException;import
> org.slf4j.Logger;import org.slf4j.LoggerFactory;
> import java.io.InputStream;import java.util.Iterator;
> public class Example02 {
>
>     private static final Logger logger = LoggerFactory.getLogger(
> Example02.class );
>
>     public static void main( String[] args ) {
>
>         InputStream inputStream =
> Example02.class.getClassLoader().getResourceAsStream( "example02.ttl"
> );
>         Parser parser = Parser.getInstance();
>
>         try {
>             Graph graph = parser.parse( inputStream,
> SupportedFormat.TURTLE );
>
>             Iterator<Triple> iterator = graph.filter( null, null, null );
>             Triple triple;
>
>             while ( iterator.hasNext() ) {
>                 triple = iterator.next();
>                 logger.info( String.format( "%s %s %s",
>                         triple.getSubject().toString(),
>                         triple.getPredicate().toString(),
>                         triple.getObject().toString()
>                 ) );
>             }
>         } catch ( UnsupportedFormatException ex ) {
>             logger.warn( String.format( "%s is not supported by the
> used parser", SupportedFormat.TURTLE ) );
>         }
>     }
> }
>
> And i got the output as:
>
> SLF4J: Class path contains multiple SLF4J bindings.
> SLF4J: Found binding in
>
> [jar:file:/C:/Users/yusufkaradag2/.m2/repository/org/slf4j/slf4j-simple/1.7.25/slf4j-simple-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
> SLF4J: Found binding in
>
> [jar:file:/C:/Users/yusufkaradag2/.m2/repository/org/slf4j/slf4j-log4j12/1.7.6/slf4j-log4j12-1.7.6.jar!/org/slf4j/impl/StaticLoggerBinder.class]
> SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an
> explanation.
> SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]
> [main] INFO org.apache.clerezza.rdf.core.serializedform.Parser -
> constructing Parser
> [main] INFO org.apache.clerezza.tutorial.Example02 -
> org.apache.clerezza.rdf.jena.commons.JenaBNodeWrapper@4e636c84
> <http://clerezza.apache.org/2017/01/example#hasFirstName>
> "Hasan"^^<http://www.w3.org/2001/XMLSchema#string>
> [main] INFO org.apache.clerezza.tutorial.Example02 -
> org.apache.clerezza.rdf.jena.commons.JenaBNodeWrapper@4e636c84
> <http://clerezza.apache.org/2017/01/example#isA>
> <http://clerezza.apache.org/2017/01/example#ClerezzaUser>
>
> I hope i managed to tell what i meant. Just a bit confused why it
> didn't work with *representation* module. Should i try with
> *representation *or this is fine?
>
> Regards!
>
>
>
> On Tue, May 25, 2021 at 2:33 PM Hasan <[email protected]> wrote:
>
> > Hi Yusuf
> >
> > I'd be glad if you could try to fix tutorial 2 as well
> > http://clerezza.apache.org/getting-started/tutorial/tutorial-02/
> >
> > Best regards
> >
> > Hasan
> >
>
>
> --
> Yusuf
>

Reply via email to